How to remove .00 from price?

Follow

Comments

4 comments

  • Avatar
    Zetya Support

    Hi Ethan,

    It isn't different, but you have to be careful on the product page. Any theme that updates prices based on selected options will use JavaScript. You will need to change that (in product.liquid) so it also truncates the ".00". E.g:

                price = price.substring(0, price.indexOf('.00'));

    HTH, Gavin.

  • Avatar
    ethan

    Now that I have it done for the product page, is the process similar for the collection page?  Once again, I tried simply adding the remove '.00', but that did not work and I am being told that it has something to do with a javascript callback function...

    I looked around at the Shopify tutorial on javascript callbacks, and am not really getting very far.  Any help would be appreciated...

  • Avatar
    Zetya Support

    Hi Ethan,

    Vanity doesn't use callbacks on the collection page (open the gallery snippet to see the liquid code used to render collections).

    Thanks, Gavin.

  • Avatar
    ethan

    haha.  well, i just made myself look silly...  the code was tucked away in gallery.liquid for the collection price the whole time... haha. i need a better pair of glasses...

Please sign in to leave a comment.