Announcement

Collapse
No announcement yet.

Add 2 decimal places to unformatted price

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Bruce - PhosphorMedia
    replied
    yes. whatever the value you want to express as a two decimal place result. the assign is just an example, you would probably write it as
    [code]
    <mvt:assign name=l.my_result" value="rnd(l.settings:product:price, 2)" />
    and then use l.my_result for the feed.

    Leave a comment:


  • lesliekirk
    replied
    Originally posted by Bruce - PhosphorMedia View Post
    Code:
    <mvt:assign name="l.value" value="'10'" />
    <mvt:assign name="g.show" value="rnd(l.value, 2)" />
    [&mvt:global:show;]
    Should I be putting something other than '10' as the value?

    Leave a comment:


  • Bruce - PhosphorMedia
    replied
    Code:
    <mvt:assign name="l.value" value="'10'" />
    <mvt:assign name="g.show" value="rnd(l.value, 2)" />
    [&mvt:global:show;]

    Leave a comment:


  • lesliekirk
    started a topic Add 2 decimal places to unformatted price

    Add 2 decimal places to unformatted price

    The Google Merchant Center Next feed requires an unformatted price with 2 decimal places. If a product price is $1000.00, the feed gets 1000. Google's Merchant Center requirements need it to be 1000.00. It could be an easy down-and-dirty fix if all the prices just needed .00 added. It should also be noted that I am not using the
    Code:
    &mvt:record:price;
    because that would pull in a price of 0. The store builds the price from attributes and wants the product price to be a specific options price
    Code:
    &mvt:record:attribute_data[1]:options[2]:price;
Working...
X