[-] MO : Dateofdelivery Fix bug #PNM-1773 when a product has an available date
This commit is contained in:
1 parent
2b0224efe1
commit
a0373eed7a
1 file changed
+2
-4
@@ -128,13 +128,12 @@ class DateOfDelivery extends Module
|
|||||||
$package = $package_list[$id_address][$id_package];
|
$package = $package_list[$id_address][$id_package];
|
||||||
$oos = false; // For out of stock management
|
$oos = false; // For out of stock management
|
||||||
foreach ($package['product_list'] as $product)
|
foreach ($package['product_list'] as $product)
|
||||||
if (StockAvailable::getQuantityAvailableByProduct($product['id_product'], $product['id_product_attribute']) <= 0)
|
if (StockAvailable::getQuantityAvailableByProduct($product['id_product'], ($product['id_product_attribute'] ? (int)$product['id_product_attribute'] : null), (int)$this->context->shop->id) <= 0)
|
||||||
{
|
{
|
||||||
$oos = true;
|
$oos = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
$available_date = Product::getAvailableDate($product['id_product'], ($product['id_product_attribute'] ? (int)$product['id_product_attribute'] : null), (int)$this->context->shop->id);
|
||||||
$available_date = Product::getAvailableDate($product['id_product'], $product['id_product_attribute']);
|
|
||||||
$date_range = $this->_getDatesOfDelivery($id_carrier, $oos, $available_date);
|
$date_range = $this->_getDatesOfDelivery($id_carrier, $oos, $available_date);
|
||||||
if (is_null($date_from) || $date_from < $date_range[0])
|
if (is_null($date_from) || $date_from < $date_range[0])
|
||||||
{
|
{
|
||||||
@@ -150,7 +149,6 @@ class DateOfDelivery extends Module
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->smarty->assign(array(
|
$this->smarty->assign(array(
|
||||||
'nbPackages' => $params['cart']->getNbOfPackages(),
|
'nbPackages' => $params['cart']->getNbOfPackages(),
|
||||||
'datesDelivery' => $datesDelivery,
|
'datesDelivery' => $datesDelivery,
|
||||||
|
|||||||
Reference in new issue
Block a user