[-] FO : fixed a problem with quantity of customized products #PSCFV-5630

[-] FO : removed cart rules already in the cart from available cart rules in the cart summary
This commit is contained in:
DamienMetzger committed 2012-11-23 10:39:04 +01:00
1 parent fc7d62eddf
commit 0468bdbc03
2 files changed
+13 -5

No files matched your search

+12 -4
View File
@@ -300,7 +300,8 @@ class ParentOrderControllerCore extends FrontController
if ($cart_product_context->shop->id != $product['id_shop']) if ($cart_product_context->shop->id != $product['id_shop'])
$cart_product_context->shop = new Shop((int)$product['id_shop']); $cart_product_context->shop = new Shop((int)$product['id_shop']);
$product['price_without_specific_price'] = Product::getPriceStatic($product['id_product'], $product['price_without_specific_price'] = Product::getPriceStatic(
$product['id_product'],
!Product::getTaxCalculationMethod(), !Product::getTaxCalculationMethod(),
$product['id_product_attribute'], $product['id_product_attribute'],
2, 2,
@@ -323,8 +324,15 @@ class ParentOrderControllerCore extends FrontController
$product['is_discounted'] = $product['price_without_specific_price'] != $product['price_wt']; $product['is_discounted'] = $product['price_without_specific_price'] != $product['price_wt'];
} }
$show_option_allow_separate_package = !$this->context->cart->isAllProductsInStock(true) // Get available cart rules and unset the cart rules already in the cart
&& Configuration::get('PS_SHIP_WHEN_AVAILABLE'); $available_cart_rules = CartRule::getCustomerCartRules($this->context->language->id, (isset($this->context->customer->id) ? $this->context->customer->id : 0), true, true, true, $this->context->cart);
$cart_cart_rules = $this->context->cart->getCartRules();
foreach ($available_cart_rules as $key => $available_cart_rule)
foreach ($cart_cart_rules as $cart_cart_rule)
if ($available_cart_rule['id_cart_rule'] == $cart_cart_rule['id_cart_rule'])
unset($available_cart_rules[$key]);
$show_option_allow_separate_package = (!$this->context->cart->isAllProductsInStock(true) && Configuration::get('PS_SHIP_WHEN_AVAILABLE'));
$this->context->smarty->assign($summary); $this->context->smarty->assign($summary);
$this->context->smarty->assign(array( $this->context->smarty->assign(array(
@@ -339,7 +347,7 @@ class ParentOrderControllerCore extends FrontController
'CUSTOMIZE_FILE' => Product::CUSTOMIZE_FILE, 'CUSTOMIZE_FILE' => Product::CUSTOMIZE_FILE,
'CUSTOMIZE_TEXTFIELD' => Product::CUSTOMIZE_TEXTFIELD, 'CUSTOMIZE_TEXTFIELD' => Product::CUSTOMIZE_TEXTFIELD,
'lastProductAdded' => $this->context->cart->getLastProduct(), 'lastProductAdded' => $this->context->cart->getLastProduct(),
'displayVouchers' => CartRule::getCustomerCartRules($this->context->language->id, (isset($this->context->customer->id) ? $this->context->customer->id : 0), true, true, true, $this->context->cart), 'displayVouchers' => $available_cart_rules,
'currencySign' => $this->context->currency->sign, 'currencySign' => $this->context->currency->sign,
'currencyRate' => $this->context->currency->conversion_rate, 'currencyRate' => $this->context->currency->conversion_rate,
'currencyFormat' => $this->context->currency->format, 'currencyFormat' => $this->context->currency->format,
+1 -1
View File
@@ -272,7 +272,7 @@
</a> </a>
{/if} {/if}
</div> </div>
<input type="hidden" value="{$customization.quantity}" name="quantity_{$product.id_product}_{$product.id_product_attribute}_{$id_customization}_hidden"/> <input type="hidden" value="{$customization.quantity}" name="quantity_{$product.id_product}_{$product.id_product_attribute}_{$id_customization}_{$product.id_address_delivery|intval}_hidden"/>
<input size="2" type="text" value="{$customization.quantity}" class="cart_quantity_input" name="quantity_{$product.id_product}_{$product.id_product_attribute}_{$id_customization}_{$product.id_address_delivery|intval}"/> <input size="2" type="text" value="{$customization.quantity}" class="cart_quantity_input" name="quantity_{$product.id_product}_{$product.id_product_attribute}_{$id_customization}_{$product.id_address_delivery|intval}"/>
{/if} {/if}
</td> </td>