Announcement

Collapse
No announcement yet.

Schema Code - Price Token Question

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

    Schema Code - Price Token Question

    We are currently implementing schema code onto our website onto our product page templates.

    I need to populate the product price using a miva token to exclude the dollar sign, but still include the trailing zeros (.00).

    I have tried using the following token:
    mvt:product:formatted_price;

    Using this code pulls the price of the product with the dollar sign into the schema code when the page is loaded as follows:
    $159.00

    I then tried using the following token:
    &mvt:product:price;

    Using this code pulls the product price into the schema code as follows:
    159

    So, my question is, how can i get the product price to pull into the schema code to contain the decimal and zeros, but without the dollar sign as follows?:
    159.00

    Thanks so much for any help.

    #2
    I have the following set up and it pulls correctly with no errors into the Structured Data Testing Tool, and doesnt affect the look of the price on the site since I used meta fields.

    Code:
    <p itemprop="offers" itemscope itemtype="http://schema.org/Offer"><span id="prodpricelabel">Price Each:</span><span id="price-value">&mvt:product:formatted_base_price;</span><meta itemprop="availability" content="In Stock" /><meta itemprop="priceCurrency" content="USD" /><meta itemprop="price" content="&mvt:product:base_price;" /></p>

    Comment


      #3
      If you really need a 10.2 type of number display, using :base_price won't work for whole dollar amounts.

      Easiest would be to remove the '$' from formatted <mvt:eval expr="glosub(l.settings:price:formatted_base_price , '$', '')"/>
      Bruce Golub
      Phosphor Media - "Your Success is our Business"

      Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
      phosphormedia.com

      Comment


        #4
        For what it's worth, I use mvt:product:formatted_price; and it works fine. No issues in Structured Data Testing Tool or on search engine result pages.
        Todd Gibson
        Oliver + S | Sewing Patterns for Kids and the Whole Family

        Comment


          #5
          or you can play with an unformatted price and... cheat with ROUND after
          Code:
          <mvt:assign name="g.old_price" value="12" />
          <mvt:assign name="g.new_price" value="g.old_price ROUND 2" />
          
          &mvt:global:new_price;  will output 12.00
          
          sure enough
          $&mvt:global:new_price;  will output $12.00

          Comment


            #6
            Thank you all for your help!

            Comment

            Working...
            X