File tree 2 files changed +12
-2
lines changed
2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 1
1
Spree ::LineItem . class_eval do
2
2
def tax_cloud_cache_key
3
- key = "Spree::LineItem #{ id } : #{ quantity } x<#{ variant . cache_key } >@#{ price } #{ currency } "
3
+ key = "Spree::LineItem #{ id } : #{ quantity } x<#{ variant . cache_key } >@#{ price } #{ currency } promo_total< #{ promo_total } > "
4
4
if order . ship_address
5
5
key << "shipped_to<#{ order . ship_address . try ( :cache_key ) } >"
6
6
elsif order . bill_address
Original file line number Diff line number Diff line change @@ -42,13 +42,23 @@ def self.address_from_spree_address(address)
42
42
end
43
43
44
44
def self . cart_item_from_item ( item , index )
45
+
46
+ puts '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
47
+ puts '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
48
+ puts "promo_tota: #{ item . promo_total } "
49
+ puts "quantity: #{ item . quantity } "
50
+ puts "price: #{ item . price } "
51
+ puts '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
52
+ puts '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
53
+
54
+
45
55
case item
46
56
when Spree ::LineItem
47
57
::TaxCloud ::CartItem . new (
48
58
index : index ,
49
59
item_id : item . try ( :variant ) . try ( :sku ) . present? ? item . try ( :variant ) . try ( :sku ) : "LineItem #{ item . id } " ,
50
60
tic : ( item . product . tax_cloud_tic || Spree ::Config . taxcloud_default_product_tic ) ,
51
- price : item . price ,
61
+ price : item . quantity == 0 ? item . price : ( item . promo_total / item . quantity ) + item . price ,
52
62
quantity : item . quantity
53
63
)
54
64
when Spree ::Shipment
You can’t perform that action at this time.
0 commit comments