Available Shortcodes

How to use and customize shortcodes with WooCommerce Warehouses

Written by the MyWorks Team

Updated at June 28th, 2023

As part of customizing WooCommerce Warehouses to work specifically for your site/scenario needs, we have made available several different shortcodes that allow you to add specific functionality on the front-end of your site - mainly around allowing the user to set their location to be used when browsing the site.

Don't see a shortcode here that fits precisely what you're looking to accomplish? Custom development is available to customize a specific shortcode for your scenario.

[multilocation_zipcode]

This shortcode outputs a title, text box and submit button, which can be used for the user to enter their zip code. This zip code is stored in their session for the remainder of their session, and used to display relevant inventory levels as they browse products on the site - if inventory geolocation is enabled.

[multilocation_zipcode_status]

This shortcode outputs a text string, that will link to a popup, which allows the user to enter their zip code. This zip code is stored in their session for the remainder of their session, and used to display relevant inventory levels as they browse products on the site - if inventory geolocation is enabled.

[user_closest_location message="You are only"]

This shortcode outputs a customizable message, along with the distance the visitor is away from the closest calculated location. An additional sentence is shown, that allows you to link to a custom page with all your locations.

This calculated distance can be set by automatically determining their location via GEOIP, asking their browser to share their location, or asking them to enter a zip code on the site.

[locations_dropdown]

This shortcode outputs a dropdown of all locations on the front-end of the site – allowing a user to select/choose which location they’d like to browse on the site. Once chosen, they would only see products/inventory levels for that specific location.

[selected_location]

This shortcode shows the name of the warehouse currently being browsed on the front-end of the site in plain text. This can be used anywhere on the site to show the warehouse presently being browsed.