Skip to content

Commit

Permalink
use_cart_in_order -> use_cart_in_orders
Browse files Browse the repository at this point in the history
  • Loading branch information
mreq committed May 12, 2022
1 parent 4df2838 commit b77bb98
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/models/boutique/order.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def total_price

def add_line_item!(product_variant, amount: 1)
Boutique::Order.transaction do
if ::Boutique.config.use_cart_in_order
if ::Boutique.config.use_cart_in_orders
if line_item = line_items.all.find { |li| li.boutique_product_variant_id == product_variant.id }
line_item.amount += amount
line_item.save!
Expand Down
4 changes: 2 additions & 2 deletions lib/boutique/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

module Boutique
class Config
attr_accessor :use_cart_in_order,
attr_accessor :use_cart_in_orders,
:orders_edit_sidebar_shipping_content,

def initialize
# set defaults here
@use_cart_in_order = true
@use_cart_in_orders = true
@orders_edit_sidebar_shipping_content = nil
end
end
Expand Down
2 changes: 1 addition & 1 deletion test/dummy/config/initializers/boutique.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

Boutique.configure do |config|
config.use_cart_in_order = false if Rails.env.development?
config.use_cart_in_orders = false if Rails.env.development?

config.orders_edit_sidebar_shipping_content = "<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>"
end

0 comments on commit b77bb98

Please sign in to comment.