Page 1 of 1

Google Shopping Feed: Availability Line in Source Code

Posted: Fri Apr 24, 2015 8:39 am
by MaryP
Hi y'all,

We have been receiving warning/notifications recently for our items in Google Shopping/Merchant Center because of "Availability." In our Merchant Center account, under Settings > Automatic Item Updates > Availability, it says that none of our items "are currently being updated due to certain warnings."

I called Google, and they referred me to this page for assistance, https://support.google.com/merchants/an ... 9143?hl=en, stating that the "Availability" line was missing from our source code. The code that is missing is " <meta itemprop="availability" content="http://schema.org/InStock"/>Available online"

Can someone please advise where I should enter this on the back end? Where do I find this source code? Has anyone else had this issue? We are using GOLD R8.

Thanks in advance!!
Mary

Re: Google Shopping Feed: Availability Line in Source Code

Posted: Fri Apr 24, 2015 3:49 pm
by Katie
Hi Mary,

I think there may be something else going on. The availability attribute has been supported for a long time. In Gold R5, we added Google Feed support for variants, so I am not sure why you are getting an error in Gold R8. The feed is a popular feature, and if it was missing a required attribute, I think we would have heard about it from other customers.

If you open the \app_code\GoogleFeed.cs, you can easily see the 'availability' code.

Do you know if the products are variants? Have you looked at your feed file to see what is being output? It should be in the \feeds\ folder.

Thanks
Katie

Re: Google Shopping Feed: Availability Line in Source Code

Posted: Wed Apr 29, 2015 6:20 am
by MaryP
Thanks, Katie. The products are not variants, and we're getting the error for all of our products, hundreds of them. I can see in the feed file "in stock" "out of stock" etc. for each product, but I'm not sure why Google Shopping isn't registering that. When I call Google to troubleshoot, they keep telling me that they are looking at my source code, and that the problem is with the source code. :( I'm not sure what else to do...

Re: Google Shopping Feed: Availability Line in Source Code

Posted: Tue Oct 13, 2015 4:51 am
by MaryP
Hi Katie, have you heard anything back on this yet? If you have a live site demo of AbleCommerce 11, I can tell if it has all the correct schema in the most recent release. I also have a question about the rel=canonical tag for pages in a series.

Thanks!

Re: Google Shopping Feed: Availability Line in Source Code

Posted: Tue Oct 13, 2015 5:20 am
by Naveed
From the "About microdata for Google Shopping" page I can see that:
Specifying price, priceCurrency, and availability is required for automatic item updates.
It seems that you have enabled the automatic item updates and Able Commerce do not provide the required microdata ("itemprop" for availability) at the product retail page.
<meta itemprop="availability" content="http://schema.org/InStock"/>Available online
So, you should either disable the automatic item updates, or update the product retail page and add code for above required "itemprop". To disable the disable automatic item updates check the "Reverting an automatic update" section at following link:
https://support.google.com/merchants/answer/3246284

Re: Google Shopping Feed: Availability Line in Source Code

Posted: Tue Oct 13, 2015 5:24 am
by MaryP
Thanks, Naveed. Does AbleCommerce provide the required mircrodata in the most recent version, R11?

Re: Google Shopping Feed: Availability Line in Source Code

Posted: Tue Oct 13, 2015 5:38 am
by mazhar
You can make the following updates to emit required details. First edit the ConLib/BuyProductDialog.ascx.cs and locate following line of code

Code: Select all

InventoryDetailsPanel.Controls.Add(new LiteralControl(inStockMessage));
and update it like

Code: Select all

InventoryDetailsPanel.Controls.Add(new LiteralControl("<meta itemprop=\"availability\" content=\"http://schema.org/InStock\"/>"));
InventoryDetailsPanel.Controls.Add(new LiteralControl(inStockMessage));
Then locate following line of code

Code: Select all

InventoryDetailsPanel.Controls.Add(new LiteralControl(outOfStockMessage));
and update it like

Code: Select all

InventoryDetailsPanel.Controls.Add(new LiteralControl("<meta itemprop=\"availability\" content=\"http://schema.org/OutOfStock\"/>"));
InventoryDetailsPanel.Controls.Add(new LiteralControl(outOfStockMessage));
Then recheck the merchant center and see if it makes any difference.

Re: Google Shopping Feed: Availability Line in Source Code

Posted: Tue Oct 13, 2015 5:43 am
by Naveed
Does AbleCommerce provide the required mircrodata in the most recent version, R11?
I am sorry to say that AbleCommerce R11 do not support this as well, so you should try the workaround posted by Mazhar.

Re: Google Shopping Feed: Availability Line in Source Code

Posted: Tue Oct 13, 2015 5:45 am
by Katie
Does AbleCommerce provide the required mircrodata in the most recent version, R11?
No, but I requested a feature enhancement so it will be supported in our next version. I did not realize you were using an Automatic Update option.

Re: Google Shopping Feed: Availability Line in Source Code

Posted: Tue Oct 13, 2015 6:45 am
by MaryP
Thanks, y'all!

Re: Google Shopping Feed: Availability Line in Source Code

