Black Friday & Cyber Monday SUPER SALE ALL WEEK:
Grab 40% OFF on plugins
Days
Hours
Minutes
Seconds

How to Add Your Store Address for Local Pickup on WooCommerce Thank You Page?

Looking to display your store address for local pickup on the thank you page after a customer places an order? Use the code snippet below to make it happen!

function ts_local_pickup_thank_you_page_address( $order_id ) {
    $order = wc_get_order( $order_id );

	$order_methods = array_map( function( $shipping ) { return $shipping->get_method_id(); }, $order->get_shipping_methods() );
	if ( in_array( 'local_pickup', $order_methods ) ) {
		?><h2>Store address</h2>
		<p>You can pickup your order at the following address 12 hours after ordering.</p>
		<p>
		23 Wani Peth<br/>
		Mahad Naka, Khed<br/>
		India<br/>
		+91 999XXX4500
		</p><?php
	}
}
add_action( 'woocommerce_thankyou', 'ts_local_pickup_thank_you_page_address' );

Output

The store address has been added below the billing address on the order received page only when the ‘local pickup’ method is chosen by the customer.

How to Add Your Store Address for Local Pickup on WooCommerce Thank You Page? - Tyche Softwares

Additionally, if you want to display personalized messages based on the shipping method, you can add a custom message on the WooCommerce thank you page based on the shipping method

Browse more in: Code Snippets, WooCommerce How Tos, WooCommerce Tutorials

Share It:

Subscribe
Notify of
0 Comments
Newest
Oldest
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x