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
Fix JSON-LD array formatting for product offers to pass Schema.org va… (#13018)
Umesh Ravani9101ee7fd212
diff --git a/storefront/app/views/themes/default/spree/products/_json_ld.html.erb b/storefront/app/views/themes/default/spree/products/_json_ld.html.erbindex c4d1d93fce..630cb70756 100644--- a/storefront/app/views/themes/default/spree/products/_json_ld.html.erb+++ b/storefront/app/views/themes/default/spree/products/_json_ld.html.erb@@ -24,11 +24,13 @@"name": <%= product.brand_name.to_json.html_safe %>},<% end %>- "offers": [+"offers": [<% if product.has_variants? %>- <%= render partial: "spree/products/json_ld_variant", collection: product.variants, as: :variant, locals: { product: product }, cached: spree_storefront_base_cache_scope %>+ <%= raw(product.variants.map do |variant|+ render partial: "spree/products/json_ld_variant", locals: { product: product, variant: variant }+ end.join(",\n")) %><% else %>- <%= render "spree/products/json_ld_variant", product: product, variant: first_or_default_variant %>+ <%= render "spree/products/json_ld_variant", product: product, variant: first_or_default_variant %><% end %>]}