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.

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:

Leave a Reply

Your email address will not be published. Required fields are marked *

Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible.

Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

By using our site, you acknowledge that you have read and understood our Privacy Policy and Terms & Conditions.