Google variant feed for non-apparel items

For general questions and discussions specific to the AbleCommerce GOLD ASP.Net shopping cart software.
Post Reply
eileen
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 41
Joined: Sun Feb 11, 2007 10:59 pm
Location: Novato, CA
Contact:

Google variant feed for non-apparel items

Post by eileen » Sun Oct 05, 2014 3:36 pm

Has anyone tweaked the Google feed to include variants of non-apparel items?

While a variant feed is not required (yet) for non-apparel items, it is the only way a seller can comply with Google's rule against the feed of duplicate items. Computer/phone accessories and office supplies, for example, may be available in multiple colors. Separate product records for each color are viewed by Google as duplicate items.
http://support.google.com/merchants/bin ... er=1344057

There is a hitch. Google will only accept variants of Color, Size, Material, and Pattern for both apparel and non-apparel items. These variants are shared among all Google categories, and the feed must include at least one of these. We don't always use these labels. For example, sometimes we label the option as "Finish" (as in a walnut or natural finish on a wood product). Also, the items may have variants unrelated to Color, Size, Material, and Pattern, so I suppose the feed generator needs to be smart enough to ignore them.

merance
Ensign (ENS)
Ensign (ENS)
Posts: 11
Joined: Mon Dec 12, 2011 12:36 pm

Re: Google variant feed for non-apparel items

Post by merance » Mon Oct 13, 2014 7:02 am

I just tweaked mine to submit based on the checkbox. BTW I am not a developer so use at your own risk, do a backup of your regular file. All I did was change this line in the googlefeed.cs (located in the appcode file)

From
// check if we need to export product variants, for this we first need to check product google category.
// Variant-level information is required only for products in the “'Apparel & Accessories' category,
// and all related subcategories. Apparel variants are only required for feeds targeting the US, UK, DE, FR, and JP.
// For feeds targeting other countries, the attributes are recommended and may be required in the future.
bool isApparelProduct = googleCategory.Trim().StartsWith("apparel & accessories", StringComparison.InvariantCultureIgnoreCase);
if (isApparelProduct && product.PublishFeedAsVariants) variants = GetAvailableVariants(product);


To:
// check if we need to export product variants, for this we first need to check product google category.
// Variant-level information is required only for products in the “'Apparel & Accessories' category,
// and all related subcategories. Apparel variants are only required for feeds targeting the US, UK, DE, FR, and JP.
// For feeds targeting other countries, the attributes are recommended and may be required in the future.
if (product.PublishFeedAsVariants) variants = GetAvailableVariants(product);


The only work around is i still get the error message if I click the variant option in the item edit screen if it is NOT an apparel category BUT you can get that box selected without the popup error if you do it in the batch edit screen or by using import/export.

Everything seems to be working ok using this fix/workaround, but it has only been a day, so I take no responsibility if this breaks everything!

I also see lines of code in the feed where it looks like you could map different variant titles to different columns in the google feed:


if (optionName == "color") { colorOption = pOption.Option; colorOptionIndex = ++lastIndex; relatedOptions.Add(colorOption); optionListPattern += "{C}"; }
else if (optionName == "size") { sizeOption = pOption.Option; sizeOptionIndex = ++lastIndex; relatedOptions.Add(sizeOption); optionListPattern += "{S}"; }
else if (optionName == "material") { materialOption = pOption.Option; materialOptionIndex = ++lastIndex; relatedOptions.Add(materialOption); optionListPattern += "{M}"; }
else if (optionName == "pattern") { patternOption = pOption.Option; patternOptionIndex = ++lastIndex; relatedOptions.Add(patternOption); optionListPattern += "{P}"; }
else optionListPattern += "0"; // fill the options list pattern with zero

Seems to me, all you would have to do is add some else if statements for your options, and it should work. Experiment after making a backup!

I asked my "developers" about this type of fix, and they told me too complicated and not worth it, so I'm still worried that I'm missing something, but so far everything is working as it should...

Post Reply