WooCommerce, ajouter “Nombre total d'article”
Bonsoir la communauté,
Je viens souvent ici pour vous lire mais jamais pour poser des questions. Mais maintenant, j'ai besoin d'aide car je ne trouve pas ce que je veux.
Je m'explique, mon client souhaite avoir dans le mail qu'il reçoit intitulé “ Nouvelle commande ”

Au niveau de cet endroit, ajouter une colonne “ nombre total d'article vendu ”. Il doit bien y avoir une ligne de code qui existe mais je ne trouve vraiment pas.
Merci à vous.
Vous pouvez personnaliser le contenu de cet e-mail dans le fichier emails/email-order-details.php.
Et pour connaitre le nombre de produits c'est ce code :
$nombre = $order->get_item_count( apply_filters( 'woocommerce_admin_order_item_types', 'line_item' ) );
Merci Mathieu pour votre réponse, alors j'ai bien trouvé le fichier mais je ne sais pas où le placer...
<?php
/**
* Order details table shown in emails.
*
* This template can be overridden by copying it to yourtheme/woocommerce/emails/email-order-details.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @see https://docs.woocommerce.com/document/template-structure/
* @author WooThemes
* @package WooCommerce/Templates/Emails
* @version 3.0.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
$text_align = is_rtl() ? 'right' : 'left';
do_action( 'woocommerce_email_before_order_table', $order, $sent_to_admin, $plain_text, $email ); ?>
<?php if ( ! $sent_to_admin ) : ?>
<?php printf( __( 'Order #%s', 'woocommerce' ), $order->get_order_number() ); ?>
<?php else : ?>
get_id() . '&action=edit' ) ); ?>"><?php printf( __( 'Order #%s', 'woocommerce' ), $order->get_order_number() ); ?> (<?php printf( '<time datetime="%s">%s</time>', $order->get_date_created()->format( 'c' ), wc_format_datetime( $order->get_date_created() ) ); ?>)
<?php endif; ?>
| ;"><?php _e( 'Product', 'woocommerce' ); ?> | ;"><?php _e( 'Quantity', 'woocommerce' ); ?> | ;"><?php _e( 'Price', 'woocommerce' ); ?> |
|---|---|---|
| ; <?php echo ( 1 === $i ) ? 'border-top-width: 4px;' : ''; ?>"><?php echo $total['label']; ?> | ; <?php echo ( 1 === $i ) ? 'border-top-width: 4px;' : ''; ?>"><?php echo $total['value']; ?> |
<?php do_action( 'woocommerce_email_after_order_table', $order, $sent_to_admin, $plain_text, $email ); ?>
- 10 Forums
- 7,342 Sujets
- 22.7 K Publications
- 2 En ligne
- 86.1 K Membres
