spree_core 4.4.0 → 4.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a07abab7dbe8d8b60a019e561b5668c3f336a7eb6970336b6a94b47046837fc1
4
- data.tar.gz: 212b678f9f9df3a4de9de428bd9291fc87cd1f7020ed0c7f50b97c81fbd68a08
3
+ metadata.gz: c6f1530fed2a687bd1eb187fbc25fc58fcd257d498f9e9f641291f99991f0e46
4
+ data.tar.gz: fd670b73289d5515e3e27dd5f80451f3c866865ea278cfb8e8d9b43d3c650a46
5
5
  SHA512:
6
- metadata.gz: 81e442e30106ce5756519d41717004ebcff0e6219f0e6fcfb563b3133b5635e5bde772ea3939edffac037f55f2eda42ca8ee69da69feb6f44f79d96f60fc4392
7
- data.tar.gz: 02dd0236576e01b96c237d1989fee5a4ef669f4f4e39764b0a2ebbae26ad3847aca21915e0c6196a60088aa5f76bb817d6b478f9b04459d873f8508c00814b66
6
+ metadata.gz: d83b92fbf213054613dd642a968a6958c6a54dcdd4177c54385b3a82bf567de92cc5d0c21a18deda0768dfeafb2b955fcf508c1392ded7071e7c499c29afcb73
7
+ data.tar.gz: c4e3da90f798233259263b922a5ac32999d4e34c46a64b0731e316c5eada252b18bce0c53cc4651e977b3984aa343ef80570cdbf96378600f362d23d3bc2b320
@@ -92,7 +92,7 @@ module Spree
92
92
  end
93
93
 
94
94
  def get_desired_shipment_inventory_unit(state)
95
- desired_shipment.inventory_units.find_or_create_by(state: state) do |unit|
95
+ desired_shipment.inventory_units.find_or_create_by(state: state, variant: variant) do |unit|
96
96
  current_shipment_unit = current_shipment_units.first
97
97
  unit.variant_id = current_shipment_unit.variant_id
98
98
  unit.order_id = current_shipment_unit.order_id
@@ -1,6 +1,14 @@
1
1
  module Spree
2
2
  class Order < Spree::Base
3
3
  module StoreCredit
4
+ def add_store_credit_payments(amount = nil)
5
+ Spree::Dependencies.checkout_add_store_credit_service.constantize.call(order: self, amount: amount)
6
+ end
7
+
8
+ def remove_store_credit_payments
9
+ Spree::Dependencies.checkout_remove_store_credit_service.constantize.call(order: self)
10
+ end
11
+
4
12
  def covered_by_store_credit?
5
13
  return false unless user
6
14
 
@@ -0,0 +1,31 @@
1
+ module Spree
2
+ class OrderContents
3
+ attr_accessor :order, :currency
4
+
5
+ def initialize(order)
6
+ @order = order
7
+ end
8
+
9
+ def add(variant, quantity = 1, options = {})
10
+ Spree::Dependencies.cart_add_item_service.constantize.call(order: order,
11
+ variant: variant,
12
+ quantity: quantity,
13
+ options: options).value
14
+ end
15
+
16
+ def remove(variant, quantity = 1, options = {})
17
+ Spree::Dependencies.cart_remove_item_service.constantize.call(order: order,
18
+ variant: variant,
19
+ quantity: quantity,
20
+ options: options).value
21
+ end
22
+
23
+ def remove_line_item(line_item, options = {})
24
+ Spree::Cart::RemoveLineItem.call(order: @order, line_item: line_item, options: options).value
25
+ end
26
+
27
+ def update_cart(params)
28
+ Spree::Dependencies.cart_update_service.constantize.call(order: order, params: params).value
29
+ end
30
+ end
31
+ end
@@ -1,5 +1,5 @@
1
1
  module Spree
2
- VERSION = '4.4.0'.freeze
2
+ VERSION = '4.4.1'.freeze
3
3
 
4
4
  def self.version
5
5
  VERSION
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.4.0
4
+ version: 4.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Schofield
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-01-26 00:00:00.000000000 Z
12
+ date: 2024-04-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: actionpack
@@ -583,6 +583,7 @@ files:
583
583
  - app/models/spree/order/emails.rb
584
584
  - app/models/spree/order/payments.rb
585
585
  - app/models/spree/order/store_credit.rb
586
+ - app/models/spree/order_contents.rb
586
587
  - app/models/spree/order_inventory.rb
587
588
  - app/models/spree/order_merger.rb
588
589
  - app/models/spree/order_promotion.rb
@@ -977,9 +978,9 @@ licenses:
977
978
  - BSD-3-Clause
978
979
  metadata:
979
980
  bug_tracker_uri: https://github.com/spree/spree/issues
980
- changelog_uri: https://github.com/spree/spree/releases/tag/v4.4.0
981
+ changelog_uri: https://github.com/spree/spree/releases/tag/v4.4.1
981
982
  documentation_uri: https://dev-docs.spreecommerce.org/
982
- source_code_uri: https://github.com/spree/spree/tree/v4.4.0
983
+ source_code_uri: https://github.com/spree/spree/tree/v4.4.1
983
984
  post_install_message:
984
985
  rdoc_options: []
985
986
  require_paths:
@@ -995,7 +996,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
995
996
  - !ruby/object:Gem::Version
996
997
  version: 1.8.23
997
998
  requirements: []
998
- rubygems_version: 3.2.32
999
+ rubygems_version: 3.5.3
999
1000
  signing_key:
1000
1001
  specification_version: 4
1001
1002
  summary: The bare bones necessary for Spree