[Skip to main content](#vessel-content)

#   réglé recupérer le montant total des anciennes cde

##

- **[toffffe](/forum/user/4564-toffffe "View toffffe's Profile")**
- [![toffffe's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/4564-toffffe "View toffffe's Profile") Topic Author
- [ Offline](/forum/user/4564-toffffe)

Less More

- Posts: 318
- Thank you received: 1
-
-
-
- [](http://www.agence-web-inoak.fr)
-

14 years 8 months ago -  14 years 8 months ago [\#42988](#42988) by [toffffe](/forum/user/4564-toffffe "View toffffe's Profile")  *[réglé recupérer le montant total des anciennes cde](/forum/5-support-en-francais-french-support-/42988-regle-recuperer-le-montant-total-des-anciennes-cde#42988 "Bonjour je voudrais que dans le mail que je recois (celui de l'administrateur) il y ai noté le montant de toutes les commandes déjà passées par ce client sur le site. Comment faire ? Merci")* was created by *[toffffe](/forum/user/4564-toffffe "View toffffe's Profile")*

Bonjour je voudrais que dans le mail que je recois (celui de l'administrateur) il y ai noté le montant de toutes les commandes déjà passées par ce client sur le site.
Comment faire ?
Merci

---

Agence web e-commerce spécialiste Hikashop

Last edit: 14 years 8 months ago by [toffffe](/forum/user/4564-toffffe "View toffffe's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUtc3VwcG9ydC1lbi1mcmFuY2Fpcy1mcmVuY2gtc3VwcG9ydC0vNDI5ODgtcmVnbGUtcmVjdXBlcmVyLWxlLW1vbnRhbnQtdG90YWwtZGVzLWFuY2llbm5lcy1jZGU/c3RhcnQ9MCZ0bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[erickb](/forum/user/4069-erickb "View erickb's Profile")**
- [![erickb's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/4069-erickb "View erickb's Profile")
- [ Offline](/forum/user/4069-erickb)

Less More

- Posts: 2706
- Thank you received: 74
-
-

14 years 8 months ago -  14 years 8 months ago [\#42990](#42990) by [erickb](/forum/user/4069-erickb "View erickb's Profile")  Replied by *[erickb](/forum/user/4069-erickb "View erickb's Profile")* on topic *[Re: recupérer le montant total des anciennes commandes](/forum/5-support-en-francais-french-support-/42988-regle-recuperer-le-montant-total-des-anciennes-cde#42990 "Bonjour je voudrais que dans le mail que je recois (celui de l'administrateur) il y ai noté le montant de toutes les commandes déjà passées par ce client sur le site. Comment faire ? Merci")*

SELECT SUM(&#96;order_full_price&#96;) AS total_orders FROM &#96;#__hikashop_order&#96; WHERE &#96;order_user_id&#96; = 47

Last edit: 14 years 8 months ago by [erickb](/forum/user/4069-erickb "View erickb's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUtc3VwcG9ydC1lbi1mcmFuY2Fpcy1mcmVuY2gtc3VwcG9ydC0vNDI5ODgtcmVnbGUtcmVjdXBlcmVyLWxlLW1vbnRhbnQtdG90YWwtZGVzLWFuY2llbm5lcy1jZGU/c3RhcnQ9MCZ0bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[toffffe](/forum/user/4564-toffffe "View toffffe's Profile")**
- [![toffffe's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/4564-toffffe "View toffffe's Profile") Topic Author
- [ Offline](/forum/user/4564-toffffe)

Less More

- Posts: 318
- Thank you received: 1
-
-
-
- [](http://www.agence-web-inoak.fr)
-

14 years 8 months ago -  14 years 8 months ago [\#43004](#43004) by [toffffe](/forum/user/4564-toffffe "View toffffe's Profile")  Replied by *[toffffe](/forum/user/4564-toffffe "View toffffe's Profile")* on topic *[Re: recupérer le montant total des anciennes commandes](/forum/5-support-en-francais-french-support-/42988-regle-recuperer-le-montant-total-des-anciennes-cde#43004 "Bonjour je voudrais que dans le mail que je recois (celui de l'administrateur) il y ai noté le montant de toutes les commandes déjà passées par ce client sur le site. Comment faire ? Merci")*

Rha merci beaucoup Ericb
Malheureusement ça ne fonctionne pas.
En fait ce que je voudrais c'est réussir à mettre dans ce mail un indicateur me permettant de savoir si l'internaute a déjà commandé ou non sur le site.
Pour info je n'utilise pas le changement de statut donc je ne peux pas me caller là dessus
Juste mettre un "O" si par exemple le client a déjà commander ou un "N" s'il n'a jamais commandé dans la mail que l'admin du site reçoit

---

Agence web e-commerce spécialiste Hikashop

Last edit: 14 years 8 months ago by [toffffe](/forum/user/4564-toffffe "View toffffe's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUtc3VwcG9ydC1lbi1mcmFuY2Fpcy1mcmVuY2gtc3VwcG9ydC0vNDI5ODgtcmVnbGUtcmVjdXBlcmVyLWxlLW1vbnRhbnQtdG90YWwtZGVzLWFuY2llbm5lcy1jZGU/c3RhcnQ9MCZ0bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[erickb](/forum/user/4069-erickb "View erickb's Profile")**
- [![erickb's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/4069-erickb "View erickb's Profile")
- [ Offline](/forum/user/4069-erickb)

Less More

- Posts: 2706
- Thank you received: 74
-
-

14 years 8 months ago -  14 years 8 months ago [\#43006](#43006) by [erickb](/forum/user/4069-erickb "View erickb's Profile")  Replied by *[erickb](/forum/user/4069-erickb "View erickb's Profile")* on topic *[Re: recupérer le montant total des anciennes commandes](/forum/5-support-en-francais-french-support-/42988-regle-recuperer-le-montant-total-des-anciennes-cde#43006 "Bonjour je voudrais que dans le mail que je recois (celui de l'administrateur) il y ai noté le montant de toutes les commandes déjà passées par ce client sur le site. Comment faire ? Merci")*

il faut que tu fasses une requete dans ton php de l'email

du genre :

Code:

$orders = '' $user =&amp; JFactory::getUser(); $user-&gt;get('id'); $db =&amp; JFactory::getDBO(); $q ='SELECT COUNT(&#96;order_id&#96;) AS total_orders FROM &#96;#__hikashop_order&#96; WHERE &#96;order_user_id&#96; = ' . $user-&gt;get('id') ; $db-&gt;setQuery($q); $count = $db-&gt;loadResult(); if ($count == 0){ $orders = JText::_('NO_ORDERS'); } $orders = JText::_('HAS_ORDERS'); }

et dans ton email quelque part tu mets

echo $orders;

Last edit: 14 years 8 months ago by [erickb](/forum/user/4069-erickb "View erickb's Profile").

The following user(s) said Thank You: [toffffe](/forum/user/4564-toffffe "View toffffe's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUtc3VwcG9ydC1lbi1mcmFuY2Fpcy1mcmVuY2gtc3VwcG9ydC0vNDI5ODgtcmVnbGUtcmVjdXBlcmVyLWxlLW1vbnRhbnQtdG90YWwtZGVzLWFuY2llbm5lcy1jZGU/c3RhcnQ9MCZ0bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[toffffe](/forum/user/4564-toffffe "View toffffe's Profile")**
- [![toffffe's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/4564-toffffe "View toffffe's Profile") Topic Author
- [ Offline](/forum/user/4564-toffffe)

Less More

- Posts: 318
- Thank you received: 1
-
-
-
- [](http://www.agence-web-inoak.fr)
-

14 years 8 months ago [\#43012](#43012) by [toffffe](/forum/user/4564-toffffe "View toffffe's Profile")  Replied by *[toffffe](/forum/user/4564-toffffe "View toffffe's Profile")* on topic *[Re: recupérer le montant total des anciennes commandes](/forum/5-support-en-francais-french-support-/42988-regle-recuperer-le-montant-total-des-anciennes-cde#43012 "Bonjour je voudrais que dans le mail que je recois (celui de l'administrateur) il y ai noté le montant de toutes les commandes déjà passées par ce client sur le site. Comment faire ? Merci")*

Merci ErickB,
j'ai bien mis le code entre balise &lt;?php et ?&gt; dans le code de l'email.
Mais au moment de l'envoie =&gt; page blanche
Et je ne vois aps d'où vient l'erreur

@ quel endroit aurais tu mis le code dans "Notification de commande à l'administrateur"
Et le code fonctionne t'il chez toi ?

En tous cas merci

---

Agence web e-commerce spécialiste Hikashop

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUtc3VwcG9ydC1lbi1mcmFuY2Fpcy1mcmVuY2gtc3VwcG9ydC0vNDI5ODgtcmVnbGUtcmVjdXBlcmVyLWxlLW1vbnRhbnQtdG90YWwtZGVzLWFuY2llbm5lcy1jZGU/c3RhcnQ9MCZ0bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[erickb](/forum/user/4069-erickb "View erickb's Profile")**
- [![erickb's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/4069-erickb "View erickb's Profile")
- [ Offline](/forum/user/4069-erickb)

Less More

- Posts: 2706
- Thank you received: 74
-
-

14 years 8 months ago [\#43022](#43022) by [erickb](/forum/user/4069-erickb "View erickb's Profile")  Replied by *[erickb](/forum/user/4069-erickb "View erickb's Profile")* on topic *[Re: recupérer le montant total des anciennes commandes](/forum/5-support-en-francais-french-support-/42988-regle-recuperer-le-montant-total-des-anciennes-cde#43022 "Bonjour je voudrais que dans le mail que je recois (celui de l'administrateur) il y ai noté le montant de toutes les commandes déjà passées par ce client sur le site. Comment faire ? Merci")*

j'ai pas teste le code car je ne l'utilise pas , mais a un poil pres ca doit etre ça, peux tu coller ici ta page complete d'envois d'email ? ta view ?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUtc3VwcG9ydC1lbi1mcmFuY2Fpcy1mcmVuY2gtc3VwcG9ydC0vNDI5ODgtcmVnbGUtcmVjdXBlcmVyLWxlLW1vbnRhbnQtdG90YWwtZGVzLWFuY2llbm5lcy1jZGU/c3RhcnQ9MCZ0bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[toffffe](/forum/user/4564-toffffe "View toffffe's Profile")**
- [![toffffe's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/4564-toffffe "View toffffe's Profile") Topic Author
- [ Offline](/forum/user/4564-toffffe)

Less More

- Posts: 318
- Thank you received: 1
-
-
-
- [](http://www.agence-web-inoak.fr)
-

14 years 8 months ago -  14 years 8 months ago [\#43024](#43024) by [toffffe](/forum/user/4564-toffffe "View toffffe's Profile")  Replied by *[toffffe](/forum/user/4564-toffffe "View toffffe's Profile")* on topic *[Re: recupérer le montant total des anciennes commandes](/forum/5-support-en-francais-french-support-/42988-regle-recuperer-le-montant-total-des-anciennes-cde#43024 "Bonjour je voudrais que dans le mail que je recois (celui de l'administrateur) il y ai noté le montant de toutes les commandes déjà passées par ce client sur le site. Comment faire ? Merci")*

Voila pour le code Code:

&lt;?php /** * @package HikaShop for Joomla! * @version 1.5.6 * @author hikashop.com * @copyright (C) 2010-2012 HIKARI SOFTWARE. All rights reserved. * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html */ defined('_JEXEC') or die('Restricted access'); ?&gt; &lt;div style="background-color: #ffffff; font-family: Verdana, Arial, Helvetica, sans-serif;font-size:12px; color: #000000; width: 100%;"&gt; &lt;table style="margin: auto;font-family: Verdana, Arial, Helvetica, sans-serif;font-size:12px;" border="0" cellspacing="0" cellpadding="0"; width= "650px;"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td height="10"&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; &lt;table width="100%" style="border: 1px solid #DDDDDD;font-family: Verdana, Arial, Helvetica, sans-serif;font-size:12px;"&gt; &lt;?php $params = null; $js = ''; $fieldsClass = hikashop_get('class.field'); $app=&amp;JFactory::getApplication(); $template = trim(hikashop_getLayout($app-&gt;isAdmin() ? 'order' : 'address','address_template',$params,$js)); if(!empty($data-&gt;cart-&gt;billing_address)){ $billing = $template; foreach($data-&gt;cart-&gt;fields as $field){ $fieldname = $field-&gt;field_namekey; $billing=str_replace('{'.$fieldname.'}',$fieldsClass-&gt;show($field,$data-&gt;cart-&gt;billing_address-&gt;$fieldname),$billing); } echo '&lt;tr&gt;&lt;td style="font-weight:bold;background-color:#DDDDDD"&gt;'.JText::_('HIKASHOP_BILLING_ADDRESS').'&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;'; echo str_replace(array("\r\n","\r","\n"),'&lt;br/&gt;',preg_replace('#{(?:(?!}).)*}#i','',$billing)).'&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;'; } if(!empty($data-&gt;cart-&gt;order_shipping_id) &amp;&amp; !empty($data-&gt;cart-&gt;shipping_address)){ $shipping = $template; foreach($data-&gt;cart-&gt;fields as $field){ $fieldname = $field-&gt;field_namekey; $shipping=str_replace('{'.$fieldname.'}',$fieldsClass-&gt;show($field,$data-&gt;cart-&gt;shipping_address-&gt;$fieldname),$shipping); } echo '&lt;tr&gt;&lt;td style="font-weight:bold;background-color:#DDDDDD"&gt;'.JText::_('HIKASHOP_SHIPPING_ADDRESS').'&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;'; echo str_replace(array("\r\n","\r","\n"),'&lt;br/&gt;',preg_replace('#{(?:(?!}).)*}#i','',$shipping)).'&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;'; }?&gt; &lt;/table&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td height="10"&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; &lt;br/&gt; &lt;br/&gt; &lt;?php $url = HIKASHOP_LIVE.'administrator/index.php?option=com_hikashop&amp;ctrl=order&amp;task=edit&amp;order_id='.$data-&gt;order_id; echo JText::sprintf('ORDER_STATUS_CHANGED',$data-&gt;mail_status)."&lt;br/&gt;&lt;br/&gt;".JText::sprintf('NOTIFICATION_OF_ORDER_ON_WEBSITE',$data-&gt;order_number,HIKASHOP_LIVE); $currency = hikashop_get('class.currency'); $url = '&lt;a href="'.$url.'" target="_blank"&gt;'.$url.'&lt;/a&gt;'; echo "&lt;br/&gt;".JText::sprintf('ACCESS_ORDER_WITH_LINK',$url); if($data-&gt;order_payment_method=='creditcard' &amp;&amp; !empty($data-&gt;credit_card_info-&gt;cc_number)){ echo "&lt;br/&gt;".JText::_('CUSTOMER_PAID_WITH_CREDIT_CARD'); if(!empty($data-&gt;credit_card_info-&gt;cc_owner)){ echo "&lt;br/&gt;".JText::_('CREDIT_CARD_OWNER').' : '.$data-&gt;credit_card_info-&gt;cc_owner; } echo "&lt;br/&gt;".JText::_('END_OF_CREDIT_CARD_NUMBER').' : '.substr($data-&gt;credit_card_info-&gt;cc_number,8); if(!empty($data-&gt;credit_card_info-&gt;cc_CCV)){ echo "&lt;br/&gt;".JText::_('CARD_VALIDATION_CODE').' : '.$data-&gt;credit_card_info-&gt;cc_CCV; } echo "&lt;br/&gt;".JText::_('CREDITCARD_WARNING'); } $fieldsClass = hikashop_get('class.field'); $fields = $fieldsClass-&gt;getFields('frontcomp',$data,'order',''); foreach($fields as $fieldName =&gt; $oneExtraField) { if(!empty($data-&gt;$fieldName)) echo "&lt;br/&gt;".$fieldsClass-&gt;trans($oneExtraField-&gt;field_realname).' : '.$fieldsClass-&gt;show($oneExtraField,$data-&gt;$fieldName); } $class = hikashop_get('class.order'); $url = $data-&gt;order_number; $config =&amp; hikashop_config(); if($config-&gt;get('simplified_registration',0)!=2){ $url .= ' ( '.$data-&gt;order_url.' )'; } $data-&gt;cart = $class-&gt;loadFullOrder($data-&gt;order_id,true,false); $data-&gt;cart-&gt;coupon = null; $price = null; $tax = $data-&gt;cart-&gt;order_subtotal - $data-&gt;cart-&gt;order_subtotal_no_vat + $data-&gt;order_discount_tax + $data-&gt;order_shipping_tax; $price-&gt;price_value = $data-&gt;order_full_price-$tax; $price-&gt;price_value_with_tax = $data-&gt;order_full_price; $data-&gt;cart-&gt;full_total = null; $data-&gt;cart-&gt;full_total-&gt;prices = array($price); $data-&gt;cart-&gt;coupon-&gt;discount_value =&amp; $data-&gt;order_discount_price; ?&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td height="10"&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; &lt;table width="100%" style="font-family: Verdana, Arial, Helvetica, sans-serif;font-size:12px;"&gt; &lt;tr&gt; &lt;td style="font-weight:bold;" width="40px"&gt; &lt;?php echo JText::_('CART_PRODUCT_QUANTITY'); ?&gt; &lt;/td&gt; &lt;td style="font-weight:bold;"&gt; &lt;?php echo JText::_('CART_PRODUCT_NAME'); ?&gt; &lt;/td&gt; &lt;td style="font-weight:bold;"&gt; &lt;?php echo JText::_('CART_PRODUCT_UNIT_PRICE'); ?&gt; &lt;/td&gt; &lt;td style="font-weight:bold;text-align:right;"&gt; &lt;?php echo JText::_('HIKASHOP_TOTAL'); ?&gt; &lt;/td&gt; &lt;/tr&gt; &lt;?php if(hikashop_level(2)){ $fieldsClass = hikashop_get('class.field'); $null = null; $itemFields = $fieldsClass-&gt;getFields('frontcomp',$null,'item'); } foreach($data-&gt;cart-&gt;products as $item){ ?&gt; &lt;tr&gt; &lt;td&gt; &lt;?php echo $item-&gt;order_product_quantity; ?&gt; &lt;/td&gt; &lt;td&gt; &lt;p&gt;&lt;?php echo $item-&gt;order_product_name; ?&gt; &lt;?php echo $item-&gt;order_product_code; ?&gt;&lt;/p&gt;&lt;?php if(!empty($itemFields)){ foreach($itemFields as $field){ $namekey = $field-&gt;field_namekey; if(empty($item-&gt;$namekey)) continue; echo '&lt;p&gt;'.$fieldsClass-&gt;getFieldName($field).': '.$fieldsClass-&gt;show($field,$item-&gt;$namekey).'&lt;/p&gt;'; } } ?&gt; &lt;/td&gt; &lt;td&gt; &lt;?php echo $currencyHelper-&gt;format($item-&gt;order_product_price+$item-&gt;order_product_tax,$data-&gt;order_currency_id); ?&gt; &lt;/td&gt; &lt;td style="text-align:right"&gt; &lt;?php echo $currencyHelper-&gt;format($item-&gt;order_product_total_price,$data-&gt;order_currency_id); ?&gt; &lt;/td&gt; &lt;/tr&gt; &lt;?php } if(bccomp($data-&gt;order_discount_price,0,5)){ echo '&lt;tr&gt;&lt;td colspan="4" style="text-align:right"&gt;'.JText::_('HIKASHOP_COUPON').' : '.$currencyHelper-&gt;format($data-&gt;order_discount_price*-1,$data-&gt;order_currency_id).'&lt;/td&gt;&lt;/tr&gt;'; } if(bccomp($data-&gt;order_shipping_price,0,5)){ echo '&lt;tr&gt;&lt;td colspan="4" style="text-align:right"&gt;'.JText::_('HIKASHOP_SHIPPING_METHOD').' : '.$currencyHelper-&gt;format($data-&gt;order_shipping_price,$data-&gt;order_currency_id).'&lt;/td&gt;&lt;/tr&gt;'; } if($data-&gt;cart-&gt;full_total-&gt;prices[0]-&gt;price_value!=$data-&gt;cart-&gt;full_total-&gt;prices[0]-&gt;price_value_with_tax){ if($config-&gt;get('detailed_tax_display') &amp;&amp; !empty($data-&gt;cart-&gt;order_tax_info)){ foreach($data-&gt;cart-&gt;order_tax_info as $tax){ echo '&lt;tr&gt;&lt;td colspan="4" style="text-align:right"&gt;'.$tax-&gt;tax_namekey. ' : '.$currencyHelper-&gt;format($tax-&gt;tax_amount,$data-&gt;order_currency_id).'&lt;/td&gt;&lt;/tr&gt;'; } }else{ echo '&lt;tr&gt;&lt;td colspan="4" style="text-align:right"&gt;'.JText::sprintf('TOTAL_WITHOUT_VAT',$currencyHelper-&gt;format($data-&gt;cart-&gt;full_total-&gt;prices[0]-&gt;price_value,$data-&gt;order_currency_id)).'&lt;/td&gt;&lt;/tr&gt;'; } $text=JText::sprintf('TOTAL_WITH_VAT',$currencyHelper-&gt;format($data-&gt;cart-&gt;full_total-&gt;prices[0]-&gt;price_value_with_tax,$data-&gt;order_currency_id)); }else{ $text=JText::_('HIKASHOP_FINAL_TOTAL'). ' : '.$currencyHelper-&gt;format($data-&gt;cart-&gt;full_total-&gt;prices[0]-&gt;price_value_with_tax,$data-&gt;order_currency_id); } echo '&lt;tr&gt;&lt;td colspan="4" style="text-align:right;font-weight:bold;"&gt;'.$text.'&lt;/td&gt;&lt;/tr&gt;'; ?&gt; &lt;/table&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td height="10"&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td height="10"&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td height="10"&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td height="10"&gt;&lt;?php echo $orders; ?&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/div&gt;

---

Agence web e-commerce spécialiste Hikashop

Last edit: 14 years 8 months ago by [toffffe](/forum/user/4564-toffffe "View toffffe's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUtc3VwcG9ydC1lbi1mcmFuY2Fpcy1mcmVuY2gtc3VwcG9ydC0vNDI5ODgtcmVnbGUtcmVjdXBlcmVyLWxlLW1vbnRhbnQtdG90YWwtZGVzLWFuY2llbm5lcy1jZGU/c3RhcnQ9MCZ0bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[erickb](/forum/user/4069-erickb "View erickb's Profile")**
- [![erickb's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/4069-erickb "View erickb's Profile")
- [ Offline](/forum/user/4069-erickb)

Less More

- Posts: 2706
- Thank you received: 74
-
-

14 years 8 months ago -  14 years 8 months ago [\#43025](#43025) by [erickb](/forum/user/4069-erickb "View erickb's Profile")  Replied by *[erickb](/forum/user/4069-erickb "View erickb's Profile")* on topic *[Re: recupérer le montant total des anciennes commandes](/forum/5-support-en-francais-french-support-/42988-regle-recuperer-le-montant-total-des-anciennes-cde#43025 "Bonjour je voudrais que dans le mail que je recois (celui de l'administrateur) il y ai noté le montant de toutes les commandes déjà passées par ce client sur le site. Comment faire ? Merci")*

ton debut de fichier :
Code:

/*@package ect...*/ defined('_JEXEC') or die('Restricted access'); $orders = ''; $user =&amp; JFactory::getUser(); $user-&gt;get('id'); $db =&amp; JFactory::getDBO(); $q ='SELECT COUNT(&#96;order_id&#96;) AS total_orders FROM &#96;#__hikashop_order&#96; WHERE &#96;order_user_id&#96; = ' . $user-&gt;get('id') ; $db-&gt;setQuery($q); $count = $db-&gt;loadResult(); if ($count == 0){ $orders = JText::_('NO_ORDERS'); } else{ $orders = JText::_('HAS_ORDERS'); } ?&gt; &lt;div style="background-color: #ffffff; font-family: Verdana, Arial, Helvetica, sans-serif;font-size:12px; color: #000000; width: 100%;"&gt; ect .....

ça devrait etre bon

et bien sur tu vas dans admin &gt; extension &gt; gestion des langues &gt; substitutions &gt; nouveau

et tu rentre 2 chaines NO_ORDERS et HAS_ORDERS , avec leurs valeurs

si tu veux faire mieux tu mets HAS_ORDERS = %s commandes
et à la place de $orders = JText::_('HAS_ORDERS');
tu mets
$orders = JText::sprintf('HAS_ORDERS',$count) ;

Last edit: 14 years 8 months ago by [erickb](/forum/user/4069-erickb "View erickb's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUtc3VwcG9ydC1lbi1mcmFuY2Fpcy1mcmVuY2gtc3VwcG9ydC0vNDI5ODgtcmVnbGUtcmVjdXBlcmVyLWxlLW1vbnRhbnQtdG90YWwtZGVzLWFuY2llbm5lcy1jZGU/c3RhcnQ9MCZ0bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[toffffe](/forum/user/4564-toffffe "View toffffe's Profile")**
- [![toffffe's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/4564-toffffe "View toffffe's Profile") Topic Author
- [ Offline](/forum/user/4564-toffffe)

Less More

- Posts: 318
- Thank you received: 1
-
-
-
- [](http://www.agence-web-inoak.fr)
-

14 years 8 months ago [\#43039](#43039) by [toffffe](/forum/user/4564-toffffe "View toffffe's Profile")  Replied by *[toffffe](/forum/user/4564-toffffe "View toffffe's Profile")* on topic *[Re: recupérer le montant total des anciennes commandes](/forum/5-support-en-francais-french-support-/42988-regle-recuperer-le-montant-total-des-anciennes-cde#43039 "Bonjour je voudrais que dans le mail que je recois (celui de l'administrateur) il y ai noté le montant de toutes les commandes déjà passées par ce client sur le site. Comment faire ? Merci")*

Pas mal, c'est presque ça, sauf que pour l'instant je n'ai que des no_order
Il ne détect jamais de commande déjà passé alors qu'il y en a sur un des utilisateurs que j'ai testé
Je sent que grace a toi je touche au but

---

Agence web e-commerce spécialiste Hikashop

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUtc3VwcG9ydC1lbi1mcmFuY2Fpcy1mcmVuY2gtc3VwcG9ydC0vNDI5ODgtcmVnbGUtcmVjdXBlcmVyLWxlLW1vbnRhbnQtdG90YWwtZGVzLWFuY2llbm5lcy1jZGU/c3RhcnQ9MCZ0bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[erickb](/forum/user/4069-erickb "View erickb's Profile")**
- [![erickb's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/4069-erickb "View erickb's Profile")
- [ Offline](/forum/user/4069-erickb)

Less More

- Posts: 2706
- Thank you received: 74
-
-

14 years 8 months ago -  14 years 8 months ago [\#43040](#43040) by [erickb](/forum/user/4069-erickb "View erickb's Profile")  Replied by *[erickb](/forum/user/4069-erickb "View erickb's Profile")* on topic *[Re: recupérer le montant total des anciennes commandes](/forum/5-support-en-francais-french-support-/42988-regle-recuperer-le-montant-total-des-anciennes-cde#43040 "Bonjour je voudrais que dans le mail que je recois (celui de l'administrateur) il y ai noté le montant de toutes les commandes déjà passées par ce client sur le site. Comment faire ? Merci")*

essaye ce code

$user =&amp; JFactory::getUser();
**$userid = $user-&gt;id;**

$db =&amp; JFactory::getDBO();
$q ='SELECT COUNT(&#96;order_id&#96;) AS total_orders FROM &#96;#__hikashop_order&#96; WHERE &#96;order_user_id&#96; = ' . **$userid** ;
$db-&gt;setQuery($q);
$count = $db-&gt;loadResult();

Last edit: 14 years 8 months ago by [erickb](/forum/user/4069-erickb "View erickb's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUtc3VwcG9ydC1lbi1mcmFuY2Fpcy1mcmVuY2gtc3VwcG9ydC0vNDI5ODgtcmVnbGUtcmVjdXBlcmVyLWxlLW1vbnRhbnQtdG90YWwtZGVzLWFuY2llbm5lcy1jZGU/c3RhcnQ9MCZ0bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[toffffe](/forum/user/4564-toffffe "View toffffe's Profile")**
- [![toffffe's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/4564-toffffe "View toffffe's Profile") Topic Author
- [ Offline](/forum/user/4564-toffffe)

Less More

- Posts: 318
- Thank you received: 1
-
-
-
- [](http://www.agence-web-inoak.fr)
-

14 years 8 months ago [\#43041](#43041) by [toffffe](/forum/user/4564-toffffe "View toffffe's Profile")  Replied by *[toffffe](/forum/user/4564-toffffe "View toffffe's Profile")* on topic *[Re: recupérer le montant total des anciennes commandes](/forum/5-support-en-francais-french-support-/42988-regle-recuperer-le-montant-total-des-anciennes-cde#43041 "Bonjour je voudrais que dans le mail que je recois (celui de l'administrateur) il y ai noté le montant de toutes les commandes déjà passées par ce client sur le site. Comment faire ? Merci")*

Toujours pareils : no_orders

---

Agence web e-commerce spécialiste Hikashop

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUtc3VwcG9ydC1lbi1mcmFuY2Fpcy1mcmVuY2gtc3VwcG9ydC0vNDI5ODgtcmVnbGUtcmVjdXBlcmVyLWxlLW1vbnRhbnQtdG90YWwtZGVzLWFuY2llbm5lcy1jZGU/c3RhcnQ9MCZ0bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[erickb](/forum/user/4069-erickb "View erickb's Profile")**
- [![erickb's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/4069-erickb "View erickb's Profile")
- [ Offline](/forum/user/4069-erickb)

Less More

- Posts: 2706
- Thank you received: 74
-
-

14 years 8 months ago -  14 years 8 months ago [\#43044](#43044) by [erickb](/forum/user/4069-erickb "View erickb's Profile")  Replied by *[erickb](/forum/user/4069-erickb "View erickb's Profile")* on topic *[Re: recupérer le montant total des anciennes commandes](/forum/5-support-en-francais-french-support-/42988-regle-recuperer-le-montant-total-des-anciennes-cde#43044 "Bonjour je voudrais que dans le mail que je recois (celui de l'administrateur) il y ai noté le montant de toutes les commandes déjà passées par ce client sur le site. Comment faire ? Merci")*

le prob c'etait l'userid qu'il faut recuperer par $data-&gt;order_user_id;

les changements du fichier d'origine en gras
Code:

&lt;?php /** * @package HikaShop for Joomla! * @version 1.5.6 * @author hikashop.com * @copyright (C) 2010-2012 HIKARI SOFTWARE. All rights reserved. * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html */ defined('_JEXEC') or die('Restricted access'); [b]$orders = null; $userid = null; [/b] ?&gt; &lt;div style="background-color: #ffffff; font-family: Verdana, Arial, Helvetica, sans-serif;font-size:12px; color: #000000; width: 100%;"&gt; &lt;table style="margin: auto;font-family: Verdana, Arial, Helvetica, sans-serif;font-size:12px;" border="0" cellspacing="0" cellpadding="0"; width= "650px;"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td height="10"&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; &lt;table width="100%" style="border: 1px solid #DDDDDD;font-family: Verdana, Arial, Helvetica, sans-serif;font-size:12px;"&gt; &lt;?php $params = null; $js = ''; $fieldsClass = hikashop_get('class.field'); $app=&amp;JFactory::getApplication(); $template = trim(hikashop_getLayout($app-&gt;isAdmin() ? 'order' : 'address','address_template',$params,$js)); if(!empty($data-&gt;cart-&gt;billing_address)){ $billing = $template; foreach($data-&gt;cart-&gt;fields as $field){ $fieldname = $field-&gt;field_namekey; $billing=str_replace('{'.$fieldname.'}',$fieldsClass-&gt;show($field,$data-&gt;cart-&gt;billing_address-&gt;$fieldname),$billing); } echo '&lt;tr&gt;&lt;td style="font-weight:bold;background-color:#DDDDDD"&gt;'.JText::_('HIKASHOP_BILLING_ADDRESS').'&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;'; echo str_replace(array("\r\n","\r","\n"),'&lt;br/&gt;',preg_replace('#{(?:(?!}).)*}#i','',$billing)).'&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;'; } if(!empty($data-&gt;cart-&gt;order_shipping_id) &amp;&amp; !empty($data-&gt;cart-&gt;shipping_address)){ $shipping = $template; foreach($data-&gt;cart-&gt;fields as $field){ $fieldname = $field-&gt;field_namekey; $shipping=str_replace('{'.$fieldname.'}',$fieldsClass-&gt;show($field,$data-&gt;cart-&gt;shipping_address-&gt;$fieldname),$shipping); } echo '&lt;tr&gt;&lt;td style="font-weight:bold;background-color:#DDDDDD"&gt;'.JText::_('HIKASHOP_SHIPPING_ADDRESS').'&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;'; echo str_replace(array("\r\n","\r","\n"),'&lt;br/&gt;',preg_replace('#{(?:(?!}).)*}#i','',$shipping)).'&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;'; }?&gt; &lt;/table&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td height="10"&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; &lt;br/&gt; &lt;br/&gt; &lt;?php $url = HIKASHOP_LIVE.'administrator/index.php?option=com_hikashop&amp;ctrl=order&amp;task=edit&amp;order_id='.$data-&gt;order_id; echo JText::sprintf('ORDER_STATUS_CHANGED',$data-&gt;mail_status)."&lt;br/&gt;&lt;br/&gt;".JText::sprintf('NOTIFICATION_OF_ORDER_ON_WEBSITE',$data-&gt;order_number,HIKASHOP_LIVE); $currency = hikashop_get('class.currency'); $url = '&lt;a href="'.$url.'" target="_blank"&gt;'.$url.'&lt;/a&gt;'; echo "&lt;br/&gt;".JText::sprintf('ACCESS_ORDER_WITH_LINK',$url); if($data-&gt;order_payment_method=='creditcard' &amp;&amp; !empty($data-&gt;credit_card_info-&gt;cc_number)){ echo "&lt;br/&gt;".JText::_('CUSTOMER_PAID_WITH_CREDIT_CARD'); if(!empty($data-&gt;credit_card_info-&gt;cc_owner)){ echo "&lt;br/&gt;".JText::_('CREDIT_CARD_OWNER').' : '.$data-&gt;credit_card_info-&gt;cc_owner; } echo "&lt;br/&gt;".JText::_('END_OF_CREDIT_CARD_NUMBER').' : '.substr($data-&gt;credit_card_info-&gt;cc_number,8); if(!empty($data-&gt;credit_card_info-&gt;cc_CCV)){ echo "&lt;br/&gt;".JText::_('CARD_VALIDATION_CODE').' : '.$data-&gt;credit_card_info-&gt;cc_CCV; } echo "&lt;br/&gt;".JText::_('CREDITCARD_WARNING'); } $fieldsClass = hikashop_get('class.field'); $fields = $fieldsClass-&gt;getFields('frontcomp',$data,'order',''); foreach($fields as $fieldName =&gt; $oneExtraField) { if(!empty($data-&gt;$fieldName)) echo "&lt;br/&gt;".$fieldsClass-&gt;trans($oneExtraField-&gt;field_realname).' : '.$fieldsClass-&gt;show($oneExtraField,$data-&gt;$fieldName); } $class = hikashop_get('class.order'); $url = $data-&gt;order_number; $config =&amp; hikashop_config(); if($config-&gt;get('simplified_registration',0)!=2){ $url .= ' ( '.$data-&gt;order_url.' )'; } $data-&gt;cart = $class-&gt;loadFullOrder($data-&gt;order_id,true,false); $data-&gt;cart-&gt;coupon = null; $price = null; $tax = $data-&gt;cart-&gt;order_subtotal - $data-&gt;cart-&gt;order_subtotal_no_vat + $data-&gt;order_discount_tax + $data-&gt;order_shipping_tax; $price-&gt;price_value = $data-&gt;order_full_price-$tax; $price-&gt;price_value_with_tax = $data-&gt;order_full_price; $data-&gt;cart-&gt;full_total = null; $data-&gt;cart-&gt;full_total-&gt;prices = array($price); $data-&gt;cart-&gt;coupon-&gt;discount_value =&amp; $data-&gt;order_discount_price; [b]// RECUP des commandes $userid = $data-&gt;order_user_id; $db =&amp; JFactory::getDBO(); $q ='SELECT COUNT(&#96;order_id&#96;) AS total_orders FROM &#96;#__hikashop_order&#96; WHERE &#96;order_user_id&#96; = ' . $userid; $db-&gt;setQuery($q); $count = $db-&gt;loadResult(); if ($count == 0){ $orders = JText::_('NO_ORDERS'); } else{ $orders = JText::_('HAS_ORDERS'); }[/b] ?&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td height="10"&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; &lt;table width="100%" style="font-family: Verdana, Arial, Helvetica, sans-serif;font-size:12px;"&gt; &lt;tr&gt; &lt;td style="font-weight:bold;" width="40px"&gt; &lt;?php echo JText::_('CART_PRODUCT_QUANTITY'); ?&gt; &lt;/td&gt; &lt;td style="font-weight:bold;"&gt; &lt;?php echo JText::_('CART_PRODUCT_NAME'); ?&gt; &lt;/td&gt; &lt;td style="font-weight:bold;"&gt; &lt;?php echo JText::_('CART_PRODUCT_UNIT_PRICE'); ?&gt; &lt;/td&gt; &lt;td style="font-weight:bold;text-align:right;"&gt; &lt;?php echo JText::_('HIKASHOP_TOTAL'); ?&gt; &lt;/td&gt; &lt;/tr&gt; &lt;?php if(hikashop_level(2)){ $fieldsClass = hikashop_get('class.field'); $null = null; $itemFields = $fieldsClass-&gt;getFields('frontcomp',$null,'item'); } foreach($data-&gt;cart-&gt;products as $item){ ?&gt; &lt;tr&gt; &lt;td&gt; &lt;?php echo $item-&gt;order_product_quantity; ?&gt; &lt;/td&gt; &lt;td&gt; &lt;p&gt;&lt;?php echo $item-&gt;order_product_name; ?&gt; &lt;?php echo $item-&gt;order_product_code; ?&gt;&lt;/p&gt;&lt;?php if(!empty($itemFields)){ foreach($itemFields as $field){ $namekey = $field-&gt;field_namekey; if(empty($item-&gt;$namekey)) continue; echo '&lt;p&gt;'.$fieldsClass-&gt;getFieldName($field).': '.$fieldsClass-&gt;show($field,$item-&gt;$namekey).'&lt;/p&gt;'; } } ?&gt; &lt;/td&gt; &lt;td&gt; &lt;?php echo $currencyHelper-&gt;format($item-&gt;order_product_price+$item-&gt;order_product_tax,$data-&gt;order_currency_id); ?&gt; &lt;/td&gt; &lt;td style="text-align:right"&gt; &lt;?php echo $currencyHelper-&gt;format($item-&gt;order_product_total_price,$data-&gt;order_currency_id); ?&gt; &lt;/td&gt; &lt;/tr&gt; &lt;?php } if(bccomp($data-&gt;order_discount_price,0,5)){ echo '&lt;tr&gt;&lt;td colspan="4" style="text-align:right"&gt;'.JText::_('HIKASHOP_COUPON').' : '.$currencyHelper-&gt;format($data-&gt;order_discount_price*-1,$data-&gt;order_currency_id).'&lt;/td&gt;&lt;/tr&gt;'; } if(bccomp($data-&gt;order_shipping_price,0,5)){ echo '&lt;tr&gt;&lt;td colspan="4" style="text-align:right"&gt;'.JText::_('HIKASHOP_SHIPPING_METHOD').' : '.$currencyHelper-&gt;format($data-&gt;order_shipping_price,$data-&gt;order_currency_id).'&lt;/td&gt;&lt;/tr&gt;'; } if($data-&gt;cart-&gt;full_total-&gt;prices[0]-&gt;price_value!=$data-&gt;cart-&gt;full_total-&gt;prices[0]-&gt;price_value_with_tax){ if($config-&gt;get('detailed_tax_display') &amp;&amp; !empty($data-&gt;cart-&gt;order_tax_info)){ foreach($data-&gt;cart-&gt;order_tax_info as $tax){ echo '&lt;tr&gt;&lt;td colspan="4" style="text-align:right"&gt;'.$tax-&gt;tax_namekey. ' : '.$currencyHelper-&gt;format($tax-&gt;tax_amount,$data-&gt;order_currency_id).'&lt;/td&gt;&lt;/tr&gt;'; } }else{ echo '&lt;tr&gt;&lt;td colspan="4" style="text-align:right"&gt;'.JText::sprintf('TOTAL_WITHOUT_VAT',$currencyHelper-&gt;format($data-&gt;cart-&gt;full_total-&gt;prices[0]-&gt;price_value,$data-&gt;order_currency_id)).'&lt;/td&gt;&lt;/tr&gt;'; } $text=JText::sprintf('TOTAL_WITH_VAT',$currencyHelper-&gt;format($data-&gt;cart-&gt;full_total-&gt;prices[0]-&gt;price_value_with_tax,$data-&gt;order_currency_id)); }else{ $text=JText::_('HIKASHOP_FINAL_TOTAL'). ' : '.$currencyHelper-&gt;format($data-&gt;cart-&gt;full_total-&gt;prices[0]-&gt;price_value_with_tax,$data-&gt;order_currency_id); } echo '&lt;tr&gt;&lt;td colspan="4" style="text-align:right;font-weight:bold;"&gt;'.$text.'&lt;/td&gt;&lt;/tr&gt;'; ?&gt; &lt;/table&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td height="10"&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td height="10"&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td height="10"&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td height="10"&gt;[b]&lt;?php echo $orders; ?&gt;[/b] &lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/div&gt;

Last edit: 14 years 8 months ago by [erickb](/forum/user/4069-erickb "View erickb's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUtc3VwcG9ydC1lbi1mcmFuY2Fpcy1mcmVuY2gtc3VwcG9ydC0vNDI5ODgtcmVnbGUtcmVjdXBlcmVyLWxlLW1vbnRhbnQtdG90YWwtZGVzLWFuY2llbm5lcy1jZGU/c3RhcnQ9MCZ0bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[toffffe](/forum/user/4564-toffffe "View toffffe's Profile")**
- [![toffffe's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/4564-toffffe "View toffffe's Profile") Topic Author
- [ Offline](/forum/user/4564-toffffe)

Less More

- Posts: 318
- Thank you received: 1
-
-
-
- [](http://www.agence-web-inoak.fr)
-

14 years 8 months ago [\#43045](#43045) by [toffffe](/forum/user/4564-toffffe "View toffffe's Profile")  Replied by *[toffffe](/forum/user/4564-toffffe "View toffffe's Profile")* on topic *[Re: recupérer le montant total des anciennes commandes](/forum/5-support-en-francais-french-support-/42988-regle-recuperer-le-montant-total-des-anciennes-cde#43045 "Bonjour je voudrais que dans le mail que je recois (celui de l'administrateur) il y ai noté le montant de toutes les commandes déjà passées par ce client sur le site. Comment faire ? Merci")*

Bravo, mais c'est pas encore tout à fait ça car maintenant il affiche toujours has_orders, même si la personne n'a jamais commandé.
C'est surement parce que la commande je l'ai réglée pour qu'elle soit directement confirmer.
Je ne sais pas si c'est possible, mais je pense que le plus simple serait d'aller chercher le montant total des commandes ou le nombre de commande déjà passées
Qu'en penses-tu ?
Car je suis convaincu que ton code fonctionne mais ne va pas avec mon réglage de la boutique

---

Agence web e-commerce spécialiste Hikashop

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUtc3VwcG9ydC1lbi1mcmFuY2Fpcy1mcmVuY2gtc3VwcG9ydC0vNDI5ODgtcmVnbGUtcmVjdXBlcmVyLWxlLW1vbnRhbnQtdG90YWwtZGVzLWFuY2llbm5lcy1jZGU/c3RhcnQ9MCZ0bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[erickb](/forum/user/4069-erickb "View erickb's Profile")**
- [![erickb's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/4069-erickb "View erickb's Profile")
- [ Offline](/forum/user/4069-erickb)

Less More

- Posts: 2706
- Thank you received: 74
-
-

14 years 8 months ago -  14 years 8 months ago [\#43046](#43046) by [erickb](/forum/user/4069-erickb "View erickb's Profile")  Replied by *[erickb](/forum/user/4069-erickb "View erickb's Profile")* on topic *[Re: recupérer le montant total des anciennes commandes](/forum/5-support-en-francais-french-support-/42988-regle-recuperer-le-montant-total-des-anciennes-cde#43046 "Bonjour je voudrais que dans le mail que je recois (celui de l'administrateur) il y ai noté le montant de toutes les commandes déjà passées par ce client sur le site. Comment faire ? Merci")*

oui en ce cas

SELECT COUNT(&#96;order_id&#96;) AS total_orders FROM &#96;#__hikashop_order&#96; WHERE order_status LIKE '**Expediée**' AND &#96;order_user_id&#96; = ' . $userid ;

fait bien gaffe que ce soit le mot exact Expediee ou ce que tu voudras

avec SUM(order_full_price) tu as le prix total

si tu as plusieurs status c'est

SELECT COUNT( &#96;order_id&#96; ) AS total_orders
FROM &#96;#__hikashop_order&#96;
WHERE (
order_status LIKE 'Expediée'
OR order_status LIKE 'Confirmée'
)
AND &#96;order_user_id&#96; = ?

Last edit: 14 years 8 months ago by [erickb](/forum/user/4069-erickb "View erickb's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUtc3VwcG9ydC1lbi1mcmFuY2Fpcy1mcmVuY2gtc3VwcG9ydC0vNDI5ODgtcmVnbGUtcmVjdXBlcmVyLWxlLW1vbnRhbnQtdG90YWwtZGVzLWFuY2llbm5lcy1jZGU/c3RhcnQ9MCZ0bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[toffffe](/forum/user/4564-toffffe "View toffffe's Profile")**
- [![toffffe's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/4564-toffffe "View toffffe's Profile") Topic Author
- [ Offline](/forum/user/4564-toffffe)

Less More

- Posts: 318
- Thank you received: 1
-
-
-
- [](http://www.agence-web-inoak.fr)
-

14 years 8 months ago [\#43047](#43047) by [toffffe](/forum/user/4564-toffffe "View toffffe's Profile")  Replied by *[toffffe](/forum/user/4564-toffffe "View toffffe's Profile")* on topic *[Re: recupérer le montant total des anciennes commandes](/forum/5-support-en-francais-french-support-/42988-regle-recuperer-le-montant-total-des-anciennes-cde#43047 "Bonjour je voudrais que dans le mail que je recois (celui de l'administrateur) il y ai noté le montant de toutes les commandes déjà passées par ce client sur le site. Comment faire ? Merci")*

Là je crois ne pas t'avoir compris, car page blanche

---

Agence web e-commerce spécialiste Hikashop

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUtc3VwcG9ydC1lbi1mcmFuY2Fpcy1mcmVuY2gtc3VwcG9ydC0vNDI5ODgtcmVnbGUtcmVjdXBlcmVyLWxlLW1vbnRhbnQtdG90YWwtZGVzLWFuY2llbm5lcy1jZGU/c3RhcnQ9MCZ0bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[erickb](/forum/user/4069-erickb "View erickb's Profile")**
- [![erickb's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/4069-erickb "View erickb's Profile")
- [ Offline](/forum/user/4069-erickb)

Less More

- Posts: 2706
- Thank you received: 74
-
-

14 years 8 months ago -  14 years 8 months ago [\#43048](#43048) by [erickb](/forum/user/4069-erickb "View erickb's Profile")  Replied by *[erickb](/forum/user/4069-erickb "View erickb's Profile")* on topic *[Re: recupérer le montant total des anciennes commandes](/forum/5-support-en-francais-french-support-/42988-regle-recuperer-le-montant-total-des-anciennes-cde#43048 "Bonjour je voudrais que dans le mail que je recois (celui de l'administrateur) il y ai noté le montant de toutes les commandes déjà passées par ce client sur le site. Comment faire ? Merci")*

il faut remplacer la ligne

$q ='SELECT COUNT(&#96;order_id&#96;) AS total_orders FROM &#96;#__hikashop_order&#96; WHERE &#96;order_user_id&#96; = ' . $userid;

par

$q ='SELECT COUNT(&#96;order_id&#96;) AS total_orders FROM &#96;#__hikashop_order&#96; WHERE order_status LIKE 'Expediée' AND &#96;order_user_id&#96; =' . $userid;

**Expediée** etant le libellé exact de ton status pour les commandes valides que tu trouves dans la table #__hikashop_category category_type = status

tu peux aussi utiliser le category_namekey et tu les renomme comme tu veux par exemple status_shipped

Last edit: 14 years 8 months ago by [erickb](/forum/user/4069-erickb "View erickb's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUtc3VwcG9ydC1lbi1mcmFuY2Fpcy1mcmVuY2gtc3VwcG9ydC0vNDI5ODgtcmVnbGUtcmVjdXBlcmVyLWxlLW1vbnRhbnQtdG90YWwtZGVzLWFuY2llbm5lcy1jZGU/c3RhcnQ9MCZ0bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[toffffe](/forum/user/4564-toffffe "View toffffe's Profile")**
- [![toffffe's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/4564-toffffe "View toffffe's Profile") Topic Author
- [ Offline](/forum/user/4564-toffffe)

Less More

- Posts: 318
- Thank you received: 1
-
-
-
- [](http://www.agence-web-inoak.fr)
-

14 years 8 months ago [\#43049](#43049) by [toffffe](/forum/user/4564-toffffe "View toffffe's Profile")  Replied by *[toffffe](/forum/user/4564-toffffe "View toffffe's Profile")* on topic *[Re: recupérer le montant total des anciennes commandes](/forum/5-support-en-francais-french-support-/42988-regle-recuperer-le-montant-total-des-anciennes-cde#43049 "Bonjour je voudrais que dans le mail que je recois (celui de l'administrateur) il y ai noté le montant de toutes les commandes déjà passées par ce client sur le site. Comment faire ? Merci")*

C'est pourtant ien ce que j'avais fais mais j'ai une belle page blanche
et j'ai changer avec confirmed

---

Agence web e-commerce spécialiste Hikashop

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUtc3VwcG9ydC1lbi1mcmFuY2Fpcy1mcmVuY2gtc3VwcG9ydC0vNDI5ODgtcmVnbGUtcmVjdXBlcmVyLWxlLW1vbnRhbnQtdG90YWwtZGVzLWFuY2llbm5lcy1jZGU/c3RhcnQ9MCZ0bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[erickb](/forum/user/4069-erickb "View erickb's Profile")**
- [![erickb's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/4069-erickb "View erickb's Profile")
- [ Offline](/forum/user/4069-erickb)

Less More

- Posts: 2706
- Thank you received: 74
-
-

14 years 8 months ago -  14 years 8 months ago [\#43050](#43050) by [erickb](/forum/user/4069-erickb "View erickb's Profile")  Replied by *[erickb](/forum/user/4069-erickb "View erickb's Profile")* on topic *[Re: recupérer le montant total des anciennes commandes](/forum/5-support-en-francais-french-support-/42988-regle-recuperer-le-montant-total-des-anciennes-cde#43050 "Bonjour je voudrais que dans le mail que je recois (celui de l'administrateur) il y ai noté le montant de toutes les commandes déjà passées par ce client sur le site. Comment faire ? Merci")*

excuse j'ecris pas dans un editeur et j'ai pas fait gaffe c'est a cause des quotes

$q = **"**SELECT COUNT(&#96;order_id&#96;) AS total_orders FROM &#96;#__hikashop_order&#96; WHERE order_status LIKE 'confirmed' AND &#96;order_user_id&#96; =**"** . $userid;

ou bien

$status = 'confirmed':
$q = 'SELECT COUNT(&#96;order_id&#96;) AS total_orders FROM &#96;#__hikashop_order&#96; WHERE order_status LIKE '.quote($status).' AND &#96;order_user_id&#96; =' . $userid;

Last edit: 14 years 8 months ago by [erickb](/forum/user/4069-erickb "View erickb's Profile").

The following user(s) said Thank You: [toffffe](/forum/user/4564-toffffe "View toffffe's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUtc3VwcG9ydC1lbi1mcmFuY2Fpcy1mcmVuY2gtc3VwcG9ydC0vNDI5ODgtcmVnbGUtcmVjdXBlcmVyLWxlLW1vbnRhbnQtdG90YWwtZGVzLWFuY2llbm5lcy1jZGU/c3RhcnQ9MCZ0bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[toffffe](/forum/user/4564-toffffe "View toffffe's Profile")**
- [![toffffe's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/4564-toffffe "View toffffe's Profile") Topic Author
- [ Offline](/forum/user/4564-toffffe)

Less More

- Posts: 318
- Thank you received: 1
-
-
-
- [](http://www.agence-web-inoak.fr)
-

14 years 8 months ago [\#43151](#43151) by [toffffe](/forum/user/4564-toffffe "View toffffe's Profile")  Replied by *[toffffe](/forum/user/4564-toffffe "View toffffe's Profile")* on topic *[Re: recupérer le montant total des anciennes commandes](/forum/5-support-en-francais-french-support-/42988-regle-recuperer-le-montant-total-des-anciennes-cde#43151 "Bonjour je voudrais que dans le mail que je recois (celui de l'administrateur) il y ai noté le montant de toutes les commandes déjà passées par ce client sur le site. Comment faire ? Merci")*

Super j'ai quelques vérifications, mais a première vue ça fonctionne
Ca fonctionne pour moi avec ta première solution de ton dernier message
Merci Erickb

---

Agence web e-commerce spécialiste Hikashop

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUtc3VwcG9ydC1lbi1mcmFuY2Fpcy1mcmVuY2gtc3VwcG9ydC0vNDI5ODgtcmVnbGUtcmVjdXBlcmVyLWxlLW1vbnRhbnQtdG90YWwtZGVzLWFuY2llbm5lcy1jZGU/c3RhcnQ9MCZ0bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[erickb](/forum/user/4069-erickb "View erickb's Profile")**
- [![erickb's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/4069-erickb "View erickb's Profile")
- [ Offline](/forum/user/4069-erickb)

Less More

- Posts: 2706
- Thank you received: 74
-
-

14 years 8 months ago [\#43160](#43160) by [erickb](/forum/user/4069-erickb "View erickb's Profile")  Replied by *[erickb](/forum/user/4069-erickb "View erickb's Profile")* on topic *[Re: recupérer le montant total des anciennes commandes](/forum/5-support-en-francais-french-support-/42988-regle-recuperer-le-montant-total-des-anciennes-cde#43160 "Bonjour je voudrais que dans le mail que je recois (celui de l'administrateur) il y ai noté le montant de toutes les commandes déjà passées par ce client sur le site. Comment faire ? Merci")*

desole j'aurais pu te trouver le code plus vite mais j'ai rien verifie

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUtc3VwcG9ydC1lbi1mcmFuY2Fpcy1mcmVuY2gtc3VwcG9ydC0vNDI5ODgtcmVnbGUtcmVjdXBlcmVyLWxlLW1vbnRhbnQtdG90YWwtZGVzLWFuY2llbm5lcy1jZGU/c3RhcnQ9MCZ0bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.170 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
