Jump to content

[Resolved] Need to Split Itemprop for Currency Symbol and Price


Recommended Posts

The Structured Data test tool, https://search.google.com/structured-data/testing-tool#

is complaining that

Quote

(The property $19.00 is not a valid price specification. Learn more about http://schema.org/price.)

I need to split the itemprop code so the currency symbol is split off of the price. To do that I need to know what to use for the symbol itself, so it works with any currency, and how to stop CC from automatically adding the symbol to the price.

This is not satisfying Google:

<td><div itemprop="offers" itemscope itemtype="http://schema.org/Offer"><meta itemprop="priceCurrency" content="USD" /><span itemprop="price">{$PRODUCT.price}</span></div></td>

 

Edited by Dirty Butter
Link to comment
Share on other sites

Would something like this work?

<td>
  <div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
    <meta itemprop="priceCurrency" content="USD" />
    <meta itemprop="price" content="{$PRODUCT.full_base_price}"{* Example: 14.99 *} />
    <span>{$PRODUCT.price}</span>
  </div>
</td>

 

Link to comment
Share on other sites

In the template main.php, at the bottom, add {debug}, save the file, view a product, then remove {debug} from the template file. Do this as quickly as possible.

Do not dismiss the Smarty debug popup window as you will be able to scroll to the PRODUCT variable (or any other product-related variable) to see all the various elements that relate to that product. You don't want the {debug} popup to be seen by visitors, so that's why I suggest that once you get the popup, remove the {debug} command as quickly as possible.

Link to comment
Share on other sites

Interesting: this is what I have --

price_to_pay => 9
full_base_price => "10.00"
price_unformatted => "10.00"
sale_price_unformatted => 9

Unfortunately for me, 'price_to_pay' (note that javascript will update the displayed value based on options selected) and 'sale_price_unformatted' are in true integers, not strings.

But your store seems to have it.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...