File tree Expand file tree Collapse file tree 2 files changed +7
-9
lines changed
OfflineShipping/Model/Carrier
Tax/Model/Sales/Total/Quote Expand file tree Collapse file tree 2 files changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -136,11 +136,10 @@ public function collectRates(RateRequest $request)
136
136
protected function _updateFreeMethodQuote ($ request )
137
137
{
138
138
$ freeShipping = false ;
139
- $ items = $ request ->getAllItems ();
140
- $ c = count ($ items );
141
- for ($ i = 0 ; $ i < $ c ; $ i ++) {
142
- if ($ items [$ i ]->getProduct () instanceof \Magento \Catalog \Model \Product) {
143
- if ($ items [$ i ]->getFreeShipping ()) {
139
+ $ items = $ request ->getAllItems () ?: [];
140
+ foreach ($ items as $ item ) {
141
+ if ($ item ->getProduct () instanceof \Magento \Catalog \Model \Product) {
142
+ if ($ item ->getFreeShipping ()) {
144
143
$ freeShipping = true ;
145
144
} else {
146
145
return ;
Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ public function collect(
38
38
return $ this ;
39
39
}
40
40
41
+ $ shippingAddress = $ shippingAssignment ->getShipping ()->getAddress ();
41
42
$ quoteDetails = $ this ->prepareQuoteDetails ($ shippingAssignment , [$ shippingDataObject ]);
42
43
$ taxDetails = $ this ->taxCalculationService
43
44
->calculateTax ($ quoteDetails , $ storeId );
@@ -48,10 +49,8 @@ public function collect(
48
49
->calculateTax ($ baseQuoteDetails , $ storeId );
49
50
$ baseTaxDetailsItems = $ baseTaxDetails ->getItems ()[self ::ITEM_CODE_SHIPPING ];
50
51
51
- $ quote ->getShippingAddress ()
52
- ->setShippingAmount ($ taxDetailsItems ->getRowTotal ());
53
- $ quote ->getShippingAddress ()
54
- ->setBaseShippingAmount ($ baseTaxDetailsItems ->getRowTotal ());
52
+ $ shippingAddress ->setShippingAmount ($ taxDetailsItems ->getRowTotal ());
53
+ $ shippingAddress ->setBaseShippingAmount ($ baseTaxDetailsItems ->getRowTotal ());
55
54
56
55
$ this ->processShippingTaxInfo (
57
56
$ shippingAssignment ,
You can’t perform that action at this time.
0 commit comments