// BugFix : Problem with delivery_option calculation
// @TODO : All the undefined index are now fixed but there is not all the available delivery option
This commit is contained in:
+6
-5
@@ -1621,9 +1621,10 @@ class CartCore extends ObjectModel
|
|||||||
{
|
{
|
||||||
$delivery_option_list[$id_address] = array();
|
$delivery_option_list[$id_address] = array();
|
||||||
$carriers_price[$id_address] = array();
|
$carriers_price[$id_address] = array();
|
||||||
$common_carriers = array();
|
$common_carriers = null;
|
||||||
$best_price_carriers = array();
|
$best_price_carriers = array();
|
||||||
$best_grade_carriers = array();
|
$best_grade_carriers = array();
|
||||||
|
$carriers_instance = array();
|
||||||
|
|
||||||
foreach ($packages as $id_package => $package)
|
foreach ($packages as $id_package => $package)
|
||||||
{
|
{
|
||||||
@@ -1632,12 +1633,11 @@ class CartCore extends ObjectModel
|
|||||||
return array();
|
return array();
|
||||||
|
|
||||||
$carriers_price[$id_address][$id_package] = array();
|
$carriers_price[$id_address][$id_package] = array();
|
||||||
$carriers_instance = array();
|
|
||||||
|
|
||||||
if (empty($common_carriers))
|
if (is_null($common_carriers))
|
||||||
$common_carriers = $package['carrier_list'];
|
$common_carriers = $package['carrier_list'];
|
||||||
else
|
else
|
||||||
array_intersect($common_carriers, $package['carrier_list']);
|
$common_carriers = array_intersect($common_carriers, $package['carrier_list']);
|
||||||
|
|
||||||
$best_price = null;
|
$best_price = null;
|
||||||
$best_price_carrier = null;
|
$best_price_carrier = null;
|
||||||
@@ -1822,6 +1822,7 @@ class CartCore extends ObjectModel
|
|||||||
$name = $carrier['instance']->name;
|
$name = $carrier['instance']->name;
|
||||||
$img = $carrier['logo'];
|
$img = $carrier['logo'];
|
||||||
$delay = $carrier['instance']->delay;
|
$delay = $carrier['instance']->delay;
|
||||||
|
$delay = isset($delay[Context::getContext()->language->id]) ? $delay[Context::getContext()->language->id] : $delay[(int)Configuration::get('PS_LANG_DEFAULT')];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -1835,7 +1836,7 @@ class CartCore extends ObjectModel
|
|||||||
$carriers[] = array(
|
$carriers[] = array(
|
||||||
'name' => $name,
|
'name' => $name,
|
||||||
'img' => $img,
|
'img' => $img,
|
||||||
'delay' => $delay[Context::getContext()->language->id],
|
'delay' => $delay,
|
||||||
'price' => $price,
|
'price' => $price,
|
||||||
'price_tax_exc' => $price_tax_exc,
|
'price_tax_exc' => $price_tax_exc,
|
||||||
'id_carrier' => self::intifier($key), // Need to translate to an integer for retrocompatibility reason, in 1.4 template we used intval
|
'id_carrier' => self::intifier($key), // Need to translate to an integer for retrocompatibility reason, in 1.4 template we used intval
|
||||||
|
|||||||
@@ -167,7 +167,7 @@ class AdminProductsControllerCore extends AdminController
|
|||||||
$_POST['height'] = empty($_POST['height']) ? '0' : str_replace(',', '.', $_POST['height']);
|
$_POST['height'] = empty($_POST['height']) ? '0' : str_replace(',', '.', $_POST['height']);
|
||||||
$_POST['depth'] = empty($_POST['depth']) ? '0' : str_replace(',', '.', $_POST['depth']);
|
$_POST['depth'] = empty($_POST['depth']) ? '0' : str_replace(',', '.', $_POST['depth']);
|
||||||
$_POST['weight'] = empty($_POST['weight']) ? '0' : str_replace(',', '.', $_POST['weight']);
|
$_POST['weight'] = empty($_POST['weight']) ? '0' : str_replace(',', '.', $_POST['weight']);
|
||||||
if ($_POST['unit_price'] != null)
|
if (Tools::getIsset('unit_price') != null)
|
||||||
$object->unit_price = str_replace(',', '.', $_POST['unit_price']);
|
$object->unit_price = str_replace(',', '.', $_POST['unit_price']);
|
||||||
if (array_key_exists('ecotax', $_POST) && $_POST['ecotax'] != null)
|
if (array_key_exists('ecotax', $_POST) && $_POST['ecotax'] != null)
|
||||||
$object->ecotax = str_replace(',', '.', $_POST['ecotax']);
|
$object->ecotax = str_replace(',', '.', $_POST['ecotax']);
|
||||||
|
|||||||
@@ -127,7 +127,6 @@
|
|||||||
{/if}
|
{/if}
|
||||||
{/foreach}
|
{/foreach}
|
||||||
{else}
|
{else}
|
||||||
{$carrier.instance->name}
|
|
||||||
{/if}
|
{/if}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
|||||||
Reference in New Issue
Block a user