Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WCFM – Marketplace (WooCommerce Multivendor Marketplace) › About update 2.1.0
- This topic has 43 replies, 2 voices, and was last updated 5 years, 9 months ago by WCFM Forum.
- AuthorPosts
- January 16, 2019 at 12:41 pm #43921JoseParticipant
Hi,
In the last update log said:
Enhance – For Local pickup shipping store address added as pickup address
Could you explain how this change is reflected? In which part can the customer see the vendor’s address?
Thank you,
- January 16, 2019 at 1:03 pm #43922WCFM ForumMember
- January 16, 2019 at 1:15 pm #43924JoseParticipant
Hi,
Thanks, and I see
In my country the invoice simply sent by the store is not valid (the case shown by you.) We require an electronic invoice, endorsed by the internal tax service of my country.
Would you appreciate if you can add it to notifications when the status is complete?Best regards,
Attachments:
You must be logged in to view attached files. - January 17, 2019 at 3:05 pm #44102WCFM ForumMember
Hi,
“wc-frontend-manager-ultimate\views\vendor_invoice\store-invoice.php” – this is the invoice template, you may edit and change to as per your requirement.
But before edit you have to override this to – “child theme\wcfm\vendor_invoice\store-invoice.php”
Thank You
- January 17, 2019 at 3:12 pm #44105JoseParticipant
Thanks for your advice, but we can’t use a personal invoice, I need a certificate company that sell a system to send electronic invoice with a number that my Tax office supervises.
https://www.edicomgroup.com/en_US/solutions/einvoicing/LATAM_einvoicing/chilean_einvoicing.html
So in my implementation just need notification about damage in delivery, tracking and of course pickup address if choose that.
Thanks and regards,
- January 17, 2019 at 4:58 pm #44136WCFM ForumMember
Hi,
I am not not very familer withhow such invoice can be generated!
You may check this “wc-frontend-manager-ultimate\views\vendor_invoice\store-invoice.php” template to get all such informations “delivery, tracking and of course pickup address”
Thank You
- January 17, 2019 at 5:04 pm #44140JoseParticipant
Hi,
Don’t worry, I don’t have problem with that. You, me or others can’t modified the electronic invoice that my country have.
So, Just want to add the store address when choose local pick up in the traditional notification email when status are completed.
Regards,
- January 17, 2019 at 5:10 pm #44141WCFM ForumMember
Hi,
We have already added “Pickup Address” in last update.
Thank You
- January 17, 2019 at 5:16 pm #44143JoseParticipant
Really ?, need to check again. Was the origin of this topic. You answer that only are in the store invoice, that is different to the notification email.
Regards,
- January 17, 2019 at 5:38 pm #44151WCFM ForumMember
HI,
Please show me screenshot, where you want to show this to your customers?
Thank You
- January 17, 2019 at 5:51 pm #44153JoseParticipantThis reply has been marked as private.
- January 18, 2019 at 5:05 am #44187WCFM ForumMember
Hi,
OK, but what if a customer purchase from different vendors?
Thank You
- January 18, 2019 at 1:54 pm #44252JoseParticipant
Hi,
You are right ! I Don’t know if we talk about that time ago.
But, if someone buys from different suppliers, can each supplier change the status of the order?
So if it can be done, does it mean that you send an independent notification from the other vendor?
So it would be possible to add the information of the address of the store?Regards,
- January 19, 2019 at 5:38 am #44310WCFM ForumMember
Hi,
But, if someone buys from different suppliers, can each supplier change the status of the order?
– yes, but you may disable from capability. Also you may decide whether main order status change or not by vendor’s status update.
There is a setting for this at WCFM Admin Setting -> Marketplace -> Order SyncSo if it can be done, does it mean that you send an independent notification from the other vendor?
– Yes off courseSo it would be possible to add the information of the address of the store?
– Then it will best to add with order items.Thank You
- February 4, 2019 at 4:42 pm #46586JoseParticipantThis reply has been marked as private.
- February 5, 2019 at 5:34 am #46671WCFM ForumMember
Hi,
In the second capture, I add a red arrow about tracking, but if are a local pickup, don’t need this one ?
– Yeah right, we will take care of this.
Thank You
- February 26, 2019 at 3:47 pm #50192JoseParticipant
Hi, I would like to update this topic because we need to have the local pickup address in some email to the customer. And the best moment are when the order are complete.
Thank you and regards,
- February 26, 2019 at 5:07 pm #50214WCFM ForumMember
Hi,
For Local Pickup vendor address goes to customer with Store Invoice.
Thank You
- February 26, 2019 at 6:21 pm #50222JoseParticipant
Hi, maybe you don’t remember but in my country It has no legal validity the invoice that made woocommerce or other plugins. We need another type of invoice that we made with external companies that implement the generation of the invoice from the web and they are validated by the government.
They come with a special bar code and with a numbered. Please see a example in attach.
This is why I ask and you answered above about the place to put the local pickup address when the order are complete.
https://wclovers.com/forums/topic/about-update-2-1-0/#post-44151Attachments:
You must be logged in to view attached files. - February 26, 2019 at 8:20 pm #50236JoseParticipant
I have a Idea, I hope you can help me.
What about to put data with this:
add_action( ‘woocommerce_email_before_order_table’, ‘bbloomer_add_content_specific_email’, 20, 4 );
function bbloomer_add_content_specific_email( $order, $sent_to_admin, $plain_text, $email ) {
if ( $email->id == ‘customer_completed_order’ ) {
echo ‘<h2 class=”email-upsell-title”>Your order are ready to pickup from here:</h2>’;
}
}I know that need to add more code. (local pickup address of the specific store)
thank you
- February 27, 2019 at 10:01 am #50329WCFM ForumMember
Hi,
It’s not possible to fetch shipping package information within this hook.
Thank You
- February 27, 2019 at 12:00 pm #50367JoseParticipant
Hi,
But I’m not talking about the shipping package. I talk about entering the information of the store address for local pickup the customer.
Like a bank transfer that the email have all info about bank, number, etc.
Thank you.
- February 27, 2019 at 12:19 pm #50375WCFM ForumMember
HI,
“local pickup” – this is part of Shipping Package.
Thank You
- February 27, 2019 at 12:26 pm #50377WCFM ForumMember
Check this, pick location is part of shipping packages – https://ibb.co/XpMjRCp
- February 27, 2019 at 1:56 pm #50401JoseParticipant
Ok, now I understand what you said.
My hook was only a example, I’m sure that you know a better option to try to put this info.
Maybe It’s better this one, but need more code, because only show a message, not extract the info from store address:
add_action( ‘woocommerce_email_order_details’, ‘my_completed_order_email_instructions’, 10, 4 );
function my_completed_order_email_instructions( $order, $sent_to_admin, $plain_text, $email ) {
// Only for processing and completed email notifications to customer
if( ! ( ‘customer_processing_order’ == $email->id || ‘customer_completed_order’ == $email->id ) ) return;foreach( $order->get_items(‘shipping’) as $shipping_item ){
$shipping_rate_id = $shipping_item->get_method_id();
$method_array = explode(‘:’, $shipping_rate_id );
$shipping_method_id = reset($method_array);
// Display a custom text for local pickup shipping method only
if( ‘local_pickup’ == $shipping_method_id ){
echo ‘<p>Here we need a code to extract the store address</p>’;
break;
}
}
}Thank you
- March 1, 2019 at 3:50 pm #50785JoseParticipant
Hi,
I’m really need to share the store address when customer choose local pickup.
Maybe it’s more easy and don’t affect to others users if I use theme child to modify template for completed order email ?can you help me please with that ?
Thank you and Regards
- March 3, 2019 at 7:26 am #50925WCFM ForumMember
Hi,
add_action( ‘woocommerce_email_order_details’, ‘my_completed_order_email_instructions’, 10, 4 );
function my_completed_order_email_instructions( $order, $sent_to_admin, $plain_text, $email ) {
// Only for processing and completed email notifications to customer
if( ! ( ‘customer_processing_order’ == $email->id || ‘customer_completed_order’ == $email->id ) ) return;foreach( $order->get_items(‘shipping’) as $shipping_item ){
$shipping_rate_id = $shipping_item->get_method_id();
$method_array = explode(‘:’, $shipping_rate_id );
$shipping_method_id = reset($method_array);
// Display a custom text for local pickup shipping method only
if( ‘local_pickup’ == $shipping_method_id ){
echo ‘Here we need a code to extract the store address
’;
break;
}
}
}//////////////////////////////////////////////////////////////////////////////////////////////////////////////
Is this code working for you ? But you are able to fetch Store/Pickup address, right?
$shipping_meta = $shipping_item->get_formatted_meta_data();
Check in this “$shipping_meta”, Pickup address already there, hope you can print that.
Thank You
- March 3, 2019 at 2:02 pm #50956JoseParticipant
Hi,
Thank you for your answer !!
I have error here: $method_array = explode(‘:’, $shipping_rate_id );
Parse error: syntax error, unexpected ‘:’, expecting ‘,’ or ‘)’
Note: My own code was a example. I need only for customer_completed_order (I have trouble with the “if”, that don’t need it)
Thank you
- March 3, 2019 at 2:10 pm #50960JoseParticipant
I forget to ask…
I was thinking about the store address that you show in your store page demo.
It’s more complex to extract and show in my custom completed order email to customer, when customer have local pickup shipping ?
Thanks and regards,
Attachments:
You must be logged in to view attached files. - March 4, 2019 at 4:26 am #51021WCFM ForumMember
Hi,
Use code like this –
$shipping_items = $order->get_items('shipping'); foreach ($shipping_items as $shipping_item_id => $shipping_item) { $order_item_shipping = new WC_Order_Item_Shipping($shipping_item_id); $shipping_vendor_id = $order_item_shipping->get_meta('vendor_id', true); if($shipping_vendor_id > 0) { $pickup_address = $order_item_shipping->get_meta('pickup_address', true); echo "Pickup Address: " . $pickup_address; } }
- March 4, 2019 at 12:21 pm #51051JoseParticipant
Hi,
I really appreciate your answer, but I don’t know where tu put this code: Inside the “customer completed order email” or inside of Function.php ?
Thank you !!
- March 4, 2019 at 4:26 pm #51085WCFM ForumMember
Hi,
Where you had added your code?
Functions.php is fine for the purpose.Add there, I have just changed internal logic –
add_action( 'woocommerce_email_order_details', 'my_completed_order_email_instructions', 10, 4 ); function my_completed_order_email_instructions( $order, $sent_to_admin, $plain_text, $email ) { $shipping_items = $order->get_items('shipping'); foreach ($shipping_items as $shipping_item_id => $shipping_item) { $order_item_shipping = new WC_Order_Item_Shipping($shipping_item_id); $shipping_vendor_id = $order_item_shipping->get_meta('vendor_id', true); if($shipping_vendor_id > 0) { $pickup_address = $order_item_shipping->get_meta('pickup_address', true); echo "Pickup Address: " . $pickup_address; } } }
Thank You
- March 4, 2019 at 4:43 pm #51090JoseParticipant
Hi,
I need to say thanks so much again !!
Work !! but it’s too hard to print only in a completed order email to customer ?, because was printed in all the emails to vendor, admin and customer.
Just we need to show in the completed order email to customer. This is the reason when I ask you if are need it to put in function or in the custom email.
Best regards,
- March 4, 2019 at 4:48 pm #51092WCFM ForumMember
You are welcome 🙂
Well, previously you had used a condition check, use this and check.
// Only for processing and completed email notifications to customer
if( ! ( ‘customer_processing_order’ == $email->id || ‘customer_completed_order’ == $email->id ) ) return;Thank You
- March 4, 2019 at 5:00 pm #51093JoseParticipant
Hi,
Yes, you are right !! But, How can edit the condition check to allow only for customer completed order ?
Sorry, I can with css but with php, I’m newbie.
Thanks !!
- March 4, 2019 at 5:07 pm #51094WCFM ForumMember
Well, you may override this template and code there – https://ibb.co/XthprQv
Then it will be part of only customer complete order email.
Thank You
- March 4, 2019 at 5:17 pm #51104JoseParticipant
Hi,
Thanks but was resolved with that:
if( !‘customer_completed_order’ == $email->id ) return;
Now I’m leaving the newbie of php. 😉
Thanks a lot for your time, but was very important for us.
I think that with the next updates (translations !! you know) and this one I have more time to design and work with my proyect.
See you next topics (I have others issues)
Best regards,
Update: It’s not resolved, yes, I need to edit a custom email.
- March 4, 2019 at 5:50 pm #51105JoseParticipant
Sorry, I can’t add the code inside the custom email.
Can you please tell me what I need to add and how ?
thank you
- March 4, 2019 at 9:33 pm #51121JoseParticipant
Hi, maybe will be more fast if I share my custom email for completed order:
<?php /** * Customer completed order email * * This template can be overridden by copying it to yourtheme/woocommerce/emails/customer-completed-order.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/ * @package WooCommerce/Templates/Emails * @version 3.5.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; } /* * @hooked WC_Emails::email_header() Output the email header */ do_action( 'woocommerce_email_header', $email_heading, $email ); ?> <?php /* translators: %s: Customer first name */ ?> <p><?php printf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $order->get_billing_first_name() ) ); ?></p> <?php /* translators: %s: Site title */ ?> <p><?php printf( esc_html__( 'Your %s order has been marked complete on our side.', 'woocommerce' ), esc_html( wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ) ) ); ?></p> <?php /* * @hooked WC_Emails::order_details() Shows the order details table. * @hooked WC_Structured_Data::generate_order_data() Generates structured data. * @hooked WC_Structured_Data::output_structured_data() Outputs structured data. * @since 2.5.0 */ /* Show simple order detail */ if ( ! defined( 'ABSPATH' ) ) { exit; } $text_align = is_rtl() ? 'right' : 'left'; do_action( 'woocommerce_email_before_order_table', $order, $sent_to_admin, $plain_text, $email ); ?> <h2> <?php if ( $sent_to_admin ) { $before = '<a class="link" href="' . esc_url( $order->get_edit_order_url() ) . '">'; $after = '</a>'; } else { $before = ''; $after = ''; } /* translators: %s: Order ID. */ echo wp_kses_post( $before . sprintf( __( '[Order #%s]', 'woocommerce' ) . $after . ' (<time datetime="%s">%s</time>)', $order->get_order_number(), $order->get_date_created()->format( 'c' ), wc_format_datetime( $order->get_date_created() ) ) ); ?> </h2> <div style="margin-bottom: 40px;"> <table class="td" cellspacing="0" cellpadding="6" style="width: 100%; font-family: 'Segoe UI', Helvetica Neue, Helvetica, Roboto, Arial, sans-serif;" border="0"> <thead> <tr> </tr> </thead> <tbody> <?php echo wc_get_email_order_items( $order, array( // WPCS: XSS ok. 'show_sku' => $sent_to_admin, 'show_image' => true, 'image_size' => array( 64, 64 ), 'plain_text' => $plain_text, 'sent_to_admin' => $sent_to_admin, ) ); ?> </tbody> <tfoot> <?php $totals = $order->get_order_item_totals(); if ( $totals ) { $i = 0; foreach ( $totals as $total ) { $i++; ?> <tr> </tr> <?php } } if ( $order->get_customer_note() ) { ?> <tr> <th class="td" scope="row" colspan="2" style="text-align:<?php echo esc_attr( $text_align ); ?>;"><?php esc_html_e( 'Note:', 'woocommerce' ); ?></th> <td class="td" style="text-align:<?php echo esc_attr( $text_align ); ?>;"><?php echo wp_kses_post( wptexturize( $order->get_customer_note() ) ); ?></td> </tr> <?php } ?> </tfoot> </table> </div> /* Here I'm trying to put your code */ <p> <?php add_action( 'woocommerce_email_order_details', 'my_completed_order_email_instructions', 10, 4 ); function my_completed_order_email_instructions( $order, $sent_to_admin, $plain_text, $email ) { $shipping_items = $order->get_items('shipping'); foreach ($shipping_items as $shipping_item_id => $shipping_item) { $order_item_shipping = new WC_Order_Item_Shipping($shipping_item_id); $shipping_vendor_id = $order_item_shipping->get_meta('vendor_id', true); if($shipping_vendor_id > 0) { $pickup_address = $order_item_shipping->get_meta('pickup_address', true); echo "Pickup Address: " . $pickup_address; } } } ?> <p> /* End of your code * <p> <?php esc_html_e( 'Thanks for shopping with us.', 'woocommerce' ); ?> <p> <?php /* * @hooked WC_Emails::email_footer() Output the email footer */ do_action( 'woocommerce_email_footer', $email );
I test but don’t show anything about pickup address.
Regards,
- March 5, 2019 at 5:07 am #51148WCFM ForumMember
Hi,
Well, when you are adding directly in template then not require to use hooks. Pickup address visible like this – https://ibb.co/WxWDCQr
Template code will be look like this –
<?php /** * Customer completed order email * * This template can be overridden by copying it to yourtheme/woocommerce/emails/customer-completed-order.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/ * @package WooCommerce/Templates/Emails * @version 3.5.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; } /* * @hooked WC_Emails::email_header() Output the email header */ do_action( 'woocommerce_email_header', $email_heading, $email ); ?> <?php /* translators: %s: Customer first name */ ?> <p><?php printf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $order->get_billing_first_name() ) ); ?></p> <?php /* translators: %s: Site title */ ?> <p><?php printf( esc_html__( 'Your %s order has been marked complete on our side.', 'woocommerce' ), esc_html( wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ) ) ); ?></p> <?php /* * @hooked WC_Emails::order_details() Shows the order details table. * @hooked WC_Structured_Data::generate_order_data() Generates structured data. * @hooked WC_Structured_Data::output_structured_data() Outputs structured data. * @since 2.5.0 */ do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email ); /* * @hooked WC_Emails::order_meta() Shows order meta data. */ do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email ); /* * @hooked WC_Emails::customer_details() Shows customer details * @hooked WC_Emails::email_address() Shows email address */ do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email ); ?> <p> <?php $shipping_items = $order->get_items('shipping'); foreach ($shipping_items as $shipping_item_id => $shipping_item) { $order_item_shipping = new WC_Order_Item_Shipping($shipping_item_id); $shipping_vendor_id = $order_item_shipping->get_meta('vendor_id', true); if($shipping_vendor_id > 0) { $pickup_address = $order_item_shipping->get_meta('pickup_address', true); echo "Pickup Address: " . $pickup_address; } } ?> <p> <p> <?php esc_html_e( 'Thanks for shopping with us.', 'woocommerce' ); ?> </p> <?php /* * @hooked WC_Emails::email_footer() Output the email footer */ do_action( 'woocommerce_email_footer', $email );
- March 5, 2019 at 12:53 pm #51192JoseParticipantThis reply has been marked as private.
- March 6, 2019 at 8:33 am #51332WCFM ForumMember
Hi,
Change this part –
<?php $shipping_items = $order->get_items('shipping'); foreach ($shipping_items as $shipping_item_id => $shipping_item) { $order_item_shipping = new WC_Order_Item_Shipping($shipping_item_id); $shipping_vendor_id = $order_item_shipping->get_meta('vendor_id', true); $method_slug= $order_item_shipping->get_meta('method_slug', true); if( ( $method_slug == 'local_pickup' ) && $shipping_vendor_id > 0) { $pickup_address = $order_item_shipping->get_meta('pickup_address', true); echo "Pickup Address: " . $pickup_address; } } ?>
Thank You
- March 6, 2019 at 1:46 pm #51374JoseParticipant
Hi,
Resolved the topic.
That’s what I need it !! Working perfect and just to need thaks you so much !!
Amazing support !!
Best regards,
- March 6, 2019 at 4:53 pm #51393WCFM ForumMember
You are welcome 🙂
- AuthorPosts
- The topic ‘About update 2.1.0’ is closed to new replies.