File tree Expand file tree Collapse file tree 2 files changed +49
-1
lines changed Expand file tree Collapse file tree 2 files changed +49
-1
lines changed Original file line number Diff line number Diff line change @@ -921,7 +921,9 @@ public function needPriceConversion($store = null)
921
921
$ res = false ;
922
922
$ priceIncludesTax = $ this ->priceIncludesTax ($ store )
923
923
|| $ this ->getNeedUseShippingExcludeTax ()
924
- || $ this ->shippingPriceIncludesTax ($ store );
924
+ || $ this ->shippingPriceIncludesTax ($ store )
925
+ || $ this ->displayCartShippingInclTax ()
926
+ || $ this ->displayCartShippingBoth ();
925
927
if ($ priceIncludesTax ) {
926
928
switch ($ this ->getPriceDisplayType ($ store )) {
927
929
case self ::DISPLAY_TYPE_EXCLUDING_TAX :
Original file line number Diff line number Diff line change @@ -381,4 +381,50 @@ public function dataProviderScopeConfigMethods(): array
381
381
]
382
382
];
383
383
}
384
+
385
+ /**
386
+ * Tests check if necessary do product price conversion
387
+ *
388
+ * @return void
389
+ */
390
+ public function testNeedPriceConversion (): void
391
+ {
392
+ $ scopeConfigMock = $ this ->getMockForAbstractClass (ScopeConfigInterface::class);
393
+ $ scopeConfigMock
394
+ ->method ('getValue ' )
395
+ ->willReturnMap (
396
+ [
397
+ [
398
+ Config::XML_PATH_DISPLAY_CART_SHIPPING ,
399
+ ScopeInterface::SCOPE_STORE ,
400
+ null ,
401
+ true
402
+ ],
403
+ [
404
+ Config::XML_PATH_DISPLAY_CART_SHIPPING ,
405
+ ScopeInterface::SCOPE_STORE ,
406
+ null ,
407
+ false
408
+ ],
409
+ [
410
+ Config::CONFIG_XML_PATH_PRICE_DISPLAY_TYPE ,
411
+ ScopeInterface::SCOPE_STORE ,
412
+ null ,
413
+ true
414
+ ],
415
+ [
416
+ Config::XML_PATH_DISPLAY_CART_PRICE ,
417
+ ScopeInterface::SCOPE_STORE ,
418
+ null ,
419
+ false
420
+ ]
421
+ ]
422
+ );
423
+ /** @var Config */
424
+ $ model = new Config ($ scopeConfigMock );
425
+ $ model ->setPriceIncludesTax (false );
426
+ $ model ->setNeedUseShippingExcludeTax (false );
427
+ $ model ->setShippingPriceIncludeTax (false );
428
+ $ this ->assertEquals (true , $ model ->needPriceConversion ());
429
+ }
384
430
}
You can’t perform that action at this time.
0 commit comments