Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.
Ruby b2b-commercee-commerceecommerceecommerce-apiecommerce-frameworkecommerce-platformheadlessheadless-commerceheadless-ecommercemarketplacemulti-tenantmulti-vendormulti-vendor-ecommerceopen-sourcespree-commerce
Add `item_group_id` to required_attributes for Google data feed (#13506)
m.b.949e17a43a02
diff --git a/core/app/services/spree/data_feeds/google/required_attributes.rb b/core/app/services/spree/data_feeds/google/required_attributes.rbindex c4c2c7b4ab..d244e5d366 100644--- a/core/app/services/spree/data_feeds/google/required_attributes.rb+++ b/core/app/services/spree/data_feeds/google/required_attributes.rb@@ -10,6 +10,7 @@ module Spreereturn failure(nil, error: 'No image link') if get_image_link(input[:variant], input[:product]).nil?information['id'] = input[:variant].id+ information['item_group_id'] = input[:product].idinformation['title'] = format_title(input[:product], input[:variant])information['description'] = get_description(input[:product], input[:variant])information['link'] = "#{input[:store].url}/products/#{input[:product].slug}"diff --git a/core/spec/services/spree/data_feeds/google/rss_spec.rb b/core/spec/services/spree/data_feeds/google/rss_spec.rbindex ed6a5fff76..5c6b91ab0a 100644--- a/core/spec/services/spree/data_feeds/google/rss_spec.rb+++ b/core/spec/services/spree/data_feeds/google/rss_spec.rb@@ -37,6 +37,10 @@ module Spreeexpect(result.value[:file]).to include("<g:id>#{variant.id}</g:id>").onceend+ it 'includes product id as item_group_id' do+ expect(result.value[:file]).to include("<g:item_group_id>#{product.id}</g:item_group_id>").once+ end+it 'includes title' doexpect(result.value[:file]).to include("<g:title>#{product.name} - #{variant.option_values.first.name}</g:title>").onceend