Use this shortcode to show a store/location selector for a specific WooCommerce product. It supports multiple layouts and an optional custom label.
Syntax
[mulopimfwc_location_selector]
Parameters
| Name | Type | Default | Accepted values | Description |
|---|---|---|---|---|
product_id | int | (auto-detected) | any valid product ID | Product to render the selector for. Optional on single product pages and product loops (auto-detected). |
layout | enum | buttons | list | buttons | select | Visual style of the selector. |
label | text | Select Location: | any string | Text label shown before the selector. |
On single product pages and in product loops, the plugin automatically detects the product ID; you only need
product_idwhen placing the shortcode on non-product pages (e.g., CMS pages, sidebars, Elementor sections, etc.).
Examples
1) Auto-detect on a single product page
[mulopimfwc_location_selector]
2) Buttons layout with custom label
[mulopimfwc_location_selector layout="buttons" label="Choose Store:"]
3) Dropdown (select) layout
[mulopimfwc_location_selector layout="select" label="Deliver from:"]
4) List layout
[mulopimfwc_location_selector layout="list" label="Pick-up location:"]
5) Target a specific product (for non-product pages)
[mulopimfwc_location_selector product_id="123" layout="buttons" label="Select Location:"]
6) Use inside a PHP template
echo do_shortcode('[mulopimfwc_location_selector product_id="123" layout="select" label="Ship from:"]');
7) Use in Elementor / Block editor
- Elementor: add a Shortcode widget → paste your shortcode.
- Block editor: add a Shortcode block → paste your shortcode.
Behavior & Notes
- Auto-detection: On single product pages and standard product loops, the plugin resolves
product_idautomatically. - Location-aware cart rules: If your store disallows mixed-location carts, the selector will enforce that setting when customers switch locations (removing unavailable items as configured).
- Visibility: If a product has no location-specific inventory/settings, the selector may hide itself (or render a generic state) depending on your plugin settings.
- Styling: The output includes semantic classes (e.g.,
.mulopimfwc-location-selector,.layout-buttons,.layout-select) so you can style it via CSS. - Performance: The selector uses safe AJAX endpoints and nonces to fetch/update availability without reloading the page.
That’s it—drop the shortcode where you need it, pick a layout, and you’re good to go.