// BugFix with id_address_delivery

This commit is contained in:
mDeflotte
2011-11-23 19:27:57 +00:00
parent 035b85dfe5
commit b7dfb5ed46
2 changed files with 11 additions and 7 deletions
+10 -6
View File
@@ -1094,6 +1094,9 @@ class CartCore extends ObjectModel
$warehouse_carrier_list = array();
foreach ($product_list as &$product)
{
if ((int)$product['id_address_delivery'] == 0)
$product['id_address_delivery'] = (int)$this->id_address_delivery;
if (!isset($warehouse_count_by_address[$product['id_address_delivery']]))
$warehouse_count_by_address[$product['id_address_delivery']] = array();
@@ -1137,7 +1140,7 @@ class CartCore extends ObjectModel
$warehouse_count_by_address[$product['id_address_delivery']][$warehouse['id_warehouse']]++;
}
}
// If product from the cart are not in any warehouse, return false
//foreach ($warehouse_count_by_address as $warehouse_count)
// if (empty($warehouse_count))
@@ -1500,12 +1503,13 @@ class CartCore extends ObjectModel
public function getAddressCollection()
{
$collection = array();
foreach (Db::getInstance()->executeS('SELECT DISTINCT `id_address_delivery`
$result = Db::getInstance()->executeS('SELECT DISTINCT `id_address_delivery`
FROM `'._DB_PREFIX_.'cart_product`
WHERE id_cart = '.(int)$this->id)
as $row
)
$collection[$row['id_address_delivery']] = new Address($row['id_address_delivery']);
WHERE id_cart = '.(int)$this->id);
$result[] = array('id_address_delivery' => (int)$this->id_address_delivery);
foreach ($result as $row)
if ((int)$row['id_address_delivery'] != 0)
$collection[(int)$row['id_address_delivery']] = new Address((int)$row['id_address_delivery']);
return $collection;
}
+1 -1
View File
@@ -119,7 +119,7 @@
<div class="delivery_options">
{foreach $option_list as $key => $option}
<div class="delivery_option {if ($option@index % 2)}alternate_{/if}item">
<input class="delivery_option_radio" type="radio" name="delivery_option[{$id_address}]" {if $opc}onclick="updateCarrierSelectionAndGift();"{/if} id="delivery_option_{$id_address}_{$option@index}" value="{$key}" {if $delivery_option[$id_address] == $key}selected="selected"{/if} />
<input class="delivery_option_radio" type="radio" name="delivery_option[{$id_address}]" {if $opc}onclick="updateCarrierSelectionAndGift();"{/if} id="delivery_option_{$id_address}_{$option@index}" value="{$key}" {if $delivery_option[$id_address] == $key}checked="checked"{/if} />
<label for="delivery_option_{$id_address}_{$option@index}">
<table class="resume">
<tr>