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
Merge pull request #12741 from moonlight-rays/fix/remaining-incorrect-namespacing-in-spree-extension-creation-example
moonlight-rays01dacac0796e
diff --git a/docs/developer/contributing/creating-an-extension.mdx b/docs/developer/contributing/creating-an-extension.mdxindex 6855d43d1c..00f3a28a35 100644--- a/docs/developer/contributing/creating-an-extension.mdx+++ b/docs/developer/contributing/creating-an-extension.mdx@@ -93,7 +93,7 @@ module SpreeSimpleSalesmodule Spreemodule HomeControllerDecoratordef sale- @products = Spree::Product.joins(:variants_including_master).where('spree_variants.sale_price is not null').distinct+ @products = ::Spree::Product.joins(:variants_including_master).where('spree_variants.sale_price is not null').distinctendendend@@ -156,13 +156,13 @@ module SpreeSimpleSalesmodule VariantDecoratordef price_in(currency)return super unless sale_price.present?- Spree::Price.new(variant_id: self.id, amount: self.sale_price, currency: currency)+ ::Spree::Price.new(variant_id: self.id, amount: self.sale_price, currency: currency)endendendend-Spree::Variant.prepend SpreeSimpleSalesSpree::VariantDecorator+Spree::Variant.prepend SpreeSimpleSales::Spree::VariantDecorator```If there is a `sale_price` present on the product's master variant, we return that price. Otherwise, we call the original implementation of `price_in` using `return super`.