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
Fixed N+1s on Storefront cart
Damian Legawiecd42086f1f285
diff --git a/storefront/app/controllers/concerns/spree/cart_methods.rb b/storefront/app/controllers/concerns/spree/cart_methods.rbindex 382b49e71e..c026cb3140 100644--- a/storefront/app/controllers/concerns/spree/cart_methods.rb+++ b/storefront/app/controllers/concerns/spree/cart_methods.rb@@ -39,12 +39,14 @@ module Spree{variant: [:images,+ :prices,+ { stock_items: :stock_location },{ option_values: [:option_type] },{product: [- :variants,:variant_images,- { master: :images }+ { master: :images },+ { variants: :images }]}]diff --git a/storefront/app/views/themes/default/spree/shared/_line_item_options.html.erb b/storefront/app/views/themes/default/spree/shared/_line_item_options.html.erbindex d0abc68725..52ef8d2359 100644--- a/storefront/app/views/themes/default/spree/shared/_line_item_options.html.erb+++ b/storefront/app/views/themes/default/spree/shared/_line_item_options.html.erb@@ -1,4 +1,4 @@-<% options = line_item.variant.option_values.includes(:option_type) %>+<% options = line_item.variant.option_values %><% options.select { |ov| ov.option_type.color? }.each do |option| %><div>