Posted: Tue Oct 13, 2015 8:08 am
by Brewhaus
Thank you for the code, Mazhar. That did get the price and availability schemas to show up for Google. Google also requires the currency schema. Please let me know how we can add this to the schemas. It doesn't matter to us if we hard code it, as we only sell in one currency (USD).

Rick

Re: Google Shopping Feed: Availability Line in Source Code

Posted: Wed Oct 14, 2015 2:05 am
by mazhar
Brewhaus wrote:Thank you for the code, Mazhar. That did get the price and availability schemas to show up for Google. Google also requires the currency schema. Please let me know how we can add this to the schemas. It doesn't matter to us if we hard code it, as we only sell in one currency (USD).

Rick
Edit ConLib/Utility/ProductPrice.ascx file and locate following code

Code: Select all

<%if (IncludeRichSnippetsWraper)
  { %>
  </span>
<%} %>

and update it like

Code: Select all

<%if (IncludeRichSnippetsWraper)
  { %>
  <meta itemprop="priceCurrency" content="USD" />
  </span>
<%} %>

Re: Google Shopping Feed: Availability Line in Source Code

Posted: Thu Oct 22, 2015 11:13 am
by MaryP
Hi mazhar,

We made the changes but now we're getting errors for the price and availability schemas for the product pages, which you can see when you test it with Google's Structured Data Testing Tool. I'm unable to upload a screenshot, but if you visit developers.google.com/structured-data/testing-tool/ and enter http://www.hotsaucedepot.com/Daves-Insa ... Sauce.aspx for the URL, you will see the exact errors.

How can we fix this?

Thank you,
Mary

Re: Google Shopping Feed: Availability Line in Source Code

Posted: Mon Oct 26, 2015 7:14 am
by Naveed
I have checked the issues with your mentioned page http://www.hotsaucedepot.com/Daves-Insa ... Sauce.aspx using the developers.google.com/structured-data/testing-tool/, one issue is about missing price, and related to following code lines:

Code: Select all

<span itemprop="offers" itemscope itemtype="http://schema.org/Offer">
                            
      <meta itemprop="priceCurrency" content="USD" />
      </span>
    $5.49
  </span>
The generated code is not correct and it should be something like:

Code: Select all

<span itemprop="offers" itemscope itemtype="http://schema.org/Offer">
    <span itemprop="price">$5.49</span>
    <meta itemprop="priceCurrency" content="USD" />
    <meta itemprop="availability" content="http://schema.org/InStock"/>
</span>
There seems a problem with the changes you made while editing ConLib/Utility/ProductPrice.ascx file. I suggest to revert ALL the earlier changes suggested by Mazhar. I am attaching updated files for reference, which you can use to compare and fix your code. Here I explain the required changes:

1. Edit the ~/ConLib/BuyProductDialog.ascx.cs file and add the following function just above "Page_Init" function. This will return the product availability status:

Code: Select all

        protected string ProductAvailabilityStatus
        {
            get 
            { 
                string inStockValue = "http://schema.org/InStock";
                string outStockValue = "http://schema.org/OutOfStock";
                if (!AbleContext.Current.Store.Settings.EnableInventory || _Product.InventoryMode == InventoryMode.None 
                    || _Product.AllowBackorder)
                    return inStockValue;

                bool allProductOptionsSelected = (_SelectedOptionChoices.Count == _Product.ProductOptions.Count);
                bool requiredKitOptionsSelected = AbleCommerce.Code.ProductHelper.RequiredKitOptionsSelected(_Product, _SelectedKitProducts);

                if (allProductOptionsSelected && requiredKitOptionsSelected)
                {
                    string optionList = ProductVariantDataSource.GetOptionList(_ProductId, _SelectedOptionChoices, true);

                    IInventoryManager inventoryManager = AbleContext.Resolve<IInventoryManager>();
                    InventoryManagerData inv = inventoryManager.CheckStock(_ProductId, optionList, _SelectedKitProducts);

                    if (inv.InStock > 0)
                    {
                        return inStockValue;
                    }
                    else
                    {
                        return outStockValue;
                    }
                }

                return inStockValue;
            }
        }
2. Edit the ~/ConLib/BuyProductDialog.ascx file and locate the following code:

Code: Select all

<span itemprop="offers" itemscope itemtype="http://schema.org/Offer">
        <uc:ProductPrice ID="OurPrice" runat="server" EnableDefaultKitProducts="false" HideZeroPrice="false" IncludeRichSnippetsWraper="True" />
</span>
And replace with:

Code: Select all

<span itemprop="offers" itemscope itemtype="http://schema.org/Offer">
        <uc:ProductPrice ID="OurPrice" runat="server" EnableDefaultKitProducts="false" HideZeroPrice="false" IncludeRichSnippetsWraper="True" />
	<meta itemprop="availability" content="<%=ProductAvailabilityStatus%>" />
</span>
So, we just added "<meta itemprop="availability" content="<%=ProductAvailabilityStatus%>" />" code under the <uc:ProductPrice/> tag.

3. Edit the ConLib/Utility/ProductPrice.ascx file and locate the following code:

