14 if (!defined(
'IN_PEEL')) {
18 if (!function_exists(
'get_caddie_content_html')) {
30 $listcadeaux_owner =
'';
37 if(!empty(
$_SESSION[
'session_caddie']->zoneId)) {
38 $q =
query(
'SELECT on_franco_amount, on_franco_nb_products, on_franco_reseller_amount
42 $on_franco_amount = floatval((
check_if_module_active(
'reseller') && is_reseller()) ? $zone_result[
'on_franco_reseller_amount'] : $zone_result[
'on_franco_amount']);
43 $on_franco_nb_products = $zone_result[
'on_franco_nb_products'];
45 if (!empty(
$GLOBALS[
'site_parameters'][
'mode_transport'])) {
46 if (round($seuil_total_used, 2) > 0 || !empty(
$GLOBALS[
'site_parameters'][
'nb_product']) || (!empty($on_franco_amount) && round($on_franco_amount, 2) > 0) || (!empty($on_franco_nb_products) && $on_franco_nb_products > 0)) {
47 $shipping_text .=
$GLOBALS[
'STR_SHIPPING_COST'] .
' (' .
$GLOBALS[
'STR_OFFERED'] .
' ';
49 if((!empty($on_franco_amount) && round($on_franco_amount, 2) > 0) || (!empty($on_franco_nb_products) && $on_franco_nb_products > 0)) {
50 $shipping_text .= !empty($on_franco_amount)?
$GLOBALS[
'STR_FROM'] .
' ' .
fprix($on_franco_amount,
true) .
' ' .
$GLOBALS[
'STR_TTC'] :
'';
51 if(!empty($on_franco_nb_products)) {
52 $shipping_text .= !empty($on_franco_amount)?
' ' .
$GLOBALS[
'STR_OR'] .
' '.
$GLOBALS[
'STR_FROM'] .
' ' . $on_franco_nb_products .
' ' .
$GLOBALS[
'STR_PRODUCTS_PURCHASED'] :
$GLOBALS[
'STR_FROM'] .
' ' . $on_franco_nb_products .
' ' .
$GLOBALS[
'STR_PRODUCTS_PURCHASED'];
54 }
elseif (round($seuil_total_used, 2) > 0 ) {
55 $shipping_text .=
$GLOBALS[
'STR_FROM'] .
' ' .
fprix($seuil_total_used,
true) .
' ' .
$GLOBALS[
'STR_TTC'];
57 if (!empty(
$GLOBALS[
'site_parameters'][
'nb_product']) && empty($on_franco_nb_products)) {
58 $shipping_text .= (round($seuil_total_used, 2) > 0 || (!empty($on_franco_amount) && round($on_franco_amount, 2) > 0) ?
' ' .
$GLOBALS[
'STR_OR_COORDINATION'] :
'') .
' ' .
$GLOBALS[
'STR_FROM'] .
' ' .
$GLOBALS[
'site_parameters'][
'nb_product'] .
' ' .
$GLOBALS[
'STR_PRODUCT_BUY'];
60 $shipping_text .=
')';
63 $tpl =
$GLOBALS[
'tplEngine']->createTemplate(
'caddie_content_html.tpl');
64 $tpl->assign(
'is_empty', (
$_SESSION[
'session_caddie']->count_products() == 0));
65 $tpl->assign(
'STR_EMPTY_CADDIE',
$GLOBALS[
'STR_EMPTY_CADDIE']);
67 $tpl->assign(
'enable_code_promo', empty(
$GLOBALS[
'site_parameters'][
'discount_codes_disabled']));
68 $tpl->assign(
'export_product_list_to_pdf',
$_SESSION[
'session_caddie']->count_products() > 0 &&
check_if_module_active(
'facture_advanced',
'administrer/genere_pdf.php') && !empty(
$GLOBALS[
'site_parameters'][
'export_product_list_to_pdf']));
69 $tpl->assign(
'genere_pdf_href',
$GLOBALS[
'wwwroot'] .
'/modules/facture_advanced/genere_pdf.php?export_products_list_in_pdf_file=caddie');
71 if(!(
$_SESSION[
'session_caddie']->count_products() == 0)){
72 $tpl->assign(
'STR_BEFORE_TWO_POINTS',
$GLOBALS[
'STR_BEFORE_TWO_POINTS']);
74 $tpl->assign(
'global_error',
vb(
$GLOBALS[
'site_parameters'][
'module_vacances_client_msg_' .
$_SESSION[
'session_langue']]));
76 $tpl->assign(
'erreur_caddie',
$_SESSION[
'session_caddie']->affiche_erreur_caddie());
78 $tpl->assign(
'products_summary_table', get_caddie_products_summary_table(
true,
true, $mode_transport, $shipping_text));
79 $tpl->assign(
'shipping_text', $shipping_text);
84 $tpl->assign(
'code_promo', array(
86 'value' =>
vb(
$_SESSION[
'session_caddie']->code_promo),
88 if (!empty(
$_SESSION[
'session_caddie']->code_promo)) {
89 $tpl->assign(
'code_promo_delete', array(
91 'src' => get_url(
'/icones/rupture.png'),
97 $tpl->assign(
'user_tva_intracom', array(
98 'txt' =>
$GLOBALS[
'STR_VAT_INTRACOM'],
99 'value' =>
vb(
$_SESSION[
'session_utilisateur'][
'intracom_for_billing']),
103 $tpl->assign(
'membre_href', get_url(
'membre'));
104 $tpl->assign(
'STR_LOGIN_FOR_REBATE',
$GLOBALS[
'STR_LOGIN_FOR_REBATE']);
105 $tpl->assign(
'STR_PLEASE_LOGIN',
$GLOBALS[
'STR_PLEASE_LOGIN']);
106 $tpl->assign(
'STR_REBATE_NOW',
$GLOBALS[
'STR_REBATE_NOW']);
109 $tpl->assign(
'devis_url', get_url(
'/modules/devis/devis.php'));
113 $tpl->assign(
'is_mode_transport', !empty($mode_transport));
114 if (!empty($mode_transport)) {
117 $tpl->assign(
'STR_SHIPPING_ZONE',
$GLOBALS[
'STR_SHIPPING_ZONE']);
119 $tpl->assign(
'STR_SHIP_ZONE_CHOOSE',
$GLOBALS[
'STR_SHIP_ZONE_CHOOSE']);
122 $sqlZone =
'SELECT id, nom_' .
$_SESSION[
'session_langue'] .
' AS nom
125 ORDER BY position, nom';
126 $resZone =
query($sqlZone);
127 $zone_options = array();
130 if (empty(
$_SESSION[
'session_caddie']->zoneId)) {
132 if (!empty(
$_SESSION[
'session_utilisateur'][
'zoneId']) &&
$_SESSION[
'session_utilisateur'][
'zoneId'] == $Zone[
'id']) {
139 $zone_options[] = array(
140 'value' => $Zone[
'id'],
141 'issel' => $selected,
142 'name' => $Zone[
'nom']
145 $tpl->assign(
'zone_options', $zone_options);
147 $tpl->assign(
'STR_SHIPPING_ZONE',
$GLOBALS[
'STR_SHIPPING_ZONE']);
148 $tpl->assign(
'STR_MODULE_FACTURES_ADVANCED_EXPORT_LIST_PDF',
$GLOBALS[
'STR_MODULE_FACTURES_ADVANCED_EXPORT_LIST_PDF']);
149 $tpl->assign(
'is_zone', (!empty(
$_SESSION[
'session_caddie']->zoneId) && !empty($mode_transport)));
150 if (!empty(
$_SESSION[
'session_caddie']->zoneId) && !empty($mode_transport)) {
151 if ($mode_transport == 1) {
153 $sqlType =
'SELECT DISTINCT(t.id), t.nom_' .
$_SESSION[
'session_langue'] .
'
156 WHERE t.etat = 1 AND ' .
get_filter_site_cond(
'tarifs',
'tf') .
' AND tf.zone = "' . intval(
$_SESSION[
'session_caddie']->zoneId) .
'" AND (poidsmin<="' . floatval(
$_SESSION[
'session_caddie']->total_poids) .
'" OR poidsmin=0) AND (poidsmax>="' . floatval(
$_SESSION[
'session_caddie']->total_poids) .
'" OR poidsmax=0) AND (totalmin<="' . floatval(
$_SESSION[
'session_caddie']->total_produit) .
'" OR totalmin=0) AND (totalmax>="' . floatval(
$_SESSION[
'session_caddie']->total_produit) .
'" OR totalmax=0)
157 ORDER BY t.position ASC, t.nom_' .
$_SESSION[
'session_langue'] .
' ASC';
158 $resType =
query($sqlType);
161 $tpl->assign(
'STR_SHIPPING_TYPE',
$GLOBALS[
'STR_SHIPPING_TYPE']);
162 $tpl->assign(
'STR_SHIP_TYPE_CHOOSE',
$GLOBALS[
'STR_SHIP_TYPE_CHOOSE']);
163 $tpl->assign(
'STR_ERREUR_TYPE',
$GLOBALS[
'STR_ERREUR_TYPE']);
164 if (!empty($resType) &&
num_rows($resType) > 0) {
165 $type_options = array();
167 if (!empty(
$GLOBALS[
'site_parameters'][
'zipcode_array_for_free_delivery']) && !empty(
$GLOBALS[
'site_parameters'][
'free_delivery_by_zipcode_array']) && in_array($Type[
'id'],
$GLOBALS[
'site_parameters'][
'free_delivery_by_zipcode_array']) && !in_array(
vb(
$_SESSION[
'session_utilisateur'][
'code_postal']),
$GLOBALS[
'site_parameters'][
'zipcode_array_for_free_delivery'])) {
170 $type_options[] = array(
171 'value' => intval($Type[
'id']),
172 'issel' => (
vb(
$_SESSION[
'session_caddie']->typeId) == $Type[
'id']),
173 'name' => $Type[
'nom_' .
$_SESSION[
'session_langue']]
176 $tpl->assign(
'shipping_type_options', $type_options);
182 $tpl->assign(
'preservation_href',
$GLOBALS[
'wwwroot'] .
'/modules/cart_preservation/cart_preservation.php?mode=save');
183 if (!empty(
$GLOBALS[
'site_parameters'][
'display_recommanded_product_on_cart_page'])) {
184 $tpl->assign(
'recommanded_product_on_cart_page', get_recommanded_product_on_cart_page());
186 $tpl->assign(
'STR_SAVE_CART',
$GLOBALS[
'STR_SAVE_CART']);
188 if (round(
$_SESSION[
'session_caddie']->avoir_user, 2) > round(
$_SESSION[
'session_caddie']->avoir, 2))
192 $treshold_to_use =
$GLOBALS[
'site_parameters'][
'minimal_amount_to_order_reve'];
194 $treshold_to_use =
$GLOBALS[
'site_parameters'][
'minimal_amount_to_order'];
196 if ($treshold_to_use >
$_SESSION[
'session_caddie']->total_produit) {
197 $tpl->assign(
'is_minimum_error',
true);
198 $tpl->assign(
'STR_MINIMUM_PURCHASE_OF',
$GLOBALS[
'STR_MINIMUM_PURCHASE_OF']);
199 $tpl->assign(
'minimum_prix',
fprix($treshold_to_use,
true));
200 $tpl->assign(
'STR_REQUIRED_VALIDATE_ORDER',
$GLOBALS[
'STR_REQUIRED_VALIDATE_ORDER']);
202 $tpl->assign(
'is_minimum_error',
false);
205 $tpl->assign(
'shopping_href', get_url(
'/achat/'));
208 $tpl->assign(
'STR_EMPTY_LIST',
$GLOBALS[
'STR_EMPTY_LIST']);
209 $tpl->assign(
'STR_EMPTY_CART',
$GLOBALS[
'STR_EMPTY_CART']);
216 if (!function_exists(
'get_order_step1')) {
228 if (empty(
$_SESSION[
'session_caddie']) ||
$_SESSION[
'session_caddie']->count_products() == 0) {
231 $tpl =
$GLOBALS[
'tplEngine']->createTemplate(
'order_step1.tpl');
232 $tpl->assign(
'internal_order_enable',
vn(
$GLOBALS[
'site_parameters'][
'internal_order_enable']));
235 $tpl->assign(
'societe1',
$frm[
'societe1']);
239 $tpl->assign(
'prenom1',
$frm[
'prenom1']);
241 $tpl->assign(
'email1',
$frm[
'email1']);
243 $tpl->assign(
'contact1',
$frm[
'contact1']);
245 $tpl->assign(
'adresse1',
$frm[
'adresse1']);
247 $tpl->assign(
'code_postal1',
$frm[
'code_postal1']);
249 $tpl->assign(
'ville1',
$frm[
'ville1']);
253 $tpl->assign(
'STR_BEFORE_TWO_POINTS',
$GLOBALS[
'STR_BEFORE_TWO_POINTS']);
254 $tpl->assign(
'STR_INVOICE_ADDRESS',
$GLOBALS[
'STR_INVOICE_ADDRESS']);
257 $tpl->assign(
'STR_FIRST_NAME',
$GLOBALS[
'STR_FIRST_NAME']);
259 $tpl->assign(
'STR_TELEPHONE',
$GLOBALS[
'STR_TELEPHONE']);
265 if(empty(
$GLOBALS[
'site_parameters'][
'user_multiple_addresses_disable'])) {
266 $tpl->assign(
'STR_ADDRESS_TEXT',
$GLOBALS[
'STR_ADDRESS_TEXT']);
267 $tpl->assign(
'personal_address_bill_id',
vb(
$_SESSION[
'session_commande'][
'personal_address_bill']));
272 $tpl->assign(
'is_mode_transport',
true);
273 $tpl->assign(
'STR_SHIP_ADDRESS',
$GLOBALS[
'STR_SHIP_ADDRESS']);
275 $tpl->assign(
'text_temp_address',
$GLOBALS[
"STR_MODULE_ICIRELAIS_TEMP_ADDRESS"]);
277 $tpl->assign(
'societe2',
$frm[
'societe2']);
281 $tpl->assign(
'prenom2',
$frm[
'prenom2']);
283 $tpl->assign(
'email2',
$frm[
'email2']);
285 $tpl->assign(
'contact2',
$frm[
'contact2']);
287 $tpl->assign(
'adresse2',
$frm[
'adresse2']);
289 $tpl->assign(
'code_postal2',
$frm[
'code_postal2']);
291 $tpl->assign(
'ville2',
$frm[
'ville2']);
295 $tpl->assign(
'is_mode_transport',
false);
297 if (
$_SESSION[
'session_caddie']->total > 0) {
298 $tpl->assign(
'is_payment_cgv',
true);
299 if(isset($erreurs[
'paiement'])) {
300 $tpl->assign(
'STR_ERR_PAYMENT',
$GLOBALS[
'STR_ERR_PAYMENT']);
306 $tpl->assign(
'is_payment_cgv',
false);
310 $tpl->assign(
'STR_REFERENCE_IF_KNOWN',
$GLOBALS[
'STR_REFERENCE_IF_KNOWN']);
311 $tpl->assign(
'commande_interne',
vb(
$frm[
'commande_interne']));
312 $tpl->assign(
'commentaires',
$frm[
'commentaires']);
313 $tpl->assign(
'register_during_order_process', !empty(
$GLOBALS[
'site_parameters'][
'register_during_order_process']) && !
est_identifie());
314 $tpl->assign(
'STR_CREATE_ACCOUNT_FUTURE_USE',
$GLOBALS[
'STR_CREATE_ACCOUNT_FUTURE_USE']);
316 $tpl->assign(
'STR_ETAPE_SUIVANTE',
$GLOBALS[
'STR_ETAPE_SUIVANTE']);
323 if (!function_exists(
'get_order_step2')) {
331 function get_order_step2(&
$frm, $mode_transport)
334 if (
$_SESSION[
'session_caddie']->count_products() == 0) {
338 $tpl =
$GLOBALS[
'tplEngine']->createTemplate(
'order_step2.tpl');
339 $tpl->assign(
'STR_BEFORE_TWO_POINTS',
$GLOBALS[
'STR_BEFORE_TWO_POINTS']);
342 $tpl->assign(
'STR_INVOICE_ADDRESS',
$GLOBALS[
'STR_INVOICE_ADDRESS']);
345 $tpl->assign(
'STR_TELEPHONE',
$GLOBALS[
'STR_TELEPHONE']);
352 $tpl->assign(
'societe1',
$frm[
'societe1']);
354 $tpl->assign(
'prenom1',
$frm[
'prenom1']);
355 $tpl->assign(
'contact1',
$frm[
'contact1']);
356 $tpl->assign(
'email1',
$frm[
'email1']);
357 $tpl->assign(
'adresse1',
$frm[
'adresse1']);
358 $tpl->assign(
'code_postal1',
$frm[
'code_postal1']);
359 $tpl->assign(
'ville1',
$frm[
'ville1']);
360 $tpl->assign(
'pays1',
$frm[
'pays1']);
361 if (trim(
$frm[
'commentaires']) !=
'') {
363 $tpl->assign(
'commentaires',
$frm[
'commentaires']);
365 if (!empty($mode_transport)) {
366 $tpl->assign(
'STR_SHIPPING_TYPE',
$GLOBALS[
'STR_SHIPPING_TYPE']);
367 $tpl->assign(
'STR_SHIP_ADDRESS',
$GLOBALS[
'STR_SHIP_ADDRESS']);
370 $tpl->assign(
'is_mode_transport',
true);
372 $tpl->assign(
'shipping_zone',
$_SESSION[
'session_caddie']->zone);
373 $tpl->assign(
'shipping_type',
$_SESSION[
'session_caddie']->type);
374 $tpl->assign(
'is_delivery_address_necessary_for_delivery_type', $is_delivery_address_necessary_for_delivery_type);
375 if(empty(
$GLOBALS[
'site_parameters'][
'user_multiple_addresses_disable'])) {
376 $tpl->assign(
'personal_address_ship_id',
vb(
$_SESSION[
'session_commande'][
'personal_address_ship']));
378 if($is_delivery_address_necessary_for_delivery_type) {
379 $tpl->assign(
'societe2',
$frm[
'societe2']);
381 $tpl->assign(
'prenom2',
$frm[
'prenom2']);
382 $tpl->assign(
'email2',
$frm[
'email2']);
383 $tpl->assign(
'contact2',
$frm[
'contact2']);
384 $tpl->assign(
'adresse2',
$frm[
'adresse2']);
385 $tpl->assign(
'code_postal2',
$frm[
'code_postal2']);
386 $tpl->assign(
'ville2',
$frm[
'ville2']);
387 $tpl->assign(
'pays2',
$frm[
'pays2']);
390 $tpl->assign(
'is_mode_transport',
false);
392 $tpl->assign(
'action', get_url(
'/achat/fin_commande.php'));
396 $tpl->assign(
'icirelais_id_delivery_points_radio_inputs', get_icirelais_id_delivery_points_radio_inputs($is_delivery_address_necessary_for_delivery_type));
398 if(
check_if_module_active(
'tnt') &&
$GLOBALS[
'web_service_tnt']->is_type_tntdropoffpoint(
vn(
$_SESSION[
'session_caddie']->typeId)) &&
$GLOBALS[
'web_service_tnt']->is_type_linked_to_tnt(
vn(
$_SESSION[
'session_caddie']->typeId)) && (defined(
'IN_STEP1') || defined(
'IN_STEP2') || defined(
'IN_STEP3'))) {
400 $tpl->assign(
'get_tnt_id_delivery_points_radio_inputs',
$GLOBALS[
'web_service_tnt']->get_tnt_id_delivery_points_radio_inputs());
401 }
catch (SoapFault $ex) {
403 echo
$GLOBALS[
'tplEngine']->createTemplate(
'global_error.tpl', array(
'message' =>
$GLOBALS[
'STR_MODULE_TNT_ERREUR_WEBSERVICE'] .
$GLOBALS[
'STR_BEFORE_TWO_POINTS'] .
': '.$ex->faultstring))->fetch();
406 $tpl->assign(
'caddie_products_summary_table', get_caddie_products_summary_table(
false,
true, $mode_transport, null));
408 $tpl->assign(
'STR_BACK_TO_CADDIE_TXT',
$GLOBALS[
'STR_BACK_TO_CADDIE_TXT']);
415 if (!function_exists(
'get_order_step3')) {
424 $tpl =
$GLOBALS[
'tplEngine']->createTemplate(
'order_step3.tpl');
426 $tpl->assign(
'resume_commande', affiche_resume_commande(
$commandeid,
false,
true));
427 $tpl->assign(
'conversion_page', affiche_contenu_html(
"conversion_page",
true));
429 $tpl->assign(
'STR_MSG_THANKS',
$GLOBALS[
"STR_MSG_THANKS"]);
430 return $tpl->fetch();
434 if (!function_exists(
'affiche_resume_commande')) {
444 function affiche_resume_commande(
$id, $affiche_statut, $show_only_owned_by_current_user =
true, $show_payment_form =
false)
448 $where =
'c.id = "' . intval(
$_SESSION[
'session_last_bill_viewed']) .
'"';
452 $where =
'c.id = "' . intval(
$id) .
'"';
454 if($show_only_owned_by_current_user && !empty(
$_SESSION[
'session_utilisateur'][
'id_utilisateur'])) {
455 $where .=
' AND c.id_utilisateur = "' . intval(
vb(
$_SESSION[
'session_utilisateur'][
'id_utilisateur'])) .
'"';
457 $qid_commande =
query(
'SELECT c.*, sp.technical_code AS statut_paiement, sl.technical_code AS statut_livraison
458 FROM peel_commandes c
459 LEFT JOIN peel_statut_paiement sp ON sp.id=c.id_statut_paiement AND ' .
get_filter_site_cond(
'statut_paiement',
'sp') .
'
460 LEFT JOIN peel_statut_livraison sl ON sl.id=c.id_statut_livraison AND ' .
get_filter_site_cond(
'statut_livraison',
'sl') .
'
464 if (!empty($commande)) {
466 $tpl =
$GLOBALS[
'tplEngine']->createTemplate(
'resume_commande.tpl');
467 $tpl->assign(
'STR_BEFORE_TWO_POINTS',
$GLOBALS[
'STR_BEFORE_TWO_POINTS']);
468 $tpl->assign(
'STR_MODULE_TELECHARGEMENT_FOR_DOWNLOAD',
$GLOBALS[
'STR_MODULE_TELECHARGEMENT_FOR_DOWNLOAD']);
469 $tpl->assign(
'STR_ORDER_DETAIL',
$GLOBALS[
'STR_ORDER_DETAIL']);
470 $tpl->assign(
'STR_ORDER_NUMBER',
$GLOBALS[
'STR_ORDER_NUMBER']);
474 $tpl->assign(
'STR_INVOICE_ADDRESS',
$GLOBALS[
'STR_INVOICE_ADDRESS']);
476 $tpl->assign(
'id', $commande->order_id);
478 $tpl->assign(
'order_amount', $order_infos[
'net_infos_array'][
'montant']);
479 $tpl->assign(
'bill_address', $order_infos[
'client_infos_bill']);
480 if (!empty(
$GLOBALS[
'site_parameters'][
'mode_transport'])) {
481 $tpl->assign(
'STR_SHIP_ADDRESS',
$GLOBALS[
'STR_SHIP_ADDRESS']);
482 $tpl->assign(
'ship_address', $order_infos[
'client_infos_ship']);
483 $tpl->assign(
'STR_SHIPPING_TYPE',
$GLOBALS[
'STR_SHIPPING_TYPE']);
484 $tpl->assign(
'shipping_type', $commande->type);
487 if (!empty($commande->delivery_tracking)) {
488 $tpl->assign(
'is_delivery_tracking',
true);
489 $tpl->assign(
'STR_TRACKING_LINK',
$GLOBALS[
'STR_TRACKING_LINK']);
490 $tpl->assign(
'delivery_tracking', $commande->delivery_tracking);
492 $tpl->assign(
'icirelais', array(
493 'src' => get_url(
'/modules/icirelais/js/icirelais.js'),
494 'value' =>
vb($commande->delivery_tracking)
496 $tpl->assign(
'STR_MODULE_ICIRELAIS_CONFIGURATION_TRACKING_URL_TITLE',
$GLOBALS[
'STR_MODULE_ICIRELAIS_CONFIGURATION_TRACKING_URL_TITLE']);
497 $tpl->assign(
'MODULE_ICIRELAIS_SETUP_TRACKING_URL', MODULE_ICIRELAIS_SETUP_TRACKING_URL);
498 $tpl->assign(
'STR_MODULE_ICIRELAIS_COMMENT_TRACKING',
$GLOBALS[
'STR_MODULE_ICIRELAIS_COMMENT_TRACKING']);
499 $tpl->assign(
'STR_MODULE_ICIRELAIS_ERROR_TRACKING',
$GLOBALS[
'STR_MODULE_ICIRELAIS_ERROR_TRACKING']);
500 $tpl->assign(
'STR_MODULE_ICIRELAIS_CREATE_TRACKING',
$GLOBALS[
'STR_MODULE_ICIRELAIS_CREATE_TRACKING']);
503 $tpl->assign(
'is_delivery_tracking',
false);
506 if((defined(
'IN_STEP1') || defined(
'IN_STEP2') || defined(
'IN_STEP3')) &&
check_if_module_active(
'tnt') &&
$GLOBALS[
'web_service_tnt']->is_type_linked_to_tnt(
vn(
$_SESSION[
'session_caddie']->typeId))) {
507 $receiver_info[
'type_id'] =
'';
508 if(!empty($commande->type)) {
515 if ($this_type[
'is_tnt'] == 0) {
516 die(
$GLOBALS[
'STR_MODULE_TNT_NOT_ASSOCIATED_ORDER']);
521 if(!empty($_POST[
'relais_tnt']) && $this_type[
'tnt_threshold'] == 0) {
523 $tab_relais_tnt = explode(
'###', $_POST[
'relais_tnt']);
524 $order_infos[
'code_postal2'] = $tab_relais_tnt[0];
525 $order_infos[
'ville2'] = $tab_relais_tnt[1];
526 $receiver_info[
'type_id'] = $tab_relais_tnt[2];
527 $receiver_info[
'type'] =
'DROPOFFPOINT';
529 $order_infos[
'code_postal2'] =
$_SESSION[
'session_commande'][
'code_postal2'];
530 $order_infos[
'ville2'] =
$_SESSION[
'session_commande'][
'ville2'];
533 if(!empty($commande->xETTCode) && $this_type[
'tnt_threshold'] == 0) {
535 $receiver_info[
'type_id'] = $commande->xETTCode;
536 $receiver_info[
'type'] =
'DROPOFFPOINT';
539 $receiver_info[
'type'] =
'ENTERPRISE';
542 $receiver_info[
'type'] =
'INDIVIDUAL';
545 $tpl->assign(
'STR_MODULE_TNT_FEASIBILITY_REPORT',
$GLOBALS[
'STR_MODULE_TNT_FEASIBILITY_REPORT']);
546 $tpl->assign(
'tnt_message',
$GLOBALS[
'web_service_tnt']->get_tnt_feasibility_test($order_infos, $receiver_info,
true));
547 }
catch (SoapFault $ex) {
548 $tpl->assign(
'tnt_erreur_message',
$GLOBALS[
'STR_MODULE_TNT_ERREUR_WEBSERVICE'] .
$GLOBALS[
'STR_BEFORE_TWO_POINTS'] .
': '.$ex->faultstring );
551 $tpl->assign(
'tnt_message', $tnt_message);
554 if ($affiche_statut === 1 || $affiche_statut ===
true) {
555 $tpl->assign(
'is_payment_delivery_status',
true);
557 $tpl->assign(
'STR_ORDER_STATUT_PAIEMENT',
$GLOBALS[
'STR_ORDER_STATUT_PAIEMENT']);
558 $tpl->assign(
'STR_ORDER_STATUT_LIVRAISON',
$GLOBALS[
'STR_ORDER_STATUT_LIVRAISON']);
560 if (!empty($commande->numero)) {
563 $tpl->assign(
'STR_PRINT_YOUR_BILL',
$GLOBALS[
'STR_PRINT_YOUR_BILL']);
564 $tpl->assign(
'invoice', array(
565 'src' => get_url(
'/images/view_pdf.gif'),
566 'href' =>
$GLOBALS[
'wwwroot'] .
'/factures/commande_pdf.php?code_facture=' . urlencode($commande->code_facture) .
'&mode=facture',
570 $tpl->assign(
'is_payment_delivery_status',
false);
573 $tpl->assign(
'STR_MODULE_PAYBACK_RETURN_REQUEST',
$GLOBALS[
'STR_MODULE_PAYBACK_RETURN_REQUEST']);
574 if(!defined(
'STR_RETURN_THIS_PRODUCT')) {
575 $tpl->assign(
'return_this_product_txt',
'');
577 $tpl->assign(
'return_this_product_txt',
$GLOBALS[
'STR_MODULE_PAYBACK_RETURN_THIS_PRODUCT']);
582 $tpl->assign(
'downloadable_file_link_array', get_downloadable_file_link(array(
'order_id' =>
$id)));
584 $products_data = array();
586 foreach ($product_infos_array as $this_ordered_product) {
588 $this_ordered_product[
"product_text"] =
display_option_image($this_ordered_product[
"product_text"],
true);
592 if(!empty($this_ordered_product[
'conditionnement'])){
593 $qte_total = intval($this_ordered_product[
'quantite']) * $this_ordered_product[
'conditionnement'];
595 $qte_total = $this_ordered_product[
'quantite'];
598 $products_data[] = array(
599 'reference' => $this_ordered_product[
'reference'],
600 'product_text' => str_replace(
"\n",
'<br />', $this_ordered_product[
"product_text"]),
601 'prix' =>
fprix($this_ordered_product[
'prix'],
true, $commande->devise,
true, $commande->currency_rate),
602 'conditionnement' => (!empty($this_ordered_product[
'conditionnement'])?$this_ordered_product[
'conditionnement']:
'-'),
603 'conditionnement_qty' =>
vb($qte_total),
604 'quantite' => $this_ordered_product[
'quantite'],
605 'total_prix' =>
fprix($this_ordered_product[
'total_prix'],
true, $commande->devise,
true, $commande->currency_rate),
606 'is_form_retour' => (
check_if_module_active(
'payback') && in_array($commande->statut_paiement, array(
'being_checked',
'completed')) && $commande->statut_livraison ==
'dispatched' && $this_ordered_product[
'statut'] = 1 && $this_ordered_product[
'quantite'] > 0),
607 'action' => get_url(
'/modules/payback/form_retour.php'),
608 'commandeid' => $commande->id,
609 'utilisateurid' => $commande->id_utilisateur,
610 'paiement' => $commande->paiement,
611 'langue' => $commande->lang,
612 'nom_produit' => $this_ordered_product[
'nom_produit'],
613 'taille_produit' => $this_ordered_product[
'taille'],
614 'couleur_produit' => $this_ordered_product[
'couleur'],
615 'id_produit' => $this_ordered_product[
'id'],
616 'prix_ht_produit' => $this_ordered_product[
'prix_ht'],
617 'prix_ttc_produit' => $this_ordered_product[
'prix'],
618 'tva_produit' => $this_ordered_product[
'tva'],
621 if (!empty(
$GLOBALS[
'site_parameters'][
'validate_payment_tag_html'])) {
622 $template_tags[
'ORDER_NUMBER'] = $commande->id;
623 $template_tags[
'BUYER_EMAIL_ADDRESS'] = $commande->email;
624 $template_tags[
'CUSTOMER_ID'] = $commande->id_utilisateur;
625 $template_tags[
'SHOPPING_BASKET_TOTAL'] = $commande->montant;
626 $template_tags[
'ORDER_CURRENCY'] = $commande->devise;
627 $template_tags[
'PAYMENT_METHOD'] = $commande->paiement;
630 $tpl->assign(
'products_data', $products_data);
631 if($show_payment_form) {
634 $tpl->assign(
'STR_LIST_PRODUCT',
$GLOBALS[
'STR_LIST_PRODUCT']);
635 $tpl->assign(
'STR_REFERENCE',
$GLOBALS[
'STR_REFERENCE']);
637 $tpl->assign(
'STR_SOLD_PRICE',
$GLOBALS[
'STR_SOLD_PRICE']);
639 $tpl->assign(
'STR_TOTAL_TTC',
$GLOBALS[
'STR_TOTAL_TTC']);
640 $tpl->assign(
'STR_CONDITIONNEMENT',
$GLOBALS[
'STR_CONDITIONNEMENT']);
641 $tpl->assign(
'STR_CONDITIONNEMENT_QTY',
$GLOBALS[
'STR_CONDITIONNEMENT_QTY']);
648 if (!function_exists(
'affiche_liste_commandes')) {
656 function affiche_liste_commandes($order =
"id" , $sort =
"DESC")
661 $sql =
"SELECT c.*, sp.technical_code AS statut_paiement, sl.technical_code AS statut_livraison
662 FROM peel_commandes c
663 LEFT JOIN peel_statut_paiement sp ON sp.id=c.id_statut_paiement AND " .
get_filter_site_cond(
'statut_paiement',
'sp') .
"
664 LEFT JOIN peel_statut_livraison sl ON sl.id=c.id_statut_livraison AND " .
get_filter_site_cond(
'statut_livraison',
'sl') .
"
665 WHERE c.id_utilisateur = '" . intval(
$_SESSION[
'session_utilisateur'][
'id_utilisateur']) .
"' AND " .
get_filter_site_cond(
'commandes',
'c') .
"
667 $tpl =
$GLOBALS[
'tplEngine']->createTemplate(
'liste_commandes.tpl');
673 $tpl->assign(
'STR_TABLE_SUMMARY_ORDERS',
$GLOBALS[
'STR_TABLE_SUMMARY_ORDERS']);
674 $tpl->assign(
'STR_ORDER_NUMBER',
$GLOBALS[
'STR_ORDER_NUMBER']);
676 $tpl->assign(
'STR_ORDER_STATUT_PAIEMENT',
$GLOBALS[
'STR_ORDER_STATUT_PAIEMENT']);
677 $tpl->assign(
'STR_ORDER_STATUT_LIVRAISON',
$GLOBALS[
'STR_ORDER_STATUT_LIVRAISON']);
688 'href' =>
get_current_url(
false) .
'?mode=details&id=' . $order[
'id'] .
'×tamp=' . urlencode($order[
'o_timestamp']),
689 'info_src' => get_url(
'/icones/info.gif'),
690 'pdf_src' => get_url(
'/images/view_pdf.gif'),
691 'facture_href' => (!empty($order[
'numero'])?
get_site_wwwroot($order[
'site_id']) .
'/factures/commande_pdf.php?code_facture=' . $order[
'code_facture'] .
'&mode=facture':
''),
692 'order_id' => $order[
'order_id'],
693 'numero' => $order[
'numero'],
694 'id' => $order[
'id'],
699 'paid' => in_array($order[
'statut_paiement'], array(
'being_checked',
'completed'))
702 $tpl->assign(
'orders', $orders);
703 $tpl->assign(
'multipage',
$Links->GetMultipage());
705 $tpl->assign(
'STR_ORDER_HISTORY',
$GLOBALS[
'STR_ORDER_HISTORY']);
711 if (!function_exists(
'affichage_fin_cb')) {
719 function affichage_fin_cb($order_id, $payment_validated, $message =
'')
721 $tpl =
$GLOBALS[
'tplEngine']->createTemplate(
'fin_cb.tpl');
722 $tpl->assign(
'payment_validated', $payment_validated);
723 $tpl->assign(
'message', $message);
724 if ($payment_validated) {
725 $tpl->assign(
'payment_msg',
$GLOBALS[
'STR_PAYMENT_SUCCEED']);
726 $tpl->assign(
'bottom_msg',
$GLOBALS[
'STR_YOU_CAN_EDIT_YOUR_ORDER']);
727 $tpl->assign(
'resume_commande', affiche_resume_commande($order_id,
false,
true));
729 $tpl->assign(
'payment_msg',
$GLOBALS[
'STR_PAYMENT_FAILED']);
730 $tpl->assign(
'bottom_msg',
$GLOBALS[
'STR_ORDER_RENEW_INVITE']);
732 $tpl->assign(
'STR_ORDER_STATUT',
$GLOBALS[
'STR_ORDER_STATUT']);
738 if (!function_exists(
'get_caddie_products_summary_table')) {
748 function get_caddie_products_summary_table($with_form_fields =
false, $with_totals_summary =
true, $mode_transport, $shipping_text = null)
751 if (empty($shipping_text)) {
752 $shipping_text =
$GLOBALS[
'STR_SHIPPING_COST'];
755 $total_remise_displayed =
$_SESSION[
'session_caddie']->total_remise;
756 $total_ecotaxe_displayed =
$_SESSION[
'session_caddie']->total_ecotaxe_ttc;
757 $small_order_overcost_displayed =
$_SESSION[
'session_caddie']->small_order_overcost_amount;
758 $cout_transport_displayed =
$_SESSION[
'session_caddie']->cout_transport;
759 $taxes_displayed =
$GLOBALS[
'STR_TTC'];
761 $total_remise_displayed =
$_SESSION[
'session_caddie']->total_remise_ht;
762 $total_ecotaxe_displayed =
$_SESSION[
'session_caddie']->total_ecotaxe_ht;
763 $small_order_overcost_displayed =
$_SESSION[
'session_caddie']->small_order_overcost_amount_ht;
764 $cout_transport_displayed =
$_SESSION[
'session_caddie']->cout_transport_ht;
765 $taxes_displayed =
$GLOBALS[
'STR_HT'];
767 $tpl =
$GLOBALS[
'tplEngine']->createTemplate(
'caddie_products_summary_table.tpl');
768 $tpl->assign(
'taxes_displayed', $taxes_displayed);
769 $tpl->assign(
'suppression_src',
$GLOBALS[
'repertoire_images'] .
'/suppression.png');
770 if(!empty(
$GLOBALS[
'site_parameters'][
'default_picture'])) {
771 $tpl->assign(
'no_photo_src',
$GLOBALS[
'repertoire_upload'] .
'/' .
$GLOBALS[
'site_parameters'][
'default_picture']);
773 $tpl->assign(
'with_form_fields', $with_form_fields);
776 if(
$_SESSION[
'session_caddie']->tarif_paiement>0) {
777 $tpl->assign(
'tarif_paiement',
fprix(
$_SESSION[
'session_caddie']->tarif_paiement,
true));
779 $tpl->assign(
'STR_BEFORE_TWO_POINTS',
$GLOBALS[
'STR_BEFORE_TWO_POINTS']);
780 $tpl->assign(
'STR_TABLE_SUMMARY_CADDIE',
$GLOBALS[
'STR_TABLE_SUMMARY_CADDIE']);
781 $tpl->assign(
'STR_FRAIS_GESTION',
$GLOBALS[
'STR_FRAIS_GESTION']);
782 $tpl->assign(
'STR_CONDITIONNEMENT',
$GLOBALS[
'STR_CONDITIONNEMENT']);
783 $tpl->assign(
'STR_CONDITIONNEMENT_QTY',
$GLOBALS[
'STR_CONDITIONNEMENT_QTY']);
785 $tpl->assign(
'STR_UNIT_PRICE',
$GLOBALS[
'STR_UNIT_PRICE']);
786 $tpl->assign(
'STR_OPTION_PRICE',
$GLOBALS[
'STR_OPTION_PRICE']);
789 $tpl->assign(
'STR_TOTAL_PRICE',
$GLOBALS[
'STR_TOTAL_PRICE']);
790 $tpl->assign(
'STR_DELETE_PROD_CART',
$GLOBALS[
'STR_DELETE_PROD_CART']);
792 $tpl->assign(
'STR_DELIVERY_STOCK',
$GLOBALS[
'STR_DELIVERY_STOCK']);
795 $tpl->assign(
'STR_EMAIL_FRIEND',
$GLOBALS[
'STR_EMAIL_FRIEND']);
796 $tpl->assign(
'STR_HOLIDAY_AVAILABLE_CADDIE',
$GLOBALS[
'STR_HOLIDAY_AVAILABLE_CADDIE']);
800 $tpl->assign(
'STR_REFERENCE',
$GLOBALS[
'STR_REFERENCE']);
808 $couleur =
vb(
$_SESSION[
'session_caddie']->couleurId[$numero_ligne]);
809 $taille =
vb(
$_SESSION[
'session_caddie']->tailleId[$numero_ligne]);
811 $listcadeaux_owner =
vn(
$_SESSION[
'session_caddie']->giftlist_owners[$numero_ligne]);
813 $quantite =
vn(
$_SESSION[
'session_caddie']->quantite[$numero_ligne]);
815 $stock_commandable = get_stock_commandable(
$product_object, $quantite);
818 $prix_ht =
vn(
$_SESSION[
'session_caddie']->prix_ht[$numero_ligne]);
819 $prix_cat =
vn(
$_SESSION[
'session_caddie']->prix_cat[$numero_ligne]);
820 $prix_cat_ht =
vn(
$_SESSION[
'session_caddie']->prix_cat_ht[$numero_ligne]);
821 $total_prix =
vn(
$_SESSION[
'session_caddie']->total_prix[$numero_ligne]);
822 $total_prix_ht =
vn(
$_SESSION[
'session_caddie']->total_prix_ht[$numero_ligne]);
823 $tva_percent =
vn(
$_SESSION[
'session_caddie']->tva_percent[$numero_ligne]);
824 $tva =
vn(
$_SESSION[
'session_caddie']->tva[$numero_ligne]);
825 $poids =
vb(
$_SESSION[
'session_caddie']->poids[$numero_ligne]);
826 $points =
vb(
$_SESSION[
'session_caddie']->points[$numero_ligne]);
827 $percent_remise_produit =
vn(
$_SESSION[
'session_caddie']->percent_remise_produit[$numero_ligne]);
828 $remise =
vn(
$_SESSION[
'session_caddie']->remise[$numero_ligne]);
829 $remise_ht =
vn(
$_SESSION[
'session_caddie']->remise_ht[$numero_ligne]);
831 $etat_stock =
vn(
$_SESSION[
'session_caddie']->etat_stock[$numero_ligne]);
832 $delivery_stock =
vb(
$_SESSION[
'session_caddie']->delai_stock[$numero_ligne]);
834 $email_check =
vb(
$_SESSION[
'session_caddie']->email_check[$numero_ligne]);
836 $ecotaxe =
vb(
$_SESSION[
'session_caddie']->ecotaxe_ttc[$numero_ligne]);
839 $urlprod_with_cid =
$product_object->get_product_url(
true,
false) .
"cId=" .
$_SESSION[
'session_caddie']->couleurId[$numero_ligne];
840 $display_picture =
$product_object->get_product_main_picture(
false,
$_SESSION[
'session_caddie']->couleurId[$numero_ligne]);
843 $option =
vn(
$_SESSION[
'session_caddie']->option[$numero_ligne]);
844 $remise_displayed = $remise;
846 $prix_cat_displayed = $prix_cat;
847 $prix_avant_code_promo_sans_option_displayed =
$_SESSION[
'session_caddie']->prix_avant_code_promo[$numero_ligne] -
$_SESSION[
'session_caddie']->option[$numero_ligne] * (1 -
$_SESSION[
'session_caddie']->percent_remise_produit[$numero_ligne] / 100);
848 $total_prix_displayed = $total_prix;
850 $option =
vn(
$_SESSION[
'session_caddie']->option_ht[$numero_ligne]);
851 $remise_displayed = $remise_ht;
853 $prix_cat_displayed = $prix_cat_ht;
854 $prix_avant_code_promo_sans_option_displayed =
$_SESSION[
'session_caddie']->prix_ht_avant_code_promo[$numero_ligne] -
$_SESSION[
'session_caddie']->option_ht[$numero_ligne] * (1 -
$_SESSION[
'session_caddie']->percent_remise_produit[$numero_ligne] / 100);
855 $total_prix_displayed = $total_prix_ht;
861 'delete_href' => get_url(
'caddie_affichage', array(
'func'=>
'enleve',
'ligne'=> $numero_ligne ,
'id' =>
$product_object->id)),
862 'urlprod_with_cid' => $urlprod_with_cid,
863 'numero_ligne' => $numero_ligne,
865 'listcadeaux_owner' =>
vb($listcadeaux_owner),
867 'id_attribut' =>
vb(
$_SESSION[
'session_caddie']->id_attribut[$numero_ligne]),
870 'configuration_attributs_description' => (!empty(
$product_object->configuration_attributs_list) ?
$product_object->configuration_attributs_description : NULL),
871 'email_check' => $email_check,
872 'prix' =>
fprix($prix_cat_displayed,
true),
878 if ($display_picture) {
879 $tmpProd[
'src'] =
$GLOBALS[
'repertoire_upload'] .
'/thumbs/' .
thumbs($display_picture, 75, 75,
'fit');
880 }
elseif(!empty(
$GLOBALS[
'site_parameters'][
'default_picture'])) {
881 $tmpProd[
'src'] =
$GLOBALS[
'repertoire_upload'] .
'/thumbs/' .
thumbs(
$GLOBALS[
'site_parameters'][
'default_picture'], 75, 75,
'fit');
884 $tmpProd[
'listcadeaux_owner_name'] =
getUsername($listcadeaux_owner);
887 $tmpProd[
'delivery_stock'] =
get_formatted_duration((intval($delivery_stock) * 24 * 3600),
false,
'month');
889 if (!empty(
$_SESSION[
'session_caddie']->couleurId[$numero_ligne])) {
890 $tmpProd[
'color'] = array(
892 'id' => intval(
$_SESSION[
'session_caddie']->couleurId[$numero_ligne])
895 if (!empty(
$_SESSION[
'session_caddie']->tailleId[$numero_ligne])) {
896 $tmpProd[
'size'] = array(
898 'id' => intval(
$_SESSION[
'session_caddie']->tailleId[$numero_ligne])
903 $supplier_back =
query(
"SELECT on_vacances, on_vacances_date
904 FROM peel_utilisateurs
909 $tmpProd[
'vacances'] = array(
910 'nbjours' => $nbjours,
915 if (round($prix_cat_displayed, 2) != round($prix_avant_code_promo_sans_option_displayed, 2)) {
916 $tmpProd[
'prix_promo'] =
fprix($prix_avant_code_promo_sans_option_displayed,
true);
919 $tmpProd[
'prix_ecotaxe'] =
fprix($ecotaxe,
true);
922 $tmpProd[
'option_prix'] =
fprix($option * (1 -
$_SESSION[
'session_caddie']->percent_remise_produit[$numero_ligne] / 100),
true);
923 if (!empty(
$_SESSION[
'session_caddie']->percent_remise_produit[$numero_ligne]))
924 $tmpProd[
'option_prix_remise'] =
fprix($option,
true);
926 if ($with_form_fields) {
927 $tmpProd[
'quantite'] = array(
928 'value' => $quantite,
932 $additionnal_quantity_possible = $stock_commandable - $quantite;
933 $this_prepared_javascript_message =
$GLOBALS[
'STR_QUANTITY_INSUFFICIENT'] .
' ';
934 if ($additionnal_quantity_possible == 0) {
936 $this_prepared_javascript_message .=
$GLOBALS[
'STR_ZERO_PRODUCT_ADD'];
937 }
elseif ($additionnal_quantity_possible == 1) {
939 $this_prepared_javascript_message .= $additionnal_quantity_possible .
' ' .
$GLOBALS[
'STR_QUANTITY_PRODUCT_ADD'];
942 $this_prepared_javascript_message .= $additionnal_quantity_possible .
' ' .
$GLOBALS[
'STR_QUANTITY_PRODUCTS_ADD'];
944 $tmpProd[
'quantite'][
'message'] = $this_prepared_javascript_message;
945 $tmpProd[
'quantite'][
'stock_commandable'] = $stock_commandable;
947 $tmpProd[
'quantite'][
'hidden_fields'] = (
$product_object->on_download == 1);
949 $tmpProd[
'quantite'] = $quantite;
953 $tmpProd[
'conditionnement_qty'] = intval($quantite) * intval(
$product_object->conditionnement);
955 $tmpProd[
'conditionnement_qty'] = intval($quantite);
959 if($remise_displayed > 0) {
960 $tmpProd[
'remise'] =
fprix($remise_displayed,
true);
962 $tmpProd[
'total_prix'] =
fprix($total_prix_displayed,
true);
963 $products[] = $tmpProd;
967 $tpl->assign(
'products', $products);
968 $tpl->assign(
'with_totals_summary', $with_totals_summary);
969 $tpl->assign(
'STR_WITH_PROMO_CODE',
$GLOBALS[
'STR_WITH_PROMO_CODE']);
970 $tpl->assign(
'STR_ON_CATEGORY',
$GLOBALS[
'STR_ON_CATEGORY']);
971 $tpl->assign(
'STR_SMALL_ORDER_OVERCOST_TEXT',
$GLOBALS[
'STR_SMALL_ORDER_OVERCOST_TEXT']);
977 $tpl->assign(
'STR_NO_VAT_APPLIABLE',
$GLOBALS[
'STR_NO_VAT_APPLIABLE']);
980 $tpl->assign(
'STR_ORDER_POINT',
$GLOBALS[
'STR_ORDER_POINT']);
981 $tpl->assign(
'STR_GIFT_POINTS',
$GLOBALS[
'STR_GIFT_POINTS']);
983 if ($with_totals_summary) {
985 $tpl->assign(
'total_ecotaxe',
fprix($total_ecotaxe_displayed,
true));
988 if (!empty(
$_SESSION[
'session_caddie']->total_remise)) {
989 $tpl->assign(
'total_remise',
fprix($total_remise_displayed,
true));
990 if (!empty(
$_SESSION[
'session_caddie']->percent_code_promo) || !empty(
$_SESSION[
'session_caddie']->valeur_code_promo)) {
991 $tpl->assign(
'code_promo', array(
992 'value' =>
$_SESSION[
'session_caddie']->code_promo,
993 'total' => (!empty(
$_SESSION[
'session_caddie']->percent_code_promo) ?
fprix(
$_SESSION[
'session_caddie']->total_reduction_percent_code_promo,
true) :
fprix(
$_SESSION[
'session_caddie']->valeur_code_promo,
true)),
999 $treshold_to_use =
$GLOBALS[
'site_parameters'][
'minimal_amount_to_order_reve'];
1001 $treshold_to_use =
$GLOBALS[
'site_parameters'][
'minimal_amount_to_order'];
1004 if (
$GLOBALS[
'site_parameters'][
'small_order_overcost_limit'] != 0 &&
$_SESSION[
'session_caddie']->total >= $treshold_to_use) {
1005 $tpl->assign(
'sool', array(
1006 'prix' =>
fprix($small_order_overcost_displayed,
true),
1007 'limit_prix' =>
fprix(
$GLOBALS[
'site_parameters'][
'small_order_overcost_limit'],
true)
1010 if ($mode_transport != 0) {
1011 $tpl->assign(
'transport', array(
1012 'prix' =>
fprix($cout_transport_displayed,
true),
1013 'shipping_text' => $shipping_text
1018 $tpl->assign(
'micro', array(
1020 'prix_tva' =>
fprix(
$_SESSION[
'session_caddie']->total_tva,
true)
1023 if (!empty(
$_SESSION[
'session_caddie']->avoir)) {
1027 $tpl->assign(
'total_points',
$_SESSION[
'session_caddie']->total_points);
1034 if (!function_exists(
'add_cart_by_reference')) {
1039 function add_cart_by_reference() {
1040 if (empty(
$GLOBALS[
'site_parameters'][
'nb_product_in_cart_by_reference_form'])) {
1044 <form action="' .
$GLOBALS[
'wwwroot'] .
'/achat/caddie_ajout.php?technical_code=add_cart_by_reference" method="post">
1045 <table class="add_cart_by_reference">
1046 <tr><td></td><td class="center">' .
$GLOBALS[
'STR_QUANTITY'] .
'</td><td class="center">'.$GLOBALS[
'STR_REFERENCE'].
'</td></tr>';
1047 for(
$i=1;
$i<=
vn(
$GLOBALS[
'site_parameters'][
'nb_product_in_cart_by_reference_form']);
$i++) {
1050 <td class="bold">' .
$GLOBALS[
'STR_PRODUCT'] .
' '.
$i .
$GLOBALS[
'STR_BEFORE_TWO_POINTS'] .
':</td>
1051 <td><input class="form-control" type="text" name="qte[]" value="" /></td>
1052 <td><input class="form-control" type="text" name="reference[]" value="" /></td>
1056 <tr><td></td><td colspan="2"><input class="btn btn-primary" type="submit" value="'.$GLOBALS[
'STR_ADD_CART'].
'" /></td></tr>
get_payment_status_name($id)
get_payment_status_name()
if(!empty($GLOBALS['site_parameters']['order_specific_field_titles'])) if(check_if_module_active('socolissimo')&&!empty($_REQUEST)&&!empty($_REQUEST['PUDOFOID'])&&!empty($_REQUEST['CEEMAIL'])&&!empty($_REQUEST['SIGNATURE'])&&!empty($_REQUEST['ORDERID'])) elseif(!empty($_POST)) elseif(check_if_module_active('socolissimo')&&!empty($_SESSION['session_commande']['is_socolissimo_order'])) foreach(array('bill'=> 1, 'ship'=> 2) as $address_type=> $session_commande_address_id) $frm['societe1']
get_personal_address_form($id_utilisateur, $address_type= 'bill', $selected=null, $add_manage_choice=true, $css_style=null)
Retourne le menu déroulant avec la lsite des adresses disponibles par utilisateur.
get_current_url($with_get=true, $get_short_url=false, $take_away_get_args_array=null)
get_current_url()
get_product_infos_array_in_order($order_id, $devise=null, $currency_rate=null, $order_by=null, $add_total_prix_attribut=false)
get_product_infos_array_in_order()
is_user_tva_intracom_for_no_vat($user_id=null)
is_user_tva_intracom_for_no_vat()
get_delivery_status_name($id)
get_delivery_status_name()
word_real_escape_string($value)
Applique real_escape_string dans le cas où on n'insère qu'un seul mot, de moins de 30 caractères...
get_color_name($color_id)
Renvoie le nom d'une couleur.
nohtml_real_escape_string($value, $allowed_tags=null)
Protège les données pour insertion dans MySQL ET supprime les tags HTML pour protéger de toute sorte ...
get_category_name($id)
Renvoie le nom d'une catégorie de produits.
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(empty($_GET['id'])) if(!empty($GLOBALS['site_parameters']['allow_multiple_product_url_with_category'])) $product_object
if(!defined('IN_PEEL')) thumbs($source_filename, $width, $height, $method= 'fit', $source_folder=null, $thumb_folder=null, $thumb_rename=true, $return_absolute_path=false)
Charge l'image dont le nom est $source_filename dans le répertoire d'upload, et crée une vignette pou...
if(isset($_POST['pays_zone'])) elseif(empty($_SESSION['session_caddie']->zoneId)&&!empty($GLOBALS['site_parameters']['default_delivery_zone_id'])) if(isset($_POST['type'])) elseif(empty($_SESSION['session_caddie']->typeId)&&!empty($GLOBALS['site_parameters']['default_delivery_type_id'])) if(!empty($_POST['code_promo'])) if(!empty($_GET['code_promo'])&&$_GET['code_promo']== 'delete') $form_error_object
get_specific_field_infos($frm, $form_error_object=null, $form_usage="user", $step=null)
Permet de définir de nouveaux champs dans le formulaire d'inscription / modification d'utilisateur de...
get_filter_site_cond($table_technical_code, $table_alias=null, $use_strict_rights_if_in_admin=false, $specific_site_id=null, $exclude_public_items=false, $admin_force_multisite_if_allowed=false)
Retourne la condition SQL permettant de filtrer les données pour une table.
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.
if(!defined('IN_PEEL')) est_identifie()
Retourne true si l'utilisateur est identifié
get_country_select_options($selected_country_name=null, $selected_country_id=null, $option_value= 'name', $display_inactive_country=false, $allowed_zone_id=null, $preselect_shop_country_if_none_selected=true, $selected_country_lang=null, $allowed_ids=null)
get_country_select_options()
if(strlen($date2)== '10') if($type== 'users-by-age'&&a_priv('admin_users', true)) elseif($type== 'forums-count'&&a_priv('admin_content', true)) elseif($type== 'forums-categories'&&a_priv('admin_content', true)) elseif($type== 'users-count'&&a_priv('admin_users', true)) elseif($type== 'product-categories'&&a_priv('admin_products', true)) elseif($type== 'users-by-sex'&&a_priv('admin_users', true)) elseif($type== 'users-by-country'&&a_priv('admin_users', true)) elseif($type== 'sales'&&a_priv('admin_sales', true))
num_rows($query_result)
num_rows()
display_option_image($str_image, $set=false)
Formatte l'attribut (de type upload) du produit.
fetch_object($query_result)
fetch_object()
fetch_assoc($query_result)
fetch_assoc()
get_payment_form($order_id, $forced_type=null, $send_admin_email=false, $amount_to_pay=0, $allow_autosend=true)
Renvoie le formulaire de paiement.
is_delivery_address_necessary_for_delivery_type($selected_delivery_type_id=null)
is_delivery_address_necessary_for_delivery_type()
$GLOBALS['page_columns_count']
get_site_wwwroot($site_id, $lang=null)
Renvoie l'URL d'un site donné
getUsername($user_id)
getUsername()
a_priv($requested_priv, $demo_allowed=false, $site_configuration_modification=false, $user_id=null)
Renvoie true si l'utilisateur de la session a le privilège $requested_priv ou un droit supérieur Des ...
get_order_infos_array($order_object)
get_order_infos_array()
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...
get_payment_name($id_or_code)
get_payment_name()
get_payment_select($selected_payment_technical_code=null, $show_selected_even_if_not_available=false, $show_site_info_if_needed=false)
get_payment_select()
check_if_module_active($module_name, $specific_file_name=null)
Renvoie si un module est présent et activé ou non - Peut être appelé avant ou après le chargement d'u...
get_size_name($size_id)
Renvoie le nom d'une taille.
if(defined('IN_PEEL_ADMIN')||IN_INSTALLATION) $_SESSION['session_langue']