46 lines
1013 B
PHP
Executable File
46 lines
1013 B
PHP
Executable File
<?php
|
|
include(dirname(__FILE__).'/../../config/config.inc.php');
|
|
require_once(dirname(__FILE__).'../../../init.php');
|
|
|
|
global $cookie;
|
|
global $smarty;
|
|
|
|
$id_product = Tools::getValue('id_product', 0);
|
|
$idCombination = Tools::getValue('idCombination', 0);
|
|
|
|
if($id_product){
|
|
$product = new Product($id_product, false, $cookie->id_lang);
|
|
$quantity = Tools::getValue('quantity', 1);
|
|
|
|
$cart = new Cart((int)($cookie->id_cart));
|
|
$cart->id_lang = (int)($cookie->id_lang);
|
|
|
|
if($idCombination != 0){
|
|
$price = $product->getPrice(true, $idCombination, 2) * $quantity;
|
|
}else{
|
|
$price = $product->getPrice(true, NULL, 2) * $quantity;
|
|
}
|
|
|
|
$bestSaleCart = Module::hookExec('bestSaleCart');
|
|
|
|
$link = new Link();
|
|
|
|
$tpl = $smarty->createTemplate('ajax_cart.tpl');
|
|
|
|
$tpl->assign(array(
|
|
'product' => $product,
|
|
'link' => $link,
|
|
'img_dir' => '/themes/site/img/',
|
|
'quantity' => $quantity,
|
|
'bestSaleCart' => $bestSaleCart,
|
|
'price' => $price
|
|
));
|
|
|
|
echo $rendu = $tpl->fetch();
|
|
die;
|
|
|
|
}else{
|
|
return false;
|
|
}
|
|
|
|
?>
|