spree_core 4.3.2 → 4.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/spree/order/store_credit.rb +8 -0
- data/app/models/spree/order_contents.rb +31 -0
- data/lib/spree/core/version.rb +1 -1
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 96c8f3216e3e5d17e33022ff18a6b6a5eab74963aef31297a70c4c3f1ba4604e
|
4
|
+
data.tar.gz: 479e325b608c5d19bdd7acb6f69b0dac29f894850dcb63a14a289ca3b5e80a23
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 706ce33cc84d6423d6ed5a120a38dfe84c3aa1515b448fe8521ebb393104e43d541e94fe67dd5105c66b8a022920fa976af00cee7a0b5382ab49351f93da4644
|
7
|
+
data.tar.gz: 967829013d91f08dc944a3ecc1d176a95ccf988af3148e0aa142c38a3949a0b9cf21ad7a35464acdf1cb1b76b010d2e1f525298a5e4217ba00e399d633cdea3f
|
@@ -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
|
data/lib/spree/core/version.rb
CHANGED
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.3.
|
4
|
+
version: 4.3.3
|
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:
|
12
|
+
date: 2024-04-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: actionpack
|
@@ -555,6 +555,7 @@ files:
|
|
555
555
|
- app/models/spree/order/emails.rb
|
556
556
|
- app/models/spree/order/payments.rb
|
557
557
|
- app/models/spree/order/store_credit.rb
|
558
|
+
- app/models/spree/order_contents.rb
|
558
559
|
- app/models/spree/order_inventory.rb
|
559
560
|
- app/models/spree/order_merger.rb
|
560
561
|
- app/models/spree/order_promotion.rb
|
@@ -1195,9 +1196,9 @@ licenses:
|
|
1195
1196
|
- BSD-3-Clause
|
1196
1197
|
metadata:
|
1197
1198
|
bug_tracker_uri: https://github.com/spree/spree/issues
|
1198
|
-
changelog_uri: https://github.com/spree/spree/releases/tag/v4.3.
|
1199
|
+
changelog_uri: https://github.com/spree/spree/releases/tag/v4.3.3
|
1199
1200
|
documentation_uri: https://dev-docs.spreecommerce.org/
|
1200
|
-
source_code_uri: https://github.com/spree/spree/tree/v4.3.
|
1201
|
+
source_code_uri: https://github.com/spree/spree/tree/v4.3.3
|
1201
1202
|
post_install_message:
|
1202
1203
|
rdoc_options: []
|
1203
1204
|
require_paths:
|
@@ -1213,7 +1214,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
1213
1214
|
- !ruby/object:Gem::Version
|
1214
1215
|
version: 1.8.23
|
1215
1216
|
requirements: []
|
1216
|
-
rubygems_version: 3.
|
1217
|
+
rubygems_version: 3.5.3
|
1217
1218
|
signing_key:
|
1218
1219
|
specification_version: 4
|
1219
1220
|
summary: The bare bones necessary for Spree
|