WCMp Core
-
AuthorPosts
-
-
June 4, 2021 at 8:03 PM #122645raoulParticipant
My vendor-new-order emails currently show Product, Quantity and Price columns. I would like the automated vendor-new-order email to only include the Product name and the quantity. I would also like to remove the ‘Subtotal’ and ‘Total’ fields at the bottom.
This is because I offer discounts to my customers but still pay the vendors the full amounts. Currently the price shown to the vendor is the discounted price and vendors assume I am not paying them the full amount. For this reason I simply want to display the list of products that have been ordered and the quantity of each product. If there is a code snippet that can do this that would be amazing!
Thanks
-
June 7, 2021 at 5:19 PM #122716NerdySupportExpert MoumitaKeymaster
Hi raoul, thanks for your query.
As you want to remove some fields from vendor new order mail. So for this, you have to override the vendor-new-order.php template.
In order to override vendor-new-order.php, copy it to yourtheme/dc-product-vendor/emails/vendor-new-order.phpThis link is the code of our template : https://github.com/wcmarketplace/dc-woocommerce-multi-vendor/blob/master/templates/emails/vendor-new-order.php
-
June 7, 2021 at 5:33 PM #122719raoulParticipant
Hi there,
Thanks for the reply. Actually, I have already copied the template and overriden it for my vendor email as I have some custom copy at the top.
I am hoping to understand how I can specifically remove the price column as shown in my screenshot. Can I just remove the sections relevant to price? i.e. if I remove the if loop ‘if (apply_filters(‘show_cust_order_calulations_field’, true, $vendor->id))’ and I remove the column heading ‘<th scope=”col” style=”text-align:<?php echo $text_align; ?>; border: 1px solid #eee;”><?php _e(‘Commission’, ‘dc-woocommerce-multi-vendor’); ?></th>’ > will that remove all cost information from the email?
Thanks
-
June 8, 2021 at 8:18 PM #122814Raju The Cool GuyKeymaster
Hi,
Vendor new order mail has no price label. There is a commission filed. attached. So, are you referring to this template or another? -
June 8, 2021 at 8:24 PM #122821raoulParticipant
Apologies, I mean the commission column, not price (reason I said price is because I changed the label from ‘commission’ to ‘price).
So to confirm my request I would like to remove:
1) the ‘commission’ column as shown in your screenshot
2) ‘Subtotal’, ‘Shipping subtotal’ and ‘Total’ from the bottom of the emailThanks
-
June 9, 2021 at 7:17 PM #122855Raju The Cool GuyKeymaster
Hi,
Remove all your custom code and just follow my instruction —
1. Use this below code in your currently active theme functions.php file to remove shipping subtotal and totaladd_filter('wcmp_vendor_get_order_item_totals', function($order_item_totals, $order, $vendor) { unset($order_item_totals['shipping_subtotal'], $order_item_totals['total']); return $order_item_totals; }, 10, 3);
Copy2. override vendor-new-order.php this template in your theme/ plugin
2.a. remove line no 28
2.b. replace line no 34 ( $vendor->vendor_order_item_table … ) with this below code$vendor_items = $order->get_items( 'line_item' ); foreach ($vendor_items as $item_id => $item) { $product = $item->get_product(); $_product = apply_filters('wcmp_woocommerce_order_item_product', $product, $item); ?> <tr class=""> <td scope="col" style="text-align:left; border: 1px solid #eee;" class="product-name"> <?php if ($_product && !$_product->is_visible()) { echo apply_filters('wcmp_woocommerce_order_item_name', $item->get_name(), $item); } else { echo apply_filters('woocommerce_order_item_name', sprintf('<a href="%s">%s</a>', get_permalink($item->get_product_id()), $item->get_name()), $item); } wc_display_item_meta($item); ?> </td> <td scope="col" style="text-align:left; border: 1px solid #eee;"> <?php echo $item->get_quantity(); ?> </td> </tr> <?php }
CopyEnjoy 🙂
Thanks -
July 31, 2021 at 3:21 PM #125751raoulParticipant
Hey, thanks so much for the code, it almost all works.
The only bit I can still see is the ‘subtotal’ of the order. I put in the below code but the subtotal is still showing on the email. Am I doing something wrong?
add_filter(‘wcmp_vendor_get_order_item_totals’, function($order_item_totals, $order, $vendor) {
unset($order_item_totals[‘shipping_subtotal’], $order_item_totals[‘total’], $order_item_totals[‘subtotal’]);
return $order_item_totals;
}, 10, 3); -
July 31, 2021 at 5:31 PM #125754MVX Support NinjaKeymaster
Hello @Raoul , hope you are doing well.
We have forwarded this to our developer . Kindly provide them some time. They will help you out . -
August 2, 2021 at 6:43 PM #125792MVX Support NinjaKeymaster
Hi,
WCMp New order mail has ‘Commission Subtotal’, ‘Tax Subtotal’ and ‘Shipping Subtotal’.Checkout the below image –
To remove Commission Subtotal use –
$order_item_totals['commission_subtotal']
CopyTo remove Tax Subtotal use –
$order_item_totals['tax_subtotal']
CopyRegards,
-
-
AuthorPosts
The topic ‘Remove product price from vendor-new-order emails’ is closed to new replies.