Code: Select all

<%if (IncludeRichSnippetsWraper)
  { %>
  <span itemprop="price">
<%} %>
<asp:Literal ID="Price" runat="server"></asp:Literal>
<%if (IncludeRichSnippetsWraper)
  { %>
  </span>
<%} %>

And replace with

Code: Select all

<%if (IncludeRichSnippetsWraper)
  { %>
  <span itemprop="price">
<%} %>
<asp:Literal ID="Price" runat="server"></asp:Literal>
<%if (IncludeRichSnippetsWraper)
  { %>
  </span>
  <meta itemprop="priceCurrency" content="USD" />
<%} %>
So, we just added a new line of code " <meta itemprop="priceCurrency" content="USD" />".

Save changes and compile the project.

Re: Google Shopping Feed: Availability Line in Source Code

Posted: Thu Oct 29, 2015 7:58 am
by Brewhaus
Thank you, Naveed. I will make the changes and have Mary check it all.

Rick

Re: Google Shopping Feed: Availability Line in Source Code

Posted: Thu Oct 29, 2015 8:23 am
by MaryP
It works! Thank you, Naveed, you're awesome!

Re: Google Shopping Feed: Availability Line in Source Code

Posted: Sat Jul 30, 2016 3:53 pm
by kwikstand
I just did it and it solved the priceCurrency error but I still get the error:
$1,339.00 (The property $1,339.00 is not a valid price specification.

Re: Google Shopping Feed: Availability Line in Source Code

Posted: Thu Jul 19, 2018 5:53 am
by xplosi0n1
Hello All,

Can someone please circle back to this post and see if there is a way to correct this last issue.

$169.95 (The property $169.95 is not a valid price specification.

I have followed all the steps from above from both Mazhar and Naveed and still get this error from the Google Structure Data Testing Tool

See test here - https://search.google.com/structured-da ... Drive.aspx

Any help will be appreciated. We are using Gold R10

Re: Google Shopping Feed: Availability Line in Source Code

Posted: Sun Jul 22, 2018 9:55 pm
by jmestep
You need to move the dollar sign outside the tag. Then change the price display in the code behind to something like .LSCurrencyFormat("ulcf") or .ToString("F2") - off the top of my head.

Re: Google Shopping Feed: Availability Line in Source Code

Posted: Sun Jul 22, 2018 11:47 pm
by xplosi0n1
Judy,

Can you elaborate on what file this would be done under, I can't seem to locate where to do this at.

Re: Google Shopping Feed: Availability Line in Source Code

Posted: Tue Jul 24, 2018 10:07 pm
by jmestep
It looks like on your site it is in ConLib/BuyProductDialog. You can search for itemprop="price".

Re: Google Shopping Feed: Availability Line in Source Code

Posted: Wed Jul 25, 2018 1:39 am
by xplosi0n1
Judy,

Here is all the pricing code I could locate on the BuyProductDialog.ascx

Code: Select all

 <%--<tr id="trRegPrice" runat="server" enableviewstate="false">
                    <th class="rowHeader">
                        <asp:Localize ID="RegPriceLocalize" runat="server" Text="Reg. Price:" EnableViewState="false"></asp:Localize> 
                    </th>
                    <td>
                        <asp:Label ID="RegPrice" runat="server" SkinID="MSRP" EnableViewState="false"></asp:Label>
                    </td>
                </tr>--%>
                <%--<tr id="trOurPrice" runat="server" EnableViewState="false" class="priceLabel">
                    <th class="rowHeader">
                        <asp:Localize ID="OurPriceLocalize" runat="server" Text="Our Price:" EnableViewState="false"></asp:Localize>        
                    </th>
                    <td>
                        <span itemprop="offers" itemscope itemtype="http://schema.org/Offer">
                            <uc:ProductPrice ID="OurPrice" runat="server" EnableDefaultKitProducts="false" HideZeroPrice="false" IncludeRichSnippetsWraper="True" />
                        </span>
                    </td>
                </tr>--%>
                <tr id="trVariablePrice" runat="server" enableviewstate="false">
                    <th class="rowHeader">
                        <asp:Localize ID="VariablePriceLabel" runat="server" Text="Enter Price:" EnableViewState="false"></asp:Localize>
                    </th>
                    <td>
                        <asp:TextBox ID="VariablePrice" runat="server" MaxLength="8" Width="60px" ValidationGroup="AddToBasket"></asp:TextBox>
                        <asp:PlaceHolder ID="phVariablePrice" runat="server"></asp:PlaceHolder>
                    </td>
                </tr>

Re: Google Shopping Feed: Availability Line in Source Code

Posted: Thu Jul 26, 2018 12:31 am
by jmestep
At this point, I don't know what to say. It looks like the pricing display is commented out so it must be somewhere else.

Re: Google Shopping Feed: Availability Line in Source Code

Posted: Sun Oct 28, 2018 3:10 am
by meer2005
I just noticed that meta itemprop='url' is pulling the http version of the URL and not the HTTPS. How can we fix this? Also, how do we fix the dollar sign issue in R12?