Creating Google Merchant Product Feed for Configurable & Simple Products
Managing product feeds for e-commerce platforms can be challenging when dealing with both configurable and simple products. In this post, we’ll guide you through the process of creating a Google Merchant feed that accurately represents the relationship between these two product types.
Understanding the Relationship
Before diving into code, let’s clarify the relationship between configurable and simple products in Magento:
- Configurable Products: These are base products with multiple attributes and variations (simple products).
- Simple Products: These are individual items representing a specific variation of the configurable product.
Preparing Your Product Data
To create an effective feed, ensure your product data is properly structured in Magento:
- Create a new attribute set for the configurable product.
- Add all necessary variants as child simple products.
- Assign SKU values uniquely to each simple product.
Generating the Feed XML File
For this example, we’ll use the [Magento Google Shopping extension][magento-gs-ext] available on Laravel Company’s marketplace. Here’s how to generate a feed file:
- Navigate to Catalog > Google Base Feed.
- Click on “Manage Feats.”
- Select your existing feed or create a new one.
- Choose the attributes you want to include in the feed, like SKU, Price, URL, etc.
Mapping Configurable Products
The key is mapping the configurable product data with its corresponding simple products:
- Ensure your configurable product has an associated attribute set (e.g., “Default Config”).
- In the Google Base Feed management page, map the configurable product’s attributes to their respective simple product counterparts.
- For example, map the “SKU” attribute of the configurable product to the “SKU” attribute of its child products.
The Resulting XML Feed
After mapping and generating your feed, you’ll find an XML file (e.g., google_base_feed.xml). Here’s a snippet of what it might look like:
<item>
<g:product_type>Configurable Product</g:product_type>
<g:gtin>123456789012</g:gtin>
<g:sku>CONFIG-SKU-001</g:sku>
<g:title>Example Configurable Product</g:title>
<g:description>This is a sample configurable product.</g:description>
<g:link>https://example.com/configurable-product-url</g:link>
</item>
<item>
<g:product_type>Simple Product</g:product_type>
<g:gtin>123456789012</g:gtin>
<g:sku>SIMPLE-SKU-001</g:sku>
<g:title>Example Configurable Product - Variation A</g:title>
<g:description>Variation A of the sample configurable product.</g:description>
<g:link>https://example.com/simple-product-url-A</g:link>
<g:condition>new</g:condition>
<g:price currency="USD">19.99</g:price>
</item>
Conclusion
Creating a Google Merchant feed for configurable and simple products requires careful data management and proper mapping within your e-commerce platform. By following the steps outlined in this post, you can generate an XML feed that accurately represents both product types while maintaining the correct relationships between them.
Remember to validate your feed using [Google’s Feed Validation Tool][google-feed-validation] before submitting it. If you encounter any issues or need more advanced customization options, consider exploring our [Laravel Company marketplace][laravel-marketplace] for specialized extensions and tools designed to streamline your e-commerce operations.
Happy selling!