@webmoments, ChatGPT give you a path to try, let me know how it goes:
To address this issue, you may need to customize the WooCommerce email template. Please note that modifying code requires some technical expertise, and it’s always a good idea to backup your website before making any changes. Here are the general steps you can take:
- Identify the Email Template: Find the email template responsible for the order email. WooCommerce uses templates to generate emails, and you can customize them based on your needs.
- Access the WooCommerce Email Templates: Navigate to your WordPress theme directory, and look for a folder named
woocommerce
. Inside this folder, there should be another folder named emails
. This is where the email templates are stored.
- Locate the Order Email Template: Look for the template file related to the order email. It is likely named something like
customer-processing-order.php
or customer-completed-order.php
.
- Edit the Template: Open the identified template file in a code editor. Look for the section that outputs the shipping, payment, and order total lines. You may need to find the loop that goes through each item and modify it to display these lines only once.For example, you might need to move the lines outside the loop or add a conditional statement to display them only once. Here’s a simplified example:
foreach ( $order->get_items() as $item_id => $item ) {
// Output individual item details here.
}
// Move or add lines to display shipping, payment, and order total once.
echo '<tr><td colspan="2">Shipping:</td><td>' . $order->get_shipping_method() . '</td></tr>';
echo '<tr><td colspan="2">Payment Method:</td><td>' . $order->get_payment_method() . '</td></tr>';
// ... other lines ...
- Testing: After making changes, save the file and test by placing an order with multiple items to see if the issue is resolved. Ensure that the lines for shipping, payment, and order total only appear once.
Remember to consider updating these changes when your WooCommerce plugin or theme receives updates, as they might overwrite your customizations. It’s advisable to use a child theme or a custom plugin for such modifications to ensure they persist through updates.
-
This reply was modified 10 months, 2 weeks ago by Rok Megli?.