WooFrance Dépannage et support WordPress WooCommerce › Forums › Forum de Support WooCommerce › WooCommerce, ajouter “Nombre total d'article”
- Ce sujet contient 2 réponses, 2 participants et a été mis à jour pour la dernière fois par
Klø DBR, le il y a 7 années et 7 mois.
-
AuteurMessages
-
22 septembre 2017 à 15 h 37 min #5912
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' ) );
====================Développeur PHP et WordPress En Alsace dans l'annuaire des prestataires WordPress et WooCommerce
Création d'extensions pour WordPress et WooCommerce - Personnalisation d'extensions existantes
🔶 Si vous appréciez mon aide, vous pouvez me faire un don de n'importe quel montant en cliquant ici.
22 septembre 2017 à 20 h 50 min #5925Merci 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' ); ?>
'show_sku' => $sent_to_admin,
'show_image' => false,
'image_size' => array( 32, 32 ),
'plain_text' => $plain_text,
'sent_to_admin' => $sent_to_admin,
) ); ?>
<?php
if ( $totals = $order->get_order_item_totals() ) {
$i = 0;
foreach ( $totals as $total ) {
$i++;
?>; <?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
}
}
?>
<?php do_action( 'woocommerce_email_after_order_table', $order, $sent_to_admin, $plain_text, $email ); ?>
====================
1 user thanked author for this post.
-
AuteurMessages
- Vous devez être connecté pour répondre à ce sujet.