Google Shopping Feed: Availability Line in Source Code

For general questions and discussions specific to the AbleCommerce GOLD ASP.Net shopping cart software.
Post Reply
MaryP
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 43
Joined: Wed Oct 22, 2014 10:20 am

Google Shopping Feed: Availability Line in Source Code

Post by MaryP » Fri Apr 24, 2015 8:39 am

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

User avatar
Katie
AbleCommerce Admin
AbleCommerce Admin
Posts: 2651
Joined: Tue Dec 02, 2003 1:54 am
Contact:

Re: Google Shopping Feed: Availability Line in Source Code

Post by Katie » Fri Apr 24, 2015 3:49 pm

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
Thank you for choosing AbleCommerce!

http://help.ablecommerce.com - product support
http://wiki.ablecommerce.com - developer support

MaryP
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 43
Joined: Wed Oct 22, 2014 10:20 am

Re: Google Shopping Feed: Availability Line in Source Code

Post by MaryP » Wed Apr 29, 2015 6:20 am

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...

MaryP
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 43
Joined: Wed Oct 22, 2014 10:20 am

Re: Google Shopping Feed: Availability Line in Source Code

Post by MaryP » Tue Oct 13, 2015 4:51 am

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!

User avatar
Naveed
Rear Admiral (RADM)
Rear Admiral (RADM)
Posts: 611
Joined: Thu Apr 03, 2008 4:48 am

Re: Google Shopping Feed: Availability Line in Source Code

Post by Naveed » Tue Oct 13, 2015 5:20 am

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

MaryP
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 43
Joined: Wed Oct 22, 2014 10:20 am

Re: Google Shopping Feed: Availability Line in Source Code

Post by MaryP » Tue Oct 13, 2015 5:24 am

Thanks, Naveed. Does AbleCommerce provide the required mircrodata in the most recent version, R11?

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Google Shopping Feed: Availability Line in Source Code

Post by mazhar » Tue Oct 13, 2015 5:38 am

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.

User avatar
Naveed
Rear Admiral (RADM)
Rear Admiral (RADM)
Posts: 611
Joined: Thu Apr 03, 2008 4:48 am

Re: Google Shopping Feed: Availability Line in Source Code

Post by Naveed » Tue Oct 13, 2015 5:43 am

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.

User avatar
Katie
AbleCommerce Admin
AbleCommerce Admin
Posts: 2651
Joined: Tue Dec 02, 2003 1:54 am
Contact:

Re: Google Shopping Feed: Availability Line in Source Code

Post by Katie » Tue Oct 13, 2015 5:45 am

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.
Thank you for choosing AbleCommerce!

http://help.ablecommerce.com - product support
http://wiki.ablecommerce.com - developer support

MaryP
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 43
Joined: Wed Oct 22, 2014 10:20 am

Re: Google Shopping Feed: Availability Line in Source Code

Post by MaryP » Tue Oct 13, 2015 6:45 am

Thanks, y'all!

Brewhaus
Vice Admiral (VADM)
Vice Admiral (VADM)
Posts: 878
Joined: Sat Jan 19, 2008 4:30 pm

Re: Google Shopping Feed: Availability Line in Source Code

Post by Brewhaus » Tue Oct 13, 2015 8:08 am

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
Rick Morris
Brewhaus (America) Inc.
Hot Sauce Depot

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Google Shopping Feed: Availability Line in Source Code

Post by mazhar » Wed Oct 14, 2015 2:05 am

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>
<%} %>

MaryP
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 43
Joined: Wed Oct 22, 2014 10:20 am

Re: Google Shopping Feed: Availability Line in Source Code

Post by MaryP » Thu Oct 22, 2015 11:13 am

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

User avatar
Naveed
Rear Admiral (RADM)
Rear Admiral (RADM)
Posts: 611
Joined: Thu Apr 03, 2008 4:48 am

Re: Google Shopping Feed: Availability Line in Source Code

Post by Naveed » Mon Oct 26, 2015 7:14 am

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.

Brewhaus
Vice Admiral (VADM)
Vice Admiral (VADM)
Posts: 878
Joined: Sat Jan 19, 2008 4:30 pm

Re: Google Shopping Feed: Availability Line in Source Code

Post by Brewhaus » Thu Oct 29, 2015 7:58 am

Thank you, Naveed. I will make the changes and have Mary check it all.

Rick
Rick Morris
Brewhaus (America) Inc.
Hot Sauce Depot

MaryP
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 43
Joined: Wed Oct 22, 2014 10:20 am

Re: Google Shopping Feed: Availability Line in Source Code

Post by MaryP » Thu Oct 29, 2015 8:23 am

It works! Thank you, Naveed, you're awesome!

kwikstand
Commodore (COMO)
Commodore (COMO)
Posts: 410
Joined: Mon Feb 19, 2007 8:12 pm
Contact:

Re: Google Shopping Feed: Availability Line in Source Code

Post by kwikstand » Sat Jul 30, 2016 3:53 pm

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.
Contractor's Solutions
www. contractors-solutions.net

User avatar
xplosi0n1
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 30
Joined: Mon Nov 30, 2009 10:54 am
Location: Dayton, OH
Contact:

Re: Google Shopping Feed: Availability Line in Source Code

Post by xplosi0n1 » Thu Jul 19, 2018 5:53 am

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
Thanks,
Mike

CheapBowlingBalls.com
3204 Woodman Drive
Kettering, OH 45420
937.559.1541
mikeh@cheapbowlingballs.com
www.cheapbowlingballs.com

User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Re: Google Shopping Feed: Availability Line in Source Code

Post by jmestep » Sun Jul 22, 2018 9:55 pm

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.
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx

User avatar
xplosi0n1
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 30
Joined: Mon Nov 30, 2009 10:54 am
Location: Dayton, OH
Contact:

Re: Google Shopping Feed: Availability Line in Source Code

Post by xplosi0n1 » Sun Jul 22, 2018 11:47 pm

Judy,

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

CheapBowlingBalls.com
3204 Woodman Drive
Kettering, OH 45420
937.559.1541
mikeh@cheapbowlingballs.com
www.cheapbowlingballs.com

User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Re: Google Shopping Feed: Availability Line in Source Code

Post by jmestep » Tue Jul 24, 2018 10:07 pm

It looks like on your site it is in ConLib/BuyProductDialog. You can search for itemprop="price".
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx

User avatar
xplosi0n1
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 30
Joined: Mon Nov 30, 2009 10:54 am
Location: Dayton, OH
Contact:

Re: Google Shopping Feed: Availability Line in Source Code

Post by xplosi0n1 » Wed Jul 25, 2018 1:39 am

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>
Thanks,
Mike

CheapBowlingBalls.com
3204 Woodman Drive
Kettering, OH 45420
937.559.1541
mikeh@cheapbowlingballs.com
www.cheapbowlingballs.com

User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Re: Google Shopping Feed: Availability Line in Source Code

Post by jmestep » Thu Jul 26, 2018 12:31 am

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.
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx

meer2005
Captain (CAPT)
Captain (CAPT)
Posts: 245
Joined: Wed Feb 09, 2005 2:00 pm

Re: Google Shopping Feed: Availability Line in Source Code

Post by meer2005 » Sun Oct 28, 2018 3:10 am

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?

Post Reply