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)
136136 protected function _updateFreeMethodQuote ($ request )
137137 {
138138 $ 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 ()) {
144143 $ freeShipping = true ;
145144 } else {
146145 return ;
Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ public function collect(
3838 return $ this ;
3939 }
4040
41+ $ shippingAddress = $ shippingAssignment ->getShipping ()->getAddress ();
4142 $ quoteDetails = $ this ->prepareQuoteDetails ($ shippingAssignment , [$ shippingDataObject ]);
4243 $ taxDetails = $ this ->taxCalculationService
4344 ->calculateTax ($ quoteDetails , $ storeId );
@@ -48,10 +49,8 @@ public function collect(
4849 ->calculateTax ($ baseQuoteDetails , $ storeId );
4950 $ baseTaxDetailsItems = $ baseTaxDetails ->getItems ()[self ::ITEM_CODE_SHIPPING ];
5051
51- $ quote ->getShippingAddress ()
52- ->setShippingAmount ($ taxDetailsItems ->getRowTotal ());
53- $ quote ->getShippingAddress ()
54- ->setBaseShippingAmount ($ baseTaxDetailsItems ->getRowTotal ());
52+ $ shippingAddress ->setShippingAmount ($ taxDetailsItems ->getRowTotal ());
53+ $ shippingAddress ->setBaseShippingAmount ($ baseTaxDetailsItems ->getRowTotal ());
5554
5655 $ this ->processShippingTaxInfo (
5756 $ shippingAssignment ,
You can’t perform that action at this time.
0 commit comments