[*] FO : display initial price in the cart when a specific price is applied to a product

This commit is contained in:
vChabot
2011-09-15 12:37:44 +00:00
parent 14004d9f97
commit 875d5488e6
6 changed files with 45 additions and 12 deletions
+4
View File
@@ -55,6 +55,10 @@ class CartControllerCore extends FrontController
$result['customizedDatas'] = Product::getAllCustomizedDatas($this->context->cart->id, null, true);
$result['HOOK_SHOPPING_CART'] = Module::hookExec('shoppingCart', $result['summary']);
$result['HOOK_SHOPPING_CART_EXTRA'] = Module::hookExec('shoppingCartExtra', $result['summary']);
// Display reduced price (or not) without quantity discount
if (Tools::getIsset('getproductprice'))
foreach ($result['summary']['products'] as $key => $product)
$result['summary']['products'][$key]['price_without_quantity_discount'] = Product::getPriceStatic($product['id_product'], !Product::getTaxCalculationMethod(), $product['id_product_attribute']);
die(Tools::jsonEncode($result));
}
else
+6 -3
View File
@@ -261,9 +261,12 @@ class ParentOrderControllerCore extends FrontController
}
$this->context->smarty->assign('free_ship', $total_free_ship);
}
// for compatibility with 1.2 themes
foreach($summary['products'] AS $key => $product)
$summary['products'][$key]['quantity'] = $product['cart_quantity'];
foreach ($summary['products'] AS $key => $product)
{
$summary['products'][$key]['quantity'] = $product['cart_quantity'];// for compatibility with 1.2 themes
$std_product = new Product($summary['products'][$key]['id_product']);
$summary['products'][$key]['price_without_specific_price'] = $std_product->getPrice(!Product::getTaxCalculationMethod(), $summary['products'][$key]['id_product_attribute']);
}
$this->context->smarty->assign($summary);
$this->context->smarty->assign(array(