changed to propper way of checking to pass unit test
This commit is contained in:
parent
58ca0b2627
commit
44cb03e30c
|
|
@ -446,12 +446,13 @@ class Cart
|
|||
return false;
|
||||
}
|
||||
|
||||
$shippingMethods = Shipping::getShippingMethods();
|
||||
$shippingMethods = Shipping::collectRates()['shippingMethods'];
|
||||
$isMethodAvailable = false;
|
||||
foreach ($shippingMethods as $shippingMethod) {
|
||||
if ($shippingMethod['method'] == $shippingMethodCode) {
|
||||
foreach ($shippingMethod['rates'] as $rate)
|
||||
if ($rate->method == $shippingMethodCode) {
|
||||
$isMethodAvailable = true;
|
||||
break;
|
||||
break 2;
|
||||
}
|
||||
}
|
||||
if (!$isMethodAvailable) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue