wp-e-commerce / WP-e-Commerce

WP eCommerce - The most popular independent eCommerce platform for WordPress
https://wpecommerce.org
GNU General Public License v2.0
215 stars 217 forks source link

Review Google merchant feed #2355

Open mihaijoldis opened 6 years ago

mihaijoldis commented 6 years ago

Do a review of the Google merchant feed and add/remvoe fields based on requirements https://support.google.com/merchants/answer/7052112?hl=en

JustinSainton commented 6 years ago

Related: #1518, #1212

JeffPyeBrook commented 6 years ago

You might want to consider removing this functionality entirely from the system. If you want to keep it I have a plug-in that I wrote it does a pretty good job at generating a feed incrementally. I'd be happy to contribute the code.

The issue is that the product feed spec has evolved to the point where you need specific attributes based on specific product domains. Adding all of that user interface is going to be a lot of work. It will also be almost impossible to come up with a scheme that covers all the different product domains, using variations not using variations, and making sure all of those possibilities are covered with the required and recommended fields.

JustinSainton commented 6 years ago

@JeffPyeBrook Howdy! Would love to review a PR with your code! If it generates a valid feed in a performant way, and is extensible enough for developers to approach the various scenarios you mentioned - I'm game for it!

JeffPyeBrook commented 6 years ago

There are a bunch of issues that made me go with a standalone plugin. First and foremost is that the XML attributes for each product type are much different from the original Google feed specification.

Also critical, Google's behavior has changed when you have an invalid feed has changed. If you provide too many invalid items or provide an incomplete feed due to a website error. Such an error can easily occur if you get a PHP timeout when generating a feed on a few hundred items. After too many feed content errors or feed creation errors, Google can (and will) suspend your merchant account. The old version of the feed creation that mostly, kind of sort of worked, was no longer acceptable for this reason alone.

The plugin I have is very much suitable for developers, not so much for an end user. Essentially a call back for each of the data fields. The callbacks are implemented as WordPress filters overridden as necessary for the product domain. More important the feed is created one chunk at a time using a scheduled event. That means the feed is ready to go when Google asks for it. And creating the feed doesn't knock over the website if the number of items is large, or the hosting environment is less robust.

I am using the plugin on two sites, you can request it to see the content if you are interested. sparklegear.com and bling-transfers.com.

As an example of why the structure of the plugin is important the apparel feed is about to require a big update. The specification has changed again and individual sizes are going to be required rather than optional. I should only have to change a couple of the filter callbacks, rather than re-create the feed from scratch.

If you want to go with the plugin I could put it up in a repo to review. The goal would be to clean it up and turn it into a basic "scaffold" and provide detailed documentation so that a developer could provide the callbacks specific to the product domain they are supporting.

benhuson commented 6 years ago

I seem to remember @leewillis77 has a plugin that does something similar with a UI to map product categories to Google categories and handle colors etc: https://plugins.leewillis.co.uk/downloads/wp-e-commerce-product-feeds/

JustinSainton commented 6 years ago

For sure! If @JeffPyeBrook and @leewillis77 wanted to collaborate on a core-feasible solution here, that would be wonderful!