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

  • Posts: 318
  • Thank you received: 1
12 years 8 months ago #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


Agence web e-commerce spécialiste Hikashop
Last edit: 12 years 8 months ago by toffffe.

Please Log in or Create an account to join the conversation.

  • Posts: 2639
  • Thank you received: 66
  • Hikashop Business
12 years 8 months ago #42990

SELECT SUM(`order_full_price`) AS total_orders FROM `#__hikashop_order` WHERE `order_user_id` = 47

Last edit: 12 years 8 months ago by erickb.

Please Log in or Create an account to join the conversation.

  • Posts: 318
  • Thank you received: 1
12 years 8 months ago #43004

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: 12 years 8 months ago by toffffe.

Please Log in or Create an account to join the conversation.

  • Posts: 2639
  • Thank you received: 66
  • Hikashop Business
12 years 8 months ago #43006

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

du genre :

$orders = ''

$user =& JFactory::getUser();
$user->get('id');

$db =& JFactory::getDBO();
$q ='SELECT COUNT(`order_id`) AS total_orders FROM `#__hikashop_order` WHERE `order_user_id` =  ' . $user->get('id') ;
$db->setQuery($q);
$count = $db->loadResult();

if ($count == 0){
$orders =  JText::_('NO_ORDERS');
}
$orders =  JText::_('HAS_ORDERS');
}

et dans ton email quelque part tu mets

echo $orders;

Last edit: 12 years 8 months ago by erickb.
The following user(s) said Thank You: toffffe

Please Log in or Create an account to join the conversation.

  • Posts: 318
  • Thank you received: 1
12 years 8 months ago #43012

Merci ErickB,
j'ai bien mis le code entre balise <?php et ?> dans le code de l'email.
Mais au moment de l'envoie => 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 or Create an account to join the conversation.

  • Posts: 2639
  • Thank you received: 66
  • Hikashop Business
12 years 8 months ago #43022

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 or Create an account to join the conversation.

  • Posts: 318
  • Thank you received: 1
12 years 8 months ago #43024

Voila pour le code

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


Agence web e-commerce spécialiste Hikashop
Last edit: 12 years 8 months ago by toffffe.

Please Log in or Create an account to join the conversation.

  • Posts: 2639
  • Thank you received: 66
  • Hikashop Business
12 years 8 months ago #43025

ton debut de fichier :

/*@package ect...*/
defined('_JEXEC') or die('Restricted access');

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


?>
<div style="background-color: #ffffff; font-family: Verdana, Arial, Helvetica, sans-serif;font-size:12px; color: #000000; width: 100%;">
ect .....

ça devrait etre bon

et bien sur tu vas dans admin > extension > gestion des langues > substitutions > 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: 12 years 8 months ago by erickb.

Please Log in or Create an account to join the conversation.

  • Posts: 318
  • Thank you received: 1
12 years 8 months ago #43039

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 or Create an account to join the conversation.

  • Posts: 2639
  • Thank you received: 66
  • Hikashop Business
12 years 8 months ago #43040

essaye ce code


$user =& JFactory::getUser();
$userid = $user->id;

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

Last edit: 12 years 8 months ago by erickb.

Please Log in or Create an account to join the conversation.

  • Posts: 318
  • Thank you received: 1
12 years 8 months ago #43041

Toujours pareils : no_orders


Agence web e-commerce spécialiste Hikashop

Please Log in or Create an account to join the conversation.

  • Posts: 2639
  • Thank you received: 66
  • Hikashop Business
12 years 8 months ago #43044

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

les changements du fichier d'origine en gras

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

Last edit: 12 years 8 months ago by erickb.

Please Log in or Create an account to join the conversation.

  • Posts: 318
  • Thank you received: 1
12 years 8 months ago #43045

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 or Create an account to join the conversation.

  • Posts: 2639
  • Thank you received: 66
  • Hikashop Business
12 years 8 months ago #43046

oui en ce cas

SELECT COUNT(`order_id`) AS total_orders FROM `#__hikashop_order` WHERE order_status LIKE 'Expediée' AND `order_user_id` = ' . $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( `order_id` ) AS total_orders
FROM `#__hikashop_order`
WHERE (
order_status LIKE 'Expediée'
OR order_status LIKE 'Confirmée'
)
AND `order_user_id` = ?

Last edit: 12 years 8 months ago by erickb.

Please Log in or Create an account to join the conversation.

  • Posts: 318
  • Thank you received: 1
12 years 8 months ago #43047

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


Agence web e-commerce spécialiste Hikashop

Please Log in or Create an account to join the conversation.

  • Posts: 2639
  • Thank you received: 66
  • Hikashop Business
12 years 8 months ago #43048

il faut remplacer la ligne

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

par

$q ='SELECT COUNT(`order_id`) AS total_orders FROM `#__hikashop_order` WHERE order_status LIKE 'Expediée' AND `order_user_id` =' . $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: 12 years 8 months ago by erickb.

Please Log in or Create an account to join the conversation.

  • Posts: 318
  • Thank you received: 1
12 years 8 months ago #43049

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 or Create an account to join the conversation.

  • Posts: 2639
  • Thank you received: 66
  • Hikashop Business
12 years 8 months ago #43050

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


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

ou bien


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

Last edit: 12 years 8 months ago by erickb.
The following user(s) said Thank You: toffffe

Please Log in or Create an account to join the conversation.

  • Posts: 318
  • Thank you received: 1
12 years 8 months ago #43151

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 or Create an account to join the conversation.

  • Posts: 2639
  • Thank you received: 66
  • Hikashop Business
12 years 8 months ago #43160

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

Please Log in or Create an account to join the conversation.

Time to create page: 0.109 seconds
Powered by Kunena Forum