Location Selector (per-product shortcode)

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

NameTypeDefaultAccepted valuesDescription
product_idint(auto-detected)any valid product IDProduct to render the selector for. Optional on single product pages and product loops (auto-detected).
layoutenumbuttonslist | buttons | selectVisual style of the selector.
labeltextSelect Location:any stringText label shown before the selector.

On single product pages and in product loops, the plugin automatically detects the product ID; you only need product_id when 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_id automatically.
  • 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.