File tree Expand file tree Collapse file tree 1 file changed +17
-10
lines changed
app/code/Magento/Quote/Model/Quote/Address/Total Expand file tree Collapse file tree 1 file changed +17
-10
lines changed Original file line number Diff line number Diff line change 3
3
* Copyright © Magento, Inc. All rights reserved.
4
4
* See COPYING.txt for license details.
5
5
*/
6
+
7
+ declare (strict_types=1 );
8
+
6
9
namespace Magento \Quote \Model \Quote \Address \Total ;
7
10
8
11
use Magento \Framework \Pricing \PriceCurrencyInterface ;
@@ -112,17 +115,21 @@ public function collect(
112
115
*/
113
116
public function fetch (\Magento \Quote \Model \Quote $ quote , \Magento \Quote \Model \Quote \Address \Total $ total )
114
117
{
115
- $ amount = $ total ->getShippingAmount ();
116
- $ shippingDescription = $ total ->getShippingDescription ();
117
- $ title = ($ shippingDescription )
118
- ? __ ('Shipping & Handling (%1) ' , $ shippingDescription )
119
- : __ ('Shipping & Handling ' );
118
+ if (!$ quote ->getIsVirtual ()) {
119
+ $ amount = $ total ->getShippingAmount ();
120
+ $ shippingDescription = $ total ->getShippingDescription ();
121
+ $ title = ($ shippingDescription )
122
+ ? __ ('Shipping & Handling (%1) ' , $ shippingDescription )
123
+ : __ ('Shipping & Handling ' );
120
124
121
- return [
122
- 'code ' => $ this ->getCode (),
123
- 'title ' => $ title ,
124
- 'value ' => $ amount
125
- ];
125
+ return [
126
+ 'code ' => $ this ->getCode (),
127
+ 'title ' => $ title ,
128
+ 'value ' => $ amount
129
+ ];
130
+ } else {
131
+ return [];
132
+ }
126
133
}
127
134
128
135
/**
You can’t perform that action at this time.
0 commit comments