Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WCFM – Marketplace (WooCommerce Multivendor Marketplace) › store new order mail
Tagged: mail
- This topic has 6 replies, 3 voices, and was last updated 5 years, 1 month ago by WCFM Forum.
- AuthorPosts
- October 12, 2019 at 4:15 pm #86528CommunityCoralsParticipant
Hello,
in the past I used the standard woocommerce mail as store new order mail for the vendors. Here I have 2 issues.
1. All vendors get same mail and see order from other vendors
2. The SKU number is not shown to vendor in the mailThree issues with the WCFM vendor store new order template:
1. Shipping is not shown if shipping cost goes to admin
2. The fees are displayed in this email
3. No payment type shownIs it possible to tweak store new order mail to look like woocommerce mail but address the mentioned issues?
Thanks
Dominique - November 2, 2019 at 7:39 pm #90312daniel.oizumiParticipant
Hi,
I have a similar problem with mixed orders from different vendors. This was happening on the New Order Email and on the Order Dashboard of the Marketplace.I fixed the problem removing this part of the code “|| in_array( $value->get_id(), $valid_items )” on the wc-frontend-manager\core\class-wcfm-wcfmmarketplace.php file.
Line 406
// Filter Order Details Line Items as Per Vendor
function wcfmmp_valid_line_items( $items, $order_id ) {
global $WCFM, $wpdb;$sql = “SELECT product_id, item_id FROM {$wpdb->prefix}wcfm_marketplace_orders WHERE vendor_id = {$this->vendor_id} AND order_id = {$order_id}”;
$valid_products = $wpdb->get_results($sql);
$valid_items = array();
if( !empty($valid_products) ) {
foreach( $valid_products as $valid_product ) {
$valid_items[] = $valid_product->item_id;
$valid_items[] = $valid_product->product_id;
}
}$valid = array();
foreach ($items as $key => $value) {
if ( in_array( $value->get_variation_id(), $valid_items ) || in_array( $value->get_product_id(), $valid_items ) ) {
$valid[$key] = $value;
} elseif( $value->get_product_id() == 0 ) {
$_product_id = wc_get_order_item_meta( $key, ‘_product_id’, true );
if ( in_array( $_product_id, $valid_items ) ) {
$valid[$key] = $value;
}
}
}
return $valid;
}Could you let me know if this fixes your problema? Also, I would like to implement this fix on my function.php. Would you know how?
- November 3, 2019 at 2:50 am #90354daniel.oizumiParticipant
?
- November 3, 2019 at 10:25 pm #90498daniel.oizumiParticipant
Sorry, I also had to change the SQL Query.
from:
$sql = “SELECT product_id, item_id FROM {$wpdb->prefix}wcfm_marketplace_orders WHERE vendor_id = {$this->vendor_id} AND order_id = {$order_id}”;to:
$sql = “SELECT product_id FROM {$wpdb->prefix}wcfm_marketplace_orders WHERE vendor_id = {$this->vendor_id} AND order_id = {$order_id}”;and change this as well
from:
foreach( $valid_products as $valid_product ) {
$valid_items[] = $valid_product->item_id;
$valid_items[] = $valid_product->product_id;
}to:
foreach( $valid_products as $valid_product ) {
//$valid_items[] = $valid_product->item_id;
$valid_items[] = $valid_product->product_id;
} - November 6, 2019 at 4:32 pm #91112WCFM ForumMember
HI,
Is this order placed by an user who is also a vendor for the site?
Thank You
- November 6, 2019 at 5:08 pm #91132daniel.oizumiParticipant
Hi, thank you for the replay.
If you are talking about the mixed items on New Order Email that is sent to vendors. No. They are placed from a client account. No vendor role associated to their account.
Thanks!
- November 11, 2019 at 6:35 pm #91823WCFM ForumMember
OK, thanks for the info.
We are debugging this.
- AuthorPosts
- The topic ‘store new order mail’ is closed to new replies.