Page 1 of 1

schema.org missing markup

Posted: Mon Mar 19, 2018 10:58 am
by foodsleuth
I used Google's structured data tool to see why google says we have errors in the markup. My product page has 2 issues:
1. The "price" markup is including the $. The markup should just show "10.00" for price, instead it says "$10.00". The test shows this error:

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

Here is the error in the code the test points to:

<span itemprop="offers" itemscope itemtype="http://schema.org/Offer">
<span itemprop="price">
$33.95
</span>

2. The more serious of issues is the markup for "name" is missing all together. The test shows this error:

Here is the error in the code the test points to:


name A value for the name field is required. Then they show me the code I guess where it belongs?
<div id="productPage" class="mainContentWrapper" itemtype="http://schema.org/Product" itemscope>


Can someone point me to where in the code I'd go to try to fix this?
Thanks
Barb

Re: schema.org missing markup

Posted: Mon Mar 19, 2018 9:43 pm
by jmestep
For price, I have changed code like basePriceWithVAT.LSCurrencyFormat("ulc") to basePriceWithVAT.ToString("F2") in the .cs file then put a $ in the .ascx file before the <span itemprop="price"> so that it isn't picked up in the microdata in the BuyProductDialog . In ProductPage.ascx, the product name label should include itemprop="name" like it comes in AC default code. <asp:Label ID="ProductName" runat="server" EnableViewState="false" itemprop="name"></asp:Label>

Re: schema.org missing markup

Posted: Tue Mar 20, 2018 9:29 am
by foodsleuth
Hi Judy!
Thanks for that info. Interestingly that line of code IS in my ProductPage.ascx, identical to the line you showed, other than it is wrapped in an H1 tag.
<h1><asp:Label ID="ProductName" runat="server" EnableViewState="false" itemprop="name"></asp:Label></h1>

Any other thoughts?

Re: schema.org missing markup

Posted: Tue Mar 20, 2018 10:20 am
by foodsleuth
Viewing source for one of my product pages it looks like maybe the "itemprop" needs to be inside the line with the H1 tag? I have no idea where to find that.

<div id="ctl00_ctl00_NestedMaster_PageHeader_StoreHeader_H_PageCaption" class="row captionCantainer">
<div class="col-md-6">
<h1 style="font-size:28px; color:#032834;font-family:'Bitter',serif;margin:5px 0;"><span id="ctl00_ctl00_NestedMaster_PageHeader_StoreHeader_H_nameLabel">epazote dried bulk 1lb</span></h1>
</div>

Re: schema.org missing markup

Posted: Tue Mar 20, 2018 10:07 pm
by jmestep
It looks like the product name is in the store header
StoreHeader_H_nameLabel
I don't know if changing that will work or not because in default AC code the wrapper for the product microdata is in Product.aspx and normally the header is outside that.
<div id="productPage" class="mainContentWrapper" itemtype="http://schema.org/Product" itemscope>

Re: schema.org missing markup

Posted: Thu Apr 19, 2018 6:33 am
by kwikstand
Actually, Microdata is becoming outdated. If you are going to go through the trouble to to correct or improve the Schema Markup, you might as well switch it to JSON-LD.

Does anybody know if Able is going to be doing this soon?

Re: schema.org missing markup

Posted: Tue Mar 12, 2019 6:32 am
by foodsleuth
jmestep wrote:It looks like the product name is in the store header
StoreHeader_H_nameLabel
I don't know if changing that will work or not because in default AC code the wrapper for the product microdata is in Product.aspx and normally the header is outside that.
<div id="productPage" class="mainContentWrapper" itemtype="http://schema.org/Product" itemscope>
Hi Judy,
I got waylaid.. My store header h1 code looks like this:
<div id="PageCaption" runat="server" class="row captionCantainer">
<div class="col-md-6">
<h1 style="font-size:28px; color:#032834;font-family:'Bitter',serif;margin:5px 0;"><asp:Label ID="nameLabel" runat="server"></asp:Label></h1>
</div>
<div id="topSearch" class="col-md-6">
<div class="search">
<uc:SimpleSearch runat="server" ID="SimpleSearch" />
</div>

Should I change something here? Seems like such a small thing yet, it's a big thing! :shock: :shock:

Also, I noticed in the ProductPage.axcs.cs this is commented out:
if(_Product != null)
{
//ProductName.Text = _Product.Name;

Thanks!
Barb

Re: schema.org missing markup

Posted: Tue Mar 12, 2019 8:59 pm
by jmestep
It's hard to tell for sure without seeing all your code but if <asp:Label ID="nameLabel" runat="server"></asp:Label> shows the product name, you would add itemprop="name" to that markup and leave everything else the same.

Re: schema.org missing markup

Posted: Thu Mar 14, 2019 3:08 am
by foodsleuth
Hi Judy,
I added the itemprop="name" and when I view source I see this:
<div id="ctl00_ctl00_NestedMaster_PageHeader_StoreHeader_H_PageCaption" class="row captionCantainer">
<div class="col-md-6">
<h1 style="font-size:28px; color:#032834;font-family:'Bitter',serif;margin:5px 0;"><span id="ctl00_ctl00_NestedMaster_PageHeader_StoreHeader_H_nameLabel" itemprop="name">taste of mexico</span></h1>

But when I check it in Google they still says it's missing. Maybe because it needs a reference to --> itemtype="http://schema.org/Product" itemscope>?

Re: schema.org missing markup

Posted: Thu Mar 14, 2019 3:51 am
by foodsleuth
As a stop-gap fix I'm trying to get rid of the h1 product name in the store header and let the original one in the product page show. I tried to comment it out but did something incorrectly and it broke the page. For now I made it an h2, so I don't have 2 h1's but I have the product name showing twice (ugly).
How do I properly comment out just the product name (not the search stuff): Here is the code for the product name and the search that shows at the top of my page.

<div id="PageCaption" runat="server" class="row captionCantainer">
<div class="col-md-6">
<h2 style="font-size:28px; color:#ffffff;font-family:'Bitter',serif;margin:5px 0;"><asp:Label ID="nameLabel" runat="server" itemprop="name"></asp:Label></h2>
</div>
<div id="topSearch" class="col-md-6">
<div class="search">
<uc:SimpleSearch runat="server" ID="SimpleSearch" />
</div>
</div>
</div>

Re: schema.org missing markup

Posted: Sun Mar 17, 2019 9:15 pm
by jmestep
There is probably code in the code behind that populates the nameLabel so you need to comment that out also
You can hide it and leave the code behind the same by adding Visible="false" to the nameLabel tag or using html comments <!-- xxx -->
<h2 style="font-size:28px; color:#ffffff;font-family:'Bitter',serif;margin:5px 0;"><asp:Label ID="nameLabel" runat="server" itemprop="name"></asp:Label></h2>