solidus_tec_estimator 1.0.0 → 1.0.2

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: e20f6f24520ff83d576c390de4cca09898690eb3bf43ddeec39621cb397c54bf
4
- data.tar.gz: 1adbd0fed447a36308d8904d7721e5a14dc395c13c391083f5f5945941b25f94
3
+ metadata.gz: ec04ac8776ab72173ed80d8e4c94ec6f7f96e09e67fb05f86588d680fe2cdaa3
4
+ data.tar.gz: 7f0019e36d4c414e1489b53c6489fb1e2d50fe25d0f6a8fefaba2e832fc0f340
5
5
  SHA512:
6
- metadata.gz: 10ee9a2204b71663480eb1eff72ab599c9af634f8f3beaa0bcf7d9bfe531e5828d661f66f9f1e3e0b41482b7ca1e5007cf5140299d24aad3b654939f72d7fa50
7
- data.tar.gz: 6755ea2795bbccdcbe1dc835ad2c2a988c30b5537587200952907762d672e1fd5ffeef722b3388e56eeedee67a24f7d884d3304a83585d8c8a093e6e23ee4b19
6
+ metadata.gz: f40c6c0d165ece193dc40263667b4fa08043bdcac88431af801aeb9b0584d2aef128f1d12e0d1c3c4b3b3e29e93b0e6378f43523964631e906fcc52f35319862
7
+ data.tar.gz: 30da2db3d0463e33ca81c86ddab5c1f7d1a40b063d6d47e4fa77d4ac3e5de31510c8113c591cc145cc2bd4c8e4f2cf2352ab0536f67c1668a4ca8ec620c4504e
@@ -14,7 +14,7 @@ module SolidusTecEstimator
14
14
  end
15
15
  end.compact
16
16
  rates += providers(package).map do |provider|
17
- provider_shipping_methods = provider.spree_shipping_methods.available_in_stock_location(package.stock_location)
17
+ provider_shipping_methods = provider.spree_shipping_methods.available_to_store(package.shipment.order.store).available_in_stock_location(package.stock_location)
18
18
  provider.class_name.constantize.new(package, provider_shipping_methods).shipping_rates
19
19
  end.flatten.compact
20
20
 
@@ -38,15 +38,16 @@ module SolidusTecEstimator
38
38
  shipping_method.provider_id = SolidusTecEstimator::Provider.find_by(class_name: self.class.to_s).id
39
39
  end
40
40
 
41
- if Time.now < Time.now.change({hour: 16}) && Time.now.on_weekday?
42
- min_delivery_time = (Time.now + 30.minutes)
43
- max_delivery_time = (Time.now + 2.hours)
44
- elsif Time.now > Time.now.change({hour: 16}) && Time.now.next_day.on_weekday?
45
- min_delivery_time = Time.now.next_day.change({hour: 8})
46
- max_delivery_time = Time.now.next_day.change({hour: 10})
41
+ time_now = Time.now.in_time_zone('America/Sao_Paulo')
42
+ if time_now < time_now.change({hour: 16}) && time_now.on_weekday?
43
+ min_delivery_time = (time_now + 30.minutes)
44
+ max_delivery_time = (time_now + 2.hours)
45
+ elsif time_now > time_now.change({hour: 16}) && time_now.next_day.on_weekday?
46
+ min_delivery_time = time_now.next_day.change({hour: 8})
47
+ max_delivery_time = time_now.next_day.change({hour: 10})
47
48
  else
48
- min_delivery_time = Time.now.next_weekday.change({hour: 8})
49
- max_delivery_time = Time.now.next_weekday.change({hour: 10})
49
+ min_delivery_time = time_now.next_weekday.change({hour: 8})
50
+ max_delivery_time = time_now.next_weekday.change({hour: 10})
50
51
  end
51
52
 
52
53
  Spree::ShippingRate.new(
@@ -1,3 +1,3 @@
1
1
  module SolidusTecEstimator
2
- VERSION = '1.0.0'
2
+ VERSION = '1.0.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solidus_tec_estimator
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - ulysses
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-08-13 00:00:00.000000000 Z
11
+ date: 2024-08-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: solidus_core