Page 1 of 1

Google - Structured Data Update

Posted: Fri Feb 03, 2017 5:36 am
by sfeher
Our SEO team is asking for us to make a change in the structured data code used on our store.
Specifically, they want the BuyProduct interface to change the formatting of currency.

For example, presently, the code uses LSCurrencyFormat("ulc") to format the product price to display as $100.00.
They want to remove the comma and currency symbol in favor of this code:

Code: Select all

<span itemprop="price">100.00</span>
<span itemprop="priceCurrency" syle="visibility: hidden;">USD</span>


I have some general concerns about 'how' this could even be sufficient for the customer, because this would essentially show the product Price as listed as "100.00" and not "$100.00" or even "100.00 USD"

As well, I'm not sure that we can even perform this change (easily) since we'd have to eliminate the formatting of the currency (LSCurrencyFormat("ulc")) from the /conlib/utility/ProductPrice.ascx.cs code.... which I believe would have a global effect (which I'm sure we DO NOT want).

Thoughts? Anyone else dealing with this issue?

Steve

Re: Google - Structured Data Update

Posted: Sun Feb 05, 2017 11:54 pm
by jmestep
I don't remember exactly what I did, but I do know that I put some of the tags on the page as <meta itemprop instead of spans so that they didn't change the display because they weren't visible in the browser.
You could also look into using jSon for the structured data so that you can do whatever you want with the display. You would have to take the existing tags off so they wouldn't be duplicated.

Re: Google - Structured Data Update

Posted: Thu Feb 09, 2017 9:43 am
by sfeher
Hi Judy --

Yes, the USD -- the Currency indicator tag -- belongs in the meta tag formatted this way:

Code: Select all

<meta itemprop="priceCurrency" content="USD" />

Now, the next task is to eliminate the $ symbol from the display of the actual price number. So that $1,400.00 appears as

Code: Select all

<span itemprop="price" content="1000.00">1,000.00</span>


Has anyone modified their copy of the ProductPrice.aspx page in the /conlib/Utility/ folder to avoid the currency designation in the numerical field?

Just concerned that editing the conlib has repercussions throughout other sections of the site. Probably just going to make a new Conlib page (Yeah -- another customization!) for this instance.

Thanks!
Steve

Re: Google - Structured Data Update

Posted: Thu Feb 09, 2017 11:49 pm
by jmestep
What I was suggesting was to take the itemprop="price" out of the span tag and add a meta tag with the correct info.

Re: Google - Structured Data Update

Posted: Fri Feb 10, 2017 3:56 am
by sfeher
Judy --

I don't think that's my problem -- "where" to place the data is easy to resolve.
My problem is that no matter what I do, I cannot seem to call the price field to be included without the "$" character.
The error I get from Google is this:

$1,995.00 (The property $1,995.00 is not a valid price specification. Learn more about http://schema.org/price.)
The structured data testing tool wants the price field to be submitted in the format of 1995.00 and not $1,995.00. This is really a question of formatting, I believe.

Mazhar, Katie -- how can we eliminate the currency formatting for Google's requirements?

Re: Google - Structured Data Update

Posted: Fri Feb 10, 2017 8:18 am
by Shopping Cart Admin
Hi All,

Have you tried removing the formatting in currencies?

/Admin/Store/Currencies/Default.aspx

Re: Google - Structured Data Update

Posted: Fri Feb 10, 2017 8:33 am
by sfeher
I have no interest in removing formatting of currencies -- there are many places where we WANT the currency symbol to appear.

The point here, is that Google's Structured Data tool requires the 'price' field to be submitted in a standard Schema.org compliant way.
Right now, by default this is not happening.

I need a way for the BuyProductDialog conlib to allow me to display the price as $1,995.00 and then include the meta field as:
<meta itemprop="price" content="1000.00">1000.00</meta>
or perhaps
<meta itemprop="price" content="1000.00"></meta>

Re: Google - Structured Data Update

Posted: Mon Feb 13, 2017 12:34 am
by jmestep
I might have done it in the past by putting the $ in front of the price in the html and replacing the LSCurrencyFormat with {0:F2} but I don't remember where or if that is exactly what I did.

Re: Google - Structured Data Update

Posted: Mon Feb 13, 2017 10:03 am
by sfeher
I ultimately found a way to manage this, thanks to some ideas from Judy (she is the "AbleCommerce Angel", for sure!), some sleuthing around, and good old-fashioned trial and error.

1.) I built a custom CONLIB for this because I didn't know how many other places the "price utility" would have been used throughout the site. Didn't want to effect every instance of the pricing field.

2.) In the custom conlib, I enabled the price to be called as

Code: Select all

 Price2.Text= string.Format("{0:F2}" ,_Product.Price); 
3.) in the .ascx file, I then simply displayed the Price2 field and set a static currency symbol ($) in front.


Might be another way to do this, but it works, and now, the Google Structured Data feed is accurate and working. Which was the goal.

Thanks!
Steve