14 if (!defined(
'IN_PEEL')) {
17 call_module_hook(
'cart_product_added', array(
'quantity' =>
vn($added_quantity),
'user_id' =>
vn(
$_SESSION[
'session_utilisateur'][
'id_utilisateur'])));
26 if (!empty($params[
'quantite'])) {
27 if (!empty($_POST[
'save_cart_id'])) {
31 WHERE id=".intval($_POST[
'save_cart_id']));
33 if ($params[
'quantite']<
$result[
'quantite']) {
35 query(
"UPDATE peel_save_cart
36 SET quantite=quantite-".intval($params[
'quantite']) .
"
37 WHERE id=".intval($_POST[
'save_cart_id']) .
" AND id_utilisateur=" . intval($params[
'user_id']));
40 query(
"DELETE FROM peel_save_cart
41 WHERE id=" . intval($_POST[
'save_cart_id']) .
" AND id_utilisateur=" . intval($params[
'user_id']));
45 $_SESSION[
'session_show_caddie_popup'] =
true;
49 if (!function_exists(
'get_cart_popup_script')) {
55 function get_cart_popup_script()
62 if (!function_exists(
'get_cart_popup_div')) {
69 function get_cart_popup_div($product_added_id = null)
71 $tpl_content =
$GLOBALS[
'tplEngine']->createTemplate(
'modules/cart_popup_content.tpl');
72 $tpl_content->assign(
'STR_MODULE_CART_POPUP_PRODUCT_ADDED',
$GLOBALS[
'STR_MODULE_CART_POPUP_PRODUCT_ADDED']);
73 $tpl_content->assign(
'STR_CADDIE',
$GLOBALS[
'STR_CADDIE']);
74 $tpl_content->assign(
'STR_QUANTITY',
$GLOBALS[
'STR_QUANTITY']);
75 $tpl_content->assign(
'STR_BEFORE_TWO_POINTS',
$GLOBALS[
'STR_BEFORE_TWO_POINTS']);
76 $tpl_content->assign(
'STR_AMOUNT',
$GLOBALS[
'STR_AMOUNT']);
77 $tpl_content->assign(
'STR_TTC',
$GLOBALS[
'STR_TTC']);
78 $tpl_content->assign(
'STR_HT',
$GLOBALS[
'STR_HT']);
79 $tpl_content->assign(
'STR_SHOPPING',
$GLOBALS[
'STR_SHOPPING']);
80 $tpl_content->assign(
'count_products',
$_SESSION[
'session_caddie']->count_products());
82 $tpl_content->assign(
'total',
fprix(
$_SESSION[
'session_caddie']->total,
true));
83 $tpl_content->assign(
'total_ht',
fprix(
$_SESSION[
'session_caddie']->total_ht,
true));
84 $tpl_content->assign(
'header_src',
$GLOBALS[
'repertoire_images'].
'/popup_cart_top1_'.
$_SESSION[
'session_langue'].
'.png');
86 $tpl =
$GLOBALS[
'tplEngine']->createTemplate(
'modules/cart_popup_div.tpl');
87 $tpl->assign(
'header_src',
$GLOBALS[
'repertoire_images'].
'/popup_cart_top1_'.$_SESSION[
'session_langue'].
'.png');
88 $tpl->assign(
'count_products', $_SESSION[
'session_caddie']->count_products());
89 $tpl->assign(
'width',
$GLOBALS[
'site_parameters'][
'popup_width']);
90 $tpl->assign(
'height',
$GLOBALS[
'site_parameters'][
'popup_height']);
91 $tpl->assign(
'html_var', $tpl_content->fetch());
92 $tpl->assign(
'STR_MODULE_CART_POPUP_PRODUCT_ADDED',
$GLOBALS[
'STR_MODULE_CART_POPUP_PRODUCT_ADDED']);
94 $tpl->assign(
'STR_BEFORE_TWO_POINTS',
$GLOBALS[
'STR_BEFORE_TWO_POINTS']);
100 if(!empty(
$GLOBALS[
'site_parameters'][
'display_link_after_product_added_in_cart_popup'][
$product_object->technical_code])){
103 $tpl->assign(
'link',
$GLOBALS[
'site_parameters'][
'display_link_after_product_added_in_cart_popup'][
$product_object->technical_code]);
104 $tpl->assign(
'label',
$GLOBALS[
'site_parameters'][
'label_link_after_product_added_in_cart_popup'][
$product_object->technical_code]);
107 if(!empty(
$GLOBALS[
'site_parameters'][
'bootbox_dialog_buttons_main_label'][
$product_object->technical_code])) {
118 $tpl->assign(
'main_href', get_url(
'caddie_affichage'));
122 if(!empty(
$GLOBALS[
'site_parameters'][
'bootbox_dialog_buttons_success_link'][
$product_object->technical_code])) {
128 if(!empty(
$GLOBALS[
'site_parameters'][
'bootbox_dialog_buttons_success_label'][
$product_object->technical_code])) {
130 $tpl->assign(
'success_label',
$GLOBALS[
'site_parameters'][
'bootbox_dialog_buttons_success_label'][
$product_object->technical_code]);
132 $tpl->assign(
'success_label',
$GLOBALS[
'STR_SHOPPING']);
if(!empty($_GET['id'])) if(isset($_POST['form_name'], $_POST['form_subject'], $_POST['form_text'], $_POST['form_lang'])&&empty($_GET['id'])) if(empty($_GET['id'])) $tpl
if(!defined('IN_PEEL')) $GLOBALS['page_types_array']
if(empty($_GET['id'])) if(!empty($GLOBALS['site_parameters']['allow_multiple_product_url_with_category'])) $product_object
if(!defined('IN_PEEL')) display_prices_with_taxes_active()
display_prices_with_taxes_active()
query($query, $die_if_error=false, $database_object=null, $silent_if_error=false, $security_sql_filter=true)
The query() function is meant to be called anywhere you want to make a query.
fetch_assoc($query_result)
fetch_assoc()
call_module_hook($hook, $params, $mode= 'boolean')
Appelle la fonction correspondant au $hook pour chaque module installé La fonction doit s'appeler : [...
fprix($price, $display_currency=false, $currency_code_or_default=null, $convertion_needed_into_currency=true, $currency_rate=null, $display_iso_currency_code=false, $format=true, $force_format_separator=null, $add_rdfa_properties=false, $round_even_if_no_format=false)
fprix formatte le prix donné en le convertissant si nécessaire au préalable et en ajoutant éventuelle...
if(defined('IN_PEEL_ADMIN')||IN_INSTALLATION) $_SESSION['session_langue']