PEEL Shopping
Open source ecommerce : PEEL Shopping
display_caddie.php
Go to the documentation of this file.
1 <?php
2 // This file should be in UTF8 without BOM - Accents examples: éèê
3 // +----------------------------------------------------------------------+
4 // | Copyright (c) 2004-2015 Advisto SAS, service PEEL - contact@peel.fr |
5 // +----------------------------------------------------------------------+
6 // | This file is part of PEEL Shopping 8.0.0, which is subject to an |
7 // | opensource GPL license: you are allowed to customize the code |
8 // | for your own needs, but must keep your changes under GPL |
9 // | More information: https://www.peel.fr/lire/licence-gpl-70.html |
10 // +----------------------------------------------------------------------+
11 // | Author: Advisto SAS, RCS 479 205 452, France, https://www.peel.fr/ |
12 // +----------------------------------------------------------------------+
13 // $Id: display_caddie.php 47101 2015-10-02 09:47:03Z gboussin $
14 if (!defined('IN_PEEL')) {
15  die();
16 }
17 
18 if (!function_exists('get_caddie_content_html')) {
19 
27  function get_caddie_content_html(&$form_error_object, $mode_transport)
28  {
29  $output = '';
30  $listcadeaux_owner = '';
31  // Vérifie pour offrir les frais de port que le seuil d'offre ou le nombre de produits sont différents de 0
32  // si différent de 0, on 'construit' le message à afficher
33  // Attention : un test !empty ne marche pas sur seuil_total_used car au format "0.00"
34  $seuil_total_used = (check_if_module_active('reseller') && is_reseller()) ? $GLOBALS['site_parameters']['seuil_total_reve'] : $GLOBALS['site_parameters']['seuil_total'];
35  $shipping_text = '';
36  // Récupération des informations de la zone sélectionnée pour adapter le message.
37  if(!empty($_SESSION['session_caddie']->zoneId)) {
38  $q = query('SELECT on_franco_amount, on_franco_nb_products, on_franco_reseller_amount
39  FROM peel_zones z
40  WHERE id="'.intval($_SESSION['session_caddie']->zoneId).'" AND ' . get_filter_site_cond('zones', 'z') . '');
41  $zone_result = fetch_assoc($q);
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'];
44  }
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'] . ' ';
48  // Le seuil d'exonération des frais de port pour une zone est prioritaire sur le seuil d'exonération des frais de port de la configuration générale de la boutique
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'];
53  }
54  } elseif (round($seuil_total_used, 2) > 0 ) {
55  $shipping_text .= $GLOBALS['STR_FROM'] . ' ' . fprix($seuil_total_used, true) . ' ' . $GLOBALS['STR_TTC'];
56  }
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'];
59  }
60  $shipping_text .= ')';
61  }
62  }
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']);
66  $tpl->assign('STR_CADDIE', $GLOBALS['STR_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');
70 
71  if(!($_SESSION['session_caddie']->count_products() == 0)){
72  $tpl->assign('STR_BEFORE_TWO_POINTS', $GLOBALS['STR_BEFORE_TWO_POINTS']);
73  if (check_if_module_active('vacances') && get_vacances_type() == 1) {
74  $tpl->assign('global_error', vb($GLOBALS['site_parameters']['module_vacances_client_msg_' . $_SESSION['session_langue']]));
75  }
76  $tpl->assign('erreur_caddie', $_SESSION['session_caddie']->affiche_erreur_caddie());
77  $tpl->assign('action', get_current_url(false));
78  $tpl->assign('products_summary_table', get_caddie_products_summary_table(true, true, $mode_transport, $shipping_text));
79  $tpl->assign('shipping_text', $shipping_text);
80  $tpl->assign('STR_UPDATE', $GLOBALS['STR_UPDATE']);
81 
82  if (est_identifie()) {
83  // Test sur l'identification, il faut obligatoirement être connecté à son compte pour renseigner un code promo. Les utilisateurs 'stop' (attente revendeur) ou 'stand' (attente affiliation) ne peuvent pas se connecter à leur compte, ne peuvent donc pas passer commande et ne bénéficient donc pas des avantages liés au statut final 'reve' (revendeur confirmé) ou 'affi' (affilié confirmé). Les utilisateurs 'load' (téléchargement) ou 'newsletter' (abonné newsletter) ne peuvent pas se connecter, et donc ne peuvent pas non plus passer commande.
84  $tpl->assign('code_promo', array(
85  'txt' => $GLOBALS['STR_CODE_PROMO'],
86  'value' => vb($_SESSION['session_caddie']->code_promo),
87  ));
88  if (!empty($_SESSION['session_caddie']->code_promo)) {
89  $tpl->assign('code_promo_delete', array(
90  'href' => get_current_url(false) . '?code_promo=delete',
91  'src' => get_url('/icones/rupture.png'),
92  'txt' => $GLOBALS['STR_DELETE']
93  ));
94  }
95  if (!empty($GLOBALS['site_parameters']['user_tva_intracom_validation_on_cart_page']) && check_if_module_active('vatlayer')) {
96  $tpl->assign('intracom_for_billing_error', $form_error_object->text('intracom_for_billing'));
97  $tpl->assign('user_tva_intracom', array(
98  'txt' => $GLOBALS['STR_VAT_INTRACOM'],
99  'value' => vb($_SESSION['session_utilisateur']['intracom_for_billing']),
100  ));
101  }
102  } else {
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']);
107  if(check_if_module_active('devis')) {
108  $tpl->assign('STR_DEVIS', $GLOBALS['STR_DEVIS']);
109  $tpl->assign('devis_url', get_url('/modules/devis/devis.php'));
110  }
111  }
112 
113  $tpl->assign('is_mode_transport', !empty($mode_transport));
114  if (!empty($mode_transport)) {
115  $tpl->assign('zone_error', $form_error_object->text('pays_zone'));
116  $tpl->assign('STR_DELIVERY', $GLOBALS['STR_DELIVERY']);
117  $tpl->assign('STR_SHIPPING_ZONE', $GLOBALS['STR_SHIPPING_ZONE']);
118  $tpl->assign('STR_REFRESH', $GLOBALS['STR_REFRESH']);
119  $tpl->assign('STR_SHIP_ZONE_CHOOSE', $GLOBALS['STR_SHIP_ZONE_CHOOSE']);
120  // On gère le port : même en cas de tarification indépendante de la zone de livraison,
121  // il faut demander la zone afin de pouvoir identifier les modes de livraison possibles
122  $sqlZone = 'SELECT id, nom_' . $_SESSION['session_langue'] . ' AS nom
123  FROM peel_zones z
124  WHERE ' . get_filter_site_cond('zones', 'z') . '
125  ORDER BY position, nom';
126  $resZone = query($sqlZone);
127  $zone_options = array();
128  while ($Zone = fetch_assoc($resZone)) {
129  $selected = false;
130  if (empty($_SESSION['session_caddie']->zoneId)) {
131  // L'utilisateur vient d'arriver sur la page de caddie : on présélectionne la zone liée à l'adresse de son compte
132  if (!empty($_SESSION['session_utilisateur']['zoneId']) && $_SESSION['session_utilisateur']['zoneId'] == $Zone['id']) {
133  $selected = true;
134  $_SESSION['session_caddie']->set_zone($_SESSION['session_utilisateur']['zoneId']);
135  }
136  } elseif (!empty($_SESSION['session_caddie']->zoneId) && $_SESSION['session_caddie']->zoneId == $Zone['id']) {
137  $selected = true;
138  }
139  $zone_options[] = array(
140  'value' => $Zone['id'],
141  'issel' => $selected,
142  'name' => $Zone['nom']
143  );
144  }
145  $tpl->assign('zone_options', $zone_options);
146  $tpl->assign('zone', $_SESSION['session_caddie']->zone);
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) {
152  // Ici on est dans le cas où le calcul des frais de ports est par poids ou par montant total
153  $sqlType = 'SELECT DISTINCT(t.id), t.nom_' . $_SESSION['session_langue'] . '
154  FROM peel_tarifs tf
155  INNER JOIN peel_types t ON t.id = tf.type AND ' . get_filter_site_cond('types', 't') . '
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);
159  }
160  $tpl->assign('shipping_type_error', $form_error_object->text('type'));
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();
166  while ($Type = fetch_assoc($resType)) {
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'])) {
168  continue;
169  }
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']]
174  );
175  }
176  $tpl->assign('shipping_type_options', $type_options);
177  }
178  }
179  }
180 
181  $tpl->assign('is_cart_preservation_module_active', check_if_module_active('cart_preservation'));
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());
185  }
186  $tpl->assign('STR_SAVE_CART', $GLOBALS['STR_SAVE_CART']);
187 
188  if (round($_SESSION['session_caddie']->avoir_user, 2) > round($_SESSION['session_caddie']->avoir, 2))
189  $tpl->assign('STR_SUGGEST', $GLOBALS['STR_SUGGEST']);
190 
191  if(a_priv('reve')) {
192  $treshold_to_use = $GLOBALS['site_parameters']['minimal_amount_to_order_reve'];
193  } else {
194  $treshold_to_use = $GLOBALS['site_parameters']['minimal_amount_to_order'];
195  }
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']);
201  } else {
202  $tpl->assign('is_minimum_error', false);
203  $tpl->assign('STR_ORDER', $GLOBALS['STR_ORDER']);
204  }
205  $tpl->assign('shopping_href', get_url('/achat/'));
206  $tpl->assign('empty_list_href', get_current_url(false) . '?func=vide');
207  $tpl->assign('STR_SHOPPING', $GLOBALS['STR_SHOPPING']);
208  $tpl->assign('STR_EMPTY_LIST', $GLOBALS['STR_EMPTY_LIST']);
209  $tpl->assign('STR_EMPTY_CART', $GLOBALS['STR_EMPTY_CART']);
210  }
211  $output = $tpl->fetch();
212  return $output;
213  }
214 }
215 
216 if (!function_exists('get_order_step1')) {
225  function get_order_step1(&$frm, &$form_error_object, $mode_transport)
226  {
227  $output = '';
228  if (empty($_SESSION['session_caddie']) || $_SESSION['session_caddie']->count_products() == 0) {
229  $output .= $GLOBALS['STR_EMPTY_CADDIE'];
230  } else {
231  $tpl = $GLOBALS['tplEngine']->createTemplate('order_step1.tpl');
232  $tpl->assign('internal_order_enable', vn($GLOBALS['site_parameters']['internal_order_enable']));
233  $tpl->assign('error_cvg', $form_error_object->text('cgv'));
234  $tpl->assign('action', get_current_url(false));
235  $tpl->assign('societe1', $frm['societe1']);
236  $tpl->assign('nom1_error', $form_error_object->text('nom1'));
237  $tpl->assign('nom1', $frm['nom1']);
238  $tpl->assign('prenom1_error', $form_error_object->text('prenom1'));
239  $tpl->assign('prenom1', $frm['prenom1']);
240  $tpl->assign('email1_error', $form_error_object->text('email1'));
241  $tpl->assign('email1', $frm['email1']);
242  $tpl->assign('contact1_error', $form_error_object->text('contact1'));
243  $tpl->assign('contact1', $frm['contact1']);
244  $tpl->assign('adresse1_error', $form_error_object->text('adresse1'));
245  $tpl->assign('adresse1', $frm['adresse1']);
246  $tpl->assign('code_postal1_error', $form_error_object->text('code_postal1'));
247  $tpl->assign('code_postal1', $frm['code_postal1']);
248  $tpl->assign('ville1_error', $form_error_object->text('ville1'));
249  $tpl->assign('ville1', $frm['ville1']);
250  $tpl->assign('pays1_error', $form_error_object->text('pays1'));
251  $tpl->assign('pays1_options', get_country_select_options($frm['pays1'], null));
252  $tpl->assign('STR_STEP1', $GLOBALS['STR_STEP1']);
253  $tpl->assign('STR_BEFORE_TWO_POINTS', $GLOBALS['STR_BEFORE_TWO_POINTS']);
254  $tpl->assign('STR_INVOICE_ADDRESS', $GLOBALS['STR_INVOICE_ADDRESS']);
255  $tpl->assign('STR_SOCIETE', $GLOBALS['STR_SOCIETE']);
256  $tpl->assign('STR_NAME', $GLOBALS['STR_NAME']);
257  $tpl->assign('STR_FIRST_NAME', $GLOBALS['STR_FIRST_NAME']);
258  $tpl->assign('STR_EMAIL', $GLOBALS['STR_EMAIL']);
259  $tpl->assign('STR_TELEPHONE', $GLOBALS['STR_TELEPHONE']);
260  $tpl->assign('STR_ADDRESS', $GLOBALS['STR_ADDRESS']);
261  $tpl->assign('STR_ZIP', $GLOBALS['STR_ZIP']);
262  $tpl->assign('STR_TOWN', $GLOBALS['STR_TOWN']);
263  $tpl->assign('STR_COUNTRY', $GLOBALS['STR_COUNTRY']);
264  $tpl->assign('STR_CHOOSE', $GLOBALS['STR_CHOOSE']);
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']));
268  $tpl->assign('get_bill_user_address', get_personal_address_form(vn($_SESSION['session_utilisateur']['id_utilisateur']), 'bill'));
269  $tpl->assign('get_ship_user_address', get_personal_address_form(vn($_SESSION['session_utilisateur']['id_utilisateur']), 'ship'));
270  }
271  if (!empty($mode_transport) && is_delivery_address_necessary_for_delivery_type(vn($_SESSION['session_caddie']->typeId)) && (!check_if_module_active('socolissimo') || empty($_SESSION['session_commande']['is_socolissimo_order']))) {
272  $tpl->assign('is_mode_transport', true);
273  $tpl->assign('STR_SHIP_ADDRESS', $GLOBALS['STR_SHIP_ADDRESS']);
274  if(check_if_module_active('icirelais') && !empty($_SESSION['session_commande']['is_icirelais_order'])) {
275  $tpl->assign('text_temp_address', $GLOBALS["STR_MODULE_ICIRELAIS_TEMP_ADDRESS"]);
276  }
277  $tpl->assign('societe2', $frm['societe2']);
278  $tpl->assign('nom2_error', $form_error_object->text('nom2'));
279  $tpl->assign('nom2', $frm['nom2']);
280  $tpl->assign('prenom2_error', $form_error_object->text('prenom2'));
281  $tpl->assign('prenom2', $frm['prenom2']);
282  $tpl->assign('email2_error', $form_error_object->text('email2'));
283  $tpl->assign('email2', $frm['email2']);
284  $tpl->assign('contact2_error', $form_error_object->text('contact2'));
285  $tpl->assign('contact2', $frm['contact2']);
286  $tpl->assign('adresse2_error', $form_error_object->text('adresse2'));
287  $tpl->assign('adresse2', $frm['adresse2']);
288  $tpl->assign('code_postal2_error', $form_error_object->text('code_postal2'));
289  $tpl->assign('code_postal2', $frm['code_postal2']);
290  $tpl->assign('ville2_error', $form_error_object->text('ville2'));
291  $tpl->assign('ville2', $frm['ville2']);
292  $tpl->assign('pays2_error', $form_error_object->text('pays2'));
293  $tpl->assign('pays2_options', get_country_select_options($frm['pays2'], null, 'name', false, $_SESSION['session_caddie']->zoneId));
294  }else {
295  $tpl->assign('is_mode_transport', false);
296  }
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']);
301  }
302  $tpl->assign('payment_error', $form_error_object->text('payment_technical_code'));
303  $tpl->assign('payment_select', get_payment_select($_SESSION['session_caddie']->payment_technical_code));
304  $tpl->assign('STR_PAYMENT', $GLOBALS['STR_PAYMENT']);
305  } else {
306  $tpl->assign('is_payment_cgv', false);
307  }
308  $tpl->assign('specific_fields', get_specific_field_infos($frm, $form_error_object, "order"));
309  $tpl->assign('STR_CGV_OK', $GLOBALS['STR_CGV_OK']);
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']);
315  $tpl->assign('STR_COMMENTS', $GLOBALS['STR_COMMENTS']);
316  $tpl->assign('STR_ETAPE_SUIVANTE', $GLOBALS['STR_ETAPE_SUIVANTE']);
317  $output .= $tpl->fetch();
318  }
319  return $output;
320  }
321 }
322 
323 if (!function_exists('get_order_step2')) {
331  function get_order_step2(&$frm, $mode_transport)
332  {
333  $output = '';
334  if ($_SESSION['session_caddie']->count_products() == 0) {
335  $output .= $GLOBALS['STR_EMPTY_CADDIE'];
336  } else {
337  $is_delivery_address_necessary_for_delivery_type = is_delivery_address_necessary_for_delivery_type(vn($_SESSION['session_caddie']->typeId));
338  $tpl = $GLOBALS['tplEngine']->createTemplate('order_step2.tpl');
339  $tpl->assign('STR_BEFORE_TWO_POINTS', $GLOBALS['STR_BEFORE_TWO_POINTS']);
340  $tpl->assign('STR_STEP2', $GLOBALS['STR_STEP2']);
341  $tpl->assign('STR_DATE', $GLOBALS['STR_DATE']);
342  $tpl->assign('STR_INVOICE_ADDRESS', $GLOBALS['STR_INVOICE_ADDRESS']);
343  $tpl->assign('STR_SOCIETE', $GLOBALS['STR_SOCIETE']);
344  $tpl->assign('STR_CUSTOMER', $GLOBALS['STR_CUSTOMER']);
345  $tpl->assign('STR_TELEPHONE', $GLOBALS['STR_TELEPHONE']);
346  $tpl->assign('STR_EMAIL', $GLOBALS['STR_EMAIL']);
347  $tpl->assign('STR_ADDRESS', $GLOBALS['STR_ADDRESS']);
348  $tpl->assign('STR_ZIP', $GLOBALS['STR_ZIP']);
349  $tpl->assign('STR_TOWN', $GLOBALS['STR_TOWN']);
350  $tpl->assign('STR_COUNTRY', $GLOBALS['STR_COUNTRY']);
351  $tpl->assign('date', get_formatted_date(time()));
352  $tpl->assign('societe1', $frm['societe1']);
353  $tpl->assign('nom1', $frm['nom1']);
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']) != '') {
362  $tpl->assign('STR_COMMENTS', $GLOBALS['STR_COMMENTS']);
363  $tpl->assign('commentaires', $frm['commentaires']);
364  }
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']);
368  $tpl->assign('STR_PAYMENT', $GLOBALS['STR_PAYMENT']);
369  $tpl->assign('STR_DELIVERY', $GLOBALS['STR_DELIVERY']);
370  $tpl->assign('is_mode_transport', true);
371  $tpl->assign('payment', get_payment_name($_SESSION['session_caddie']->payment_technical_code));
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']));
377  }
378  if($is_delivery_address_necessary_for_delivery_type) {
379  $tpl->assign('societe2', $frm['societe2']);
380  $tpl->assign('nom2', $frm['nom2']);
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']);
388  }
389  } else {
390  $tpl->assign('is_mode_transport', false);
391  }
392  $tpl->assign('action', get_url('/achat/fin_commande.php'));
393  $tpl->assign('specific_fields', get_specific_field_infos($frm, null, "order"));
394 
395  if (check_if_module_active('icirelais') && !empty($_SESSION['session_commande']['is_icirelais_order'])) {
396  $tpl->assign('icirelais_id_delivery_points_radio_inputs', get_icirelais_id_delivery_points_radio_inputs($is_delivery_address_necessary_for_delivery_type));
397  }
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'))) {
399  try {
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) {
402  // var_dump($ex->faultcode, $ex->faultstring, $ex->detail);
403  echo $GLOBALS['tplEngine']->createTemplate('global_error.tpl', array('message' => $GLOBALS['STR_MODULE_TNT_ERREUR_WEBSERVICE'] . $GLOBALS['STR_BEFORE_TWO_POINTS'] . ': '.$ex->faultstring))->fetch();
404  }
405  }
406  $tpl->assign('caddie_products_summary_table', get_caddie_products_summary_table(false, true, $mode_transport, null));
407  $tpl->assign('STR_ORDER', $GLOBALS['STR_ORDER']);
408  $tpl->assign('STR_BACK_TO_CADDIE_TXT', $GLOBALS['STR_BACK_TO_CADDIE_TXT']);
409  $output .= $tpl->fetch();
410  }
411  return $output;
412  }
413 }
414 
415 if (!function_exists('get_order_step3')) {
422  function get_order_step3($commandeid)
423  {
424  $tpl = $GLOBALS['tplEngine']->createTemplate('order_step3.tpl');
425  $tpl->assign('payment_form', get_payment_form($commandeid, null, true));
426  $tpl->assign('resume_commande', affiche_resume_commande($commandeid, false, true));
427  $tpl->assign('conversion_page', affiche_contenu_html("conversion_page", true));
428  $tpl->assign('STR_STEP3', $GLOBALS['STR_STEP3']);
429  $tpl->assign('STR_MSG_THANKS', $GLOBALS["STR_MSG_THANKS"]);
430  return $tpl->fetch();
431  }
432 }
433 
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)
445  {
446  if(!empty($_SESSION['session_last_bill_viewed']) && $id == $_SESSION['session_last_bill_viewed']){
447  // L'utilisateur a payé une commande sans s'être connecté à son compte. On l'autorise à voir le résumé de sa commande
448  $where = 'c.id = "' . intval($_SESSION['session_last_bill_viewed']) . '"';
449  } else {
450  // Cas normal d'un utilisateur connecté à son compte
451  // OU si un utilisateur non loggué vient voir cette page sans avoir $_SESSION['session_last_bill_viewed'] correct : par exemple moteur Google Adsense qui vient pour afficher les publicités => il n'y aura rien de trouvé => page sans infos de commandes => normal
452  $where = 'c.id = "' . intval($id) . '"';
453  }
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'])) . '"';
456  }
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') . '
461  WHERE ' . get_filter_site_cond('commandes', 'c') . ' AND ' . $where);
462  $commande = fetch_object($qid_commande);
463  $output = '';
464  if (!empty($commande)) {
465  $order_infos = get_order_infos_array($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']);
471  $tpl->assign('STR_DATE', $GLOBALS['STR_DATE']);
472  $tpl->assign('STR_AMOUNT', $GLOBALS['STR_AMOUNT']);
473  $tpl->assign('STR_TTC', $GLOBALS['STR_TTC']);
474  $tpl->assign('STR_INVOICE_ADDRESS', $GLOBALS['STR_INVOICE_ADDRESS']);
475  $tpl->assign('STR_PAYMENT', $GLOBALS['STR_PAYMENT']);
476  $tpl->assign('id', $commande->order_id);
477  $tpl->assign('date', get_formatted_date($commande->o_timestamp, 'short', 'long'));
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);
485  }
486  $tpl->assign('payment', get_payment_name($commande->paiement));
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);
491  if(check_if_module_active('icirelais')){
492  $tpl->assign('icirelais', array(
493  'src' => get_url('/modules/icirelais/js/icirelais.js'),
494  'value' => vb($commande->delivery_tracking)
495  ));
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']);
501  }
502  } else {
503  $tpl->assign('is_delivery_tracking', false);
504  }
505 
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)) {
509  // Récupération des informations sur le type de transport sélectionné.
510  $sql = 'SELECT *
511  FROM peel_types
512  WHERE ' . get_filter_site_cond('types') . ' AND nom_' . $commande->lang . ' = "'. nohtml_real_escape_string($commande->type).'"';
513  $q = query($sql);
514  if ($this_type = fetch_assoc($q)) {
515  if ($this_type['is_tnt'] == 0) {
516  die($GLOBALS['STR_MODULE_TNT_NOT_ASSOCIATED_ORDER']);
517  }
518  }
519  }
520  // Determine le type de livraison (DROPOFFPOINT,ENTERPRISE,INDIVIDUAL), et le code de service TNT associé(J,JD,JZ)
521  if(!empty($_POST['relais_tnt']) && $this_type['tnt_threshold'] == 0) {
522  // le relais colis est transmis en paramètre, et le type de livraison correspond à une livraison en relais colis
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];// code XETT du relai de colis
527  $receiver_info['type'] = 'DROPOFFPOINT';
528  } else {
529  $order_infos['code_postal2'] = $_SESSION['session_commande']['code_postal2'];
530  $order_infos['ville2'] = $_SESSION['session_commande']['ville2'];
531  }
532 
533  if(!empty($commande->xETTCode) && $this_type['tnt_threshold'] == 0) {
534  // le code xETTCode est renseigné pour la commande, et le type de livraison correspond à une livraison en relais colis
535  $receiver_info['type_id'] = $commande->xETTCode; // code XETT du relai de colis
536  $receiver_info['type'] = 'DROPOFFPOINT';
537  } elseif(!empty($_SESSION['session_commande']['societe2'])) {
538  // Ce n'est pas une commande à livrer en point relais, et un nom d'entreprise est renseigné dans l'adresse de livraison => Livraison en entreprise (code J).
539  $receiver_info['type'] = 'ENTERPRISE';
540  } else {
541  // Autres cas : livraison à chez le particulier
542  $receiver_info['type'] = 'INDIVIDUAL';
543  }
544  try {
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 );
549  }
550 
551  $tpl->assign('tnt_message', $tnt_message);
552  }
553 
554  if ($affiche_statut === 1 || $affiche_statut === true) {
555  $tpl->assign('is_payment_delivery_status', true);
556  $tpl->assign('order_statut_paiement_name', get_payment_status_name($commande->id_statut_paiement));
557  $tpl->assign('STR_ORDER_STATUT_PAIEMENT', $GLOBALS['STR_ORDER_STATUT_PAIEMENT']);
558  $tpl->assign('STR_ORDER_STATUT_LIVRAISON', $GLOBALS['STR_ORDER_STATUT_LIVRAISON']);
559  $tpl->assign('order_statut_livraison_name', get_delivery_status_name($commande->id_statut_livraison));
560  if (!empty($commande->numero)) {
561  // Si le numéro de facture a été créé (ce moment est paramétrable dans la page de configuration du site), alors on transmet l'information sur la facture
562  $tpl->assign('STR_INVOICE', $GLOBALS['STR_INVOICE']);
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',
567  ));
568  }
569  } else {
570  $tpl->assign('is_payment_delivery_status', false);
571  }
572  if (check_if_module_active('payback')){
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', '');
576  } else {
577  $tpl->assign('return_this_product_txt', $GLOBALS['STR_MODULE_PAYBACK_RETURN_THIS_PRODUCT']);
578  }
579  }
580  $tpl->assign('is_conditionnement_module_active', check_if_module_active('conditionnement'));
581  if ($commande->statut_paiement == 'completed' && check_if_module_active('download')) {
582  $tpl->assign('downloadable_file_link_array', get_downloadable_file_link(array('order_id' => $id)));
583  }
584  $products_data = array();
585  $product_infos_array = get_product_infos_array_in_order($id, $commande->devise, $commande->currency_rate);
586  foreach ($product_infos_array as $this_ordered_product) {
587  if (check_if_module_active('attributs')) {
588  $this_ordered_product["product_text"] = display_option_image($this_ordered_product["product_text"], true);
589  }
590  if(check_if_module_active('conditionnement')) {
591  // Les produits sont conditionnés sous forme de lot
592  if(!empty($this_ordered_product['conditionnement'])){
593  $qte_total = intval($this_ordered_product['quantite']) * $this_ordered_product['conditionnement'];
594  } else {
595  $qte_total = $this_ordered_product['quantite'];
596  }
597  }
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'],
619  );
620  }
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;
628  $tpl->assign('validate_payment_tag_html', template_tags_replace($GLOBALS['site_parameters']['validate_payment_tag_html'], $template_tags));
629  }
630  $tpl->assign('products_data', $products_data);
631  if($show_payment_form) {
632  $tpl->assign('payment_form', get_payment_form($id), $commande->paiement);
633  }
634  $tpl->assign('STR_LIST_PRODUCT', $GLOBALS['STR_LIST_PRODUCT']);
635  $tpl->assign('STR_REFERENCE', $GLOBALS['STR_REFERENCE']);
636  $tpl->assign('STR_PRODUCT', $GLOBALS['STR_PRODUCT']);
637  $tpl->assign('STR_SOLD_PRICE', $GLOBALS['STR_SOLD_PRICE']);
638  $tpl->assign('STR_QUANTITY', $GLOBALS['STR_QUANTITY']);
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']);
642  $output .= $tpl->fetch();
643  }
644  return $output;
645  }
646 }
647 
648 if (!function_exists('affiche_liste_commandes')) {
656  function affiche_liste_commandes($order = "id" , $sort = "DESC")
657  {
658  $nb = 30;
659  $output = '';
660  // Charge la liste des commandes avec un numéro de commande et les affiche.
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') . "
666  ORDER BY " . nohtml_real_escape_string($order) . " " . word_real_escape_string($sort) . "";
667  $tpl = $GLOBALS['tplEngine']->createTemplate('liste_commandes.tpl');
668  $Links = new Multipage($sql, 'commandes_history');
669  $results_array = $Links->Query();
670  if (empty($results_array)) {
671  $tpl->assign('STR_NO_ORDER', $GLOBALS['STR_NO_ORDER']);
672  } else {
673  $tpl->assign('STR_TABLE_SUMMARY_ORDERS', $GLOBALS['STR_TABLE_SUMMARY_ORDERS']);
674  $tpl->assign('STR_ORDER_NUMBER', $GLOBALS['STR_ORDER_NUMBER']);
675  $tpl->assign('STR_DATE', $GLOBALS['STR_DATE']);
676  $tpl->assign('STR_ORDER_STATUT_PAIEMENT', $GLOBALS['STR_ORDER_STATUT_PAIEMENT']);
677  $tpl->assign('STR_ORDER_STATUT_LIVRAISON', $GLOBALS['STR_ORDER_STATUT_LIVRAISON']);
678  $tpl->assign('display_prices_with_taxes_active', display_prices_with_taxes_active());
679  $tpl->assign('STR_AMOUNT', $GLOBALS['STR_AMOUNT']);
680  $tpl->assign('STR_HT', $GLOBALS['STR_HT']);
681  $tpl->assign('STR_TTC', $GLOBALS['STR_TTC']);
682 
683  $tpl->assign('STR_PDF_BILL', $GLOBALS['STR_PDF_BILL']);
684  $orders = array();
685  foreach ($results_array as $order) {
686  // Si le numéro de facture a été créé (ce moment est paramétrable dans la page de configuration du site), alors on transmet l'information sur la facture
687  $orders[] = array(
688  'href' => get_current_url(false) . '?mode=details&id=' . $order['id'] . '&timestamp=' . 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'],
695  'date' => get_formatted_date($order['o_timestamp']),
696  'payment_status_name' => get_payment_status_name($order['id_statut_paiement']),
697  'delivery_status_name' => get_delivery_status_name($order['id_statut_livraison']),
698  'prix' => fprix((display_prices_with_taxes_active()?$order['montant']:$order['montant_ht']) , true, $order['devise'], true, $order['currency_rate']),
699  'paid' => in_array($order['statut_paiement'], array('being_checked', 'completed'))
700  );
701  }
702  $tpl->assign('orders', $orders);
703  $tpl->assign('multipage', $Links->GetMultipage());
704  }
705  $tpl->assign('STR_ORDER_HISTORY', $GLOBALS['STR_ORDER_HISTORY']);
706  $output .= $tpl->fetch();
707  return $output;
708  }
709 }
710 
711 if (!function_exists('affichage_fin_cb')) {
719  function affichage_fin_cb($order_id, $payment_validated, $message = '')
720  {
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));
728  }else{
729  $tpl->assign('payment_msg', $GLOBALS['STR_PAYMENT_FAILED']);
730  $tpl->assign('bottom_msg', $GLOBALS['STR_ORDER_RENEW_INVITE']);
731  }
732  $tpl->assign('STR_ORDER_STATUT', $GLOBALS['STR_ORDER_STATUT']);
733 
734  echo $tpl->fetch();
735  }
736 }
737 
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)
749  {
750  $output = '';
751  if (empty($shipping_text)) {
752  $shipping_text = $GLOBALS['STR_SHIPPING_COST'];
753  }
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'];
760  } else {
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'];
766  }
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']);
772  }
773  $tpl->assign('with_form_fields', $with_form_fields);
774  $tpl->assign('is_conditionnement_module_active', check_if_module_active('conditionnement'));
775  $tpl->assign('is_attributes_module_active', check_if_module_active('attributs'));
776  if($_SESSION['session_caddie']->tarif_paiement>0) {
777  $tpl->assign('tarif_paiement', fprix($_SESSION['session_caddie']->tarif_paiement, true));
778  }
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']);
784  $tpl->assign('STR_PRODUCT', $GLOBALS['STR_PRODUCT']);
785  $tpl->assign('STR_UNIT_PRICE', $GLOBALS['STR_UNIT_PRICE']);
786  $tpl->assign('STR_OPTION_PRICE', $GLOBALS['STR_OPTION_PRICE']);
787  $tpl->assign('STR_QUANTITY', $GLOBALS['STR_QUANTITY']);
788  $tpl->assign('STR_REMISE', $GLOBALS['STR_REMISE']);
789  $tpl->assign('STR_TOTAL_PRICE', $GLOBALS['STR_TOTAL_PRICE']);
790  $tpl->assign('STR_DELETE_PROD_CART', $GLOBALS['STR_DELETE_PROD_CART']);
791  $tpl->assign('STR_FOR_GIFT', $GLOBALS['STR_FOR_GIFT']);
792  $tpl->assign('STR_DELIVERY_STOCK', $GLOBALS['STR_DELIVERY_STOCK']);
793  $tpl->assign('STR_COLOR', $GLOBALS['STR_COLOR']);
794  $tpl->assign('STR_SIZE', $GLOBALS['STR_SIZE']);
795  $tpl->assign('STR_EMAIL_FRIEND', $GLOBALS['STR_EMAIL_FRIEND']);
796  $tpl->assign('STR_HOLIDAY_AVAILABLE_CADDIE', $GLOBALS['STR_HOLIDAY_AVAILABLE_CADDIE']);
797  $tpl->assign('STR_DAYS', $GLOBALS['STR_DAYS']);
798  $tpl->assign('STR_ECOTAXE', $GLOBALS['STR_ECOTAXE']);
799  $tpl->assign('STR_INCLUDED', $GLOBALS['STR_INCLUDED']);
800  $tpl->assign('STR_REFERENCE', $GLOBALS['STR_REFERENCE']);
801 
802  $products = array();
803  foreach ($_SESSION['session_caddie']->articles as $numero_ligne => $product_id) {
804  $product_object = new Product($product_id, null, false, null, true, !is_user_tva_intracom_for_no_vat() && !check_if_module_active('micro_entreprise'));
805  $product_object->set_configuration(vb($_SESSION['session_caddie']->couleurId[$numero_ligne]), vb($_SESSION['session_caddie']->tailleId[$numero_ligne]), vn($_SESSION['session_caddie']->id_attribut[$numero_ligne]), check_if_module_active('reseller') && is_reseller());
806  if (!empty($product_object->id)) {
807  // Récupération des variables du caddie
808  $couleur = vb($_SESSION['session_caddie']->couleurId[$numero_ligne]);
809  $taille = vb($_SESSION['session_caddie']->tailleId[$numero_ligne]);
810  if (check_if_module_active('listecadeau')) {
811  $listcadeaux_owner = vn($_SESSION['session_caddie']->giftlist_owners[$numero_ligne]);
812  }
813  $quantite = vn($_SESSION['session_caddie']->quantite[$numero_ligne]);
814  if (check_if_module_active('stock_advanced') && $product_object->on_stock == 1) {
815  $stock_commandable = get_stock_commandable($product_object, $quantite);
816  }
817  $prix = vn($_SESSION['session_caddie']->prix[$numero_ligne]);
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]);
830  if (check_if_module_active('stock_advanced')) {
831  $etat_stock = vn($_SESSION['session_caddie']->etat_stock[$numero_ligne]);
832  $delivery_stock = vb($_SESSION['session_caddie']->delai_stock[$numero_ligne]);
833  }
834  $email_check = vb($_SESSION['session_caddie']->email_check[$numero_ligne]);
835  if (check_if_module_active('ecotaxe')) {
836  $ecotaxe = vb($_SESSION['session_caddie']->ecotaxe_ttc[$numero_ligne]);
837  }
838  // $total_attribut = vn($_SESSION['session_caddie']->total_prix_attribut[$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]);
841 
843  $option = vn($_SESSION['session_caddie']->option[$numero_ligne]);
844  $remise_displayed = $remise;
845  // $total_attribut_displayed = $total_attribut;
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;
849  } else {
850  $option = vn($_SESSION['session_caddie']->option_ht[$numero_ligne]);
851  $remise_displayed = $remise_ht;
852  // $total_attribut_displayed = $total_attribut / (1 + $product_object->tva / 100);
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;
856  }
857  if (check_if_module_active('attributs') && !empty($product_object->configuration_attributs_description)) {
858  $product_object->configuration_attributs_description = display_option_image($product_object->configuration_attributs_description, true);
859  }
860  $tmpProd = array(
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,
864  'id' => $product_id,
865  'listcadeaux_owner' => vb($listcadeaux_owner),
866  'option' => $option,
867  'id_attribut' => vb($_SESSION['session_caddie']->id_attribut[$numero_ligne]),
868  'name' => $product_object->name,
869  'reference' => $product_object->reference,
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),
873  'conditionnement' => $product_object->conditionnement,
874  'conditionnement_qty' => $product_object->conditionnement * $quantite,
875  'on_download' => $product_object->on_download
876 
877  );
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');
882  }
883  if (!empty($listcadeaux_owner) && check_if_module_active('listecadeau')) {
884  $tmpProd['listcadeaux_owner_name'] = getUsername($listcadeaux_owner);
885  }
886  if (check_if_module_active('stock_advanced') && !empty($delivery_stock)) {
887  $tmpProd['delivery_stock'] = get_formatted_duration((intval($delivery_stock) * 24 * 3600), false, 'month');
888  }
889  if (!empty($_SESSION['session_caddie']->couleurId[$numero_ligne])) {
890  $tmpProd['color'] = array(
891  'name' => get_color_name($couleur),
892  'id' => intval($_SESSION['session_caddie']->couleurId[$numero_ligne])
893  );
894  }
895  if (!empty($_SESSION['session_caddie']->tailleId[$numero_ligne])) {
896  $tmpProd['size'] = array(
897  'name' => get_size_name($taille),
898  'id' => intval($_SESSION['session_caddie']->tailleId[$numero_ligne])
899  );
900  }
901  if (check_if_module_active('vacances') && get_vacances_type() == 2) {
902  //on récupère le fournisseur pour afficher sa date de retour
903  $supplier_back = query("SELECT on_vacances, on_vacances_date
904  FROM peel_utilisateurs
905  WHERE id_utilisateur = " . $product_object->id_utilisateur . " AND " . get_filter_site_cond('utilisateurs') . "");
906  $res_supplier_back = fetch_assoc($supplier_back);
907  $nbjours = get_vacances_jours($product_object->id_utilisateur);
908  if ($nbjours) {
909  $tmpProd['vacances'] = array(
910  'nbjours' => $nbjours,
911  'date' => get_formatted_date($res_supplier_back['on_vacances_date'])
912  );
913  }
914  }
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);
917  }
918  if (check_if_module_active('ecotaxe') && !empty($ecotaxe)) {
919  $tmpProd['prix_ecotaxe'] = fprix($ecotaxe, true);
920  }
921  if ($option != 0) {
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);
925  }
926  if ($with_form_fields) {
927  $tmpProd['quantite'] = array(
928  'value' => $quantite,
929  );
930  // On prépare le message à afficher en javascript si la quantité demandée est trop élevée par rapport au stock disponible
931  if (check_if_module_active('stock_advanced') && $product_object->on_stock == 1 && empty($GLOBALS['site_parameters']['allow_add_product_with_no_stock_in_cart'])) {
932  $additionnal_quantity_possible = $stock_commandable - $quantite;
933  $this_prepared_javascript_message = $GLOBALS['STR_QUANTITY_INSUFFICIENT'] . ' ';
934  if ($additionnal_quantity_possible == 0) {
935  // Aucun produit ajouté au caddie
936  $this_prepared_javascript_message .= $GLOBALS['STR_ZERO_PRODUCT_ADD'];
937  } elseif ($additionnal_quantity_possible == 1) {
938  // un seul produit ajouté
939  $this_prepared_javascript_message .= $additionnal_quantity_possible . ' ' . $GLOBALS['STR_QUANTITY_PRODUCT_ADD'];
940  } else {
941  // plus de un produit ajoutés au caddie
942  $this_prepared_javascript_message .= $additionnal_quantity_possible . ' ' . $GLOBALS['STR_QUANTITY_PRODUCTS_ADD'];
943  }
944  $tmpProd['quantite']['message'] = $this_prepared_javascript_message;
945  $tmpProd['quantite']['stock_commandable'] = $stock_commandable;
946  }
947  $tmpProd['quantite']['hidden_fields'] = ($product_object->on_download == 1);
948  } else {
949  $tmpProd['quantite'] = $quantite;
950  }
951  if(check_if_module_active('conditionnement')) {
952  if(!empty($product_object->conditionnement)){
953  $tmpProd['conditionnement_qty'] = intval($quantite) * intval($product_object->conditionnement);
954  }else{
955  $tmpProd['conditionnement_qty'] = intval($quantite);
956  }
957  $tmpProd['conditionnement'] = (!empty($product_object->conditionnement)?$product_object->conditionnement:'-');
958  }
959  if($remise_displayed > 0) {
960  $tmpProd['remise'] = fprix($remise_displayed, true);
961  }
962  $tmpProd['total_prix'] = fprix($total_prix_displayed, true);
963  $products[] = $tmpProd;
964  }
965  unset($product_object);
966  }
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']);
972  $tpl->assign('STR_OFFERED', $GLOBALS['STR_OFFERED']);
973  $tpl->assign('STR_FROM', $GLOBALS['STR_FROM']);
974  $tpl->assign('STR_TTC', $GLOBALS['STR_TTC']);
975  $tpl->assign('STR_TOTAL_HT', $GLOBALS['STR_TOTAL_HT']);
976  $tpl->assign('STR_VAT', $GLOBALS['STR_VAT']);
977  $tpl->assign('STR_NO_VAT_APPLIABLE', $GLOBALS['STR_NO_VAT_APPLIABLE']);
978  $tpl->assign('STR_AVOIR', $GLOBALS['STR_AVOIR']);
979  $tpl->assign('net_txt', $GLOBALS['STR_NET']);
980  $tpl->assign('STR_ORDER_POINT', $GLOBALS['STR_ORDER_POINT']);
981  $tpl->assign('STR_GIFT_POINTS', $GLOBALS['STR_GIFT_POINTS']);
982 
983  if ($with_totals_summary) {
984  if (check_if_module_active('ecotaxe') && !empty($_SESSION['session_caddie']->total_ecotaxe_ttc)) {
985  $tpl->assign('total_ecotaxe', fprix($total_ecotaxe_displayed, true));
986  }
987  // - Si la session client contient une remise > 0
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)),
994  'cat_name' => (!empty($_SESSION['session_caddie']->code_infos['id_categorie']) ? get_category_name($_SESSION['session_caddie']->code_infos['id_categorie']) : false)
995  ));
996  }
997  }
998  if(a_priv('reve')) {
999  $treshold_to_use = $GLOBALS['site_parameters']['minimal_amount_to_order_reve'];
1000  } else {
1001  $treshold_to_use = $GLOBALS['site_parameters']['minimal_amount_to_order'];
1002  }
1003  // Attention : un test !empty ne marche pas sur $GLOBALS['site_parameters']['small_order_overcost_limit'] car au format "0.00"
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)
1008  ));
1009  }
1010  if ($mode_transport != 0) {
1011  $tpl->assign('transport', array(
1012  'prix' => fprix($cout_transport_displayed, true),
1013  'shipping_text' => $shipping_text
1014  ));
1015  }
1016  // if ($_SESSION['session_caddie']->total > 0) {
1017  if (!check_if_module_active('micro_entreprise')) {
1018  $tpl->assign('micro', array(
1019  'prix_th' => fprix($_SESSION['session_caddie']->total_ht, true),
1020  'prix_tva' => fprix($_SESSION['session_caddie']->total_tva, true)
1021  ));
1022  }
1023  if (!empty($_SESSION['session_caddie']->avoir)) {
1024  $tpl->assign('prix_avoir', fprix($_SESSION['session_caddie']->avoir, true));
1025  }
1026  $tpl->assign('prix_total', fprix($_SESSION['session_caddie']->total, true));
1027  $tpl->assign('total_points', $_SESSION['session_caddie']->total_points);
1028  }
1029  $output .= $tpl->fetch();
1030  return $output;
1031  }
1032 }
1033 
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'])) {
1041  return false;
1042  }
1043  $output = '
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++) {
1048  $output .= '
1049  <tr>
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>
1053  </tr>';
1054  }
1055  $output .= '
1056  <tr><td></td><td colspan="2"><input class="btn btn-primary" type="submit" value="'.$GLOBALS['STR_ADD_CART'].'" /></td></tr>
1057  </table>
1058  </form>';
1059 
1060  return $output;
1061  }
1062 }
get_payment_status_name($id)
get_payment_status_name()
Definition: order.php:1065
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.
Definition: user.php:1116
get_current_url($with_get=true, $get_short_url=false, $take_away_get_args_array=null)
get_current_url()
Definition: fonctions.php:1743
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()
Definition: order.php:1469
is_user_tva_intracom_for_no_vat($user_id=null)
is_user_tva_intracom_for_no_vat()
Definition: user.php:959
get_delivery_status_name($id)
get_delivery_status_name()
Definition: order.php:1088
$qid_commande
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...
Definition: database.php:424
get_color_name($color_id)
Renvoie le nom d'une couleur.
Definition: fonctions.php:1914
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 ...
Definition: database.php:400
$results_array
get_category_name($id)
Renvoie le nom d'une catégorie de produits.
Definition: fonctions.php:912
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
get_formatted_duration($total_seconds, $show_seconds=false, $display_mode= 'day')
Affiche une durée en jours / heures / minutes / secondes.
Definition: format.php:533
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...
Definition: fonctions.php:33
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...
Definition: fonctions.php:5150
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.
Definition: fonctions.php:4643
if(!defined('IN_PEEL')) display_prices_with_taxes_active()
display_prices_with_taxes_active()
Definition: fonctions.php:23
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.
Definition: database.php:158
if(!defined('IN_PEEL')) est_identifie()
Retourne true si l'utilisateur est identifié
Definition: user.php:23
vb(&$var, $default=null)
Variable blanche if $var n'est pas défini, retourne $default, sinon retourne $var.
Definition: format.php:97
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()
Definition: fonctions.php:1005
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))
Definition: chart-data.php:160
num_rows($query_result)
num_rows()
Definition: database.php:321
display_option_image($str_image, $set=false)
Formatte l'attribut (de type upload) du produit.
Definition: fonctions.php:449
fetch_object($query_result)
fetch_object()
Definition: database.php:302
fetch_assoc($query_result)
fetch_assoc()
Definition: database.php:283
get_formatted_date($datetime_or_timestamp=null, $mode= 'short', $hour_minute=false)
Afficher une date formatée, en évitant les problèmes liés aux noms de mois sur les serveurs qui ne so...
Definition: format.php:440
get_payment_form($order_id, $forced_type=null, $send_admin_email=false, $amount_to_pay=0, $allow_autosend=true)
Renvoie le formulaire de paiement.
Definition: order.php:1534
is_delivery_address_necessary_for_delivery_type($selected_delivery_type_id=null)
is_delivery_address_necessary_for_delivery_type()
Definition: fonctions.php:1140
$GLOBALS['page_columns_count']
get_site_wwwroot($site_id, $lang=null)
Renvoie l'URL d'un site donné
Definition: fonctions.php:4873
vn(&$var, $default=0)
Variable nulle if $var n'est pas défini, retourne $default, sinon retourne $var.
Definition: format.php:110
getUsername($user_id)
getUsername()
Definition: user.php:890
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 ...
Definition: user.php:63
get_order_infos_array($order_object)
get_order_infos_array()
Definition: order.php:1320
$id
Definition: articles.php:22
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...
Definition: fonctions.php:242
$commandeid
get_payment_name($id_or_code)
get_payment_name()
Definition: order.php:1046
get_payment_select($selected_payment_technical_code=null, $show_selected_even_if_not_available=false, $show_site_info_if_needed=false)
get_payment_select()
Definition: fonctions.php:1187
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...
template_tags_replace($text, $custom_template_tags=array(), $replace_only_custom_tags=false, $format=null, $lang=null, $avoid_load_urls=false)
Remplace les tags d'un texte au format [TAG] par les valeurs correspondantes.
Definition: format.php:599
get_size_name($size_id)
Renvoie le nom d'une taille.
Definition: fonctions.php:1892
if(defined('IN_PEEL_ADMIN')||IN_INSTALLATION) $_SESSION['session_langue']

This documentation for Open ecommerce PEEL Shopping and PEEL.fr has been generated by Doxygen on Thu Oct 15 2015 14:30:20 - Peel ecommerce is a product of Agence web Advisto SAS. All rights reserved.