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 orders sample
Łukasz Adamczyk3cf4463a518f
diff --git a/sample/db/samples/orders.rb b/sample/db/samples/orders.rbindex 07a3d2a2d7..c09bfb0557 100644--- a/sample/db/samples/orders.rb+++ b/sample/db/samples/orders.rb@@ -12,9 +12,9 @@ orders << store.orders.where(email: '[email protected]',currency: 'USD').first_or_create! do |order|- order.item_total = product_1.master.amount_in(order.currency)- order.adjustment_total = product_1.master.amount_in(order.currency)- order.total = product_1.master.amount_in(order.currency) * 2+ order.item_total = product_1.default_variant.amount_in(order.currency)+ order.adjustment_total = product_1.default_variant.amount_in(order.currency)+ order.total = product_1.default_variant.amount_in(order.currency) * 2endorders << store.orders.where(@@ -22,26 +22,26 @@ orders << store.orders.where(email: '[email protected]',currency: 'USD').first_or_create! do |order|- order.item_total = product_2.master.amount_in(order.currency)- order.adjustment_total = product_2.master.amount_in(order.currency)- order.total = product_2.master.amount_in(order.currency) * 2+ order.item_total = product_2.default_variant.amount_in(order.currency)+ order.adjustment_total = product_2.default_variant.amount_in(order.currency)+ order.total = product_2.default_variant.amount_in(order.currency) * 2order.shipping_address = Spree::Address.firstorder.billing_address = Spree::Address.lastendunless orders[0].line_items.any?orders[0].line_items.new(- variant: product_1.master,+ variant: product_1.default_variant,quantity: 1,- price: product_1.master.amount_in(orders[0].currency)+ price: product_1.default_variant.amount_in(orders[0].currency)).save!endunless orders[1].line_items.any?orders[1].line_items.new(- variant: product_2.master,+ variant: product_2.default_variant,quantity: 1,- price: product_1.master.amount_in(orders[1].currency)+ price: product_1.default_variant.amount_in(orders[1].currency)).save!end