Use the supported shortcodes
POM Tweaks registers two public shortcodes. Neither accepts attributes, and each exists only while its corresponding feature is enabled.
[price_per_unit]
Enable Price per unit under Settings → POM Tweaks → E-Commerce → Products. Save the product's Number of units, Name of the unit and optional Reference quantity under Product data → General. Place this unchanged, attribute-free shortcode in content rendered on a single WooCommerce product:
[price_per_unit]
It returns a .pom-unit-pricing wrapper containing the historical .total-units-price and .unit-price elements; Unit price only omits the total element. Amounts use WooCommerce currency formatting and the customer's storefront tax display. The comparison is displayed price / number of units × reference quantity, with reference quantity 1 by default.
It returns an empty string outside a product page, for grouped products, or for invalid/missing quantity, unit or price. Variable products initially render an empty hidden wrapper; the classic variation form fills it from woocommerce_available_variation and hides it again on reset. The historical number_of_units and name_of_the_unit variation payload keys remain available. Custom price replacements without standard numeric WooCommerce price markup suppress the comparison.
Existing product metadata is retained. Variation fields can override each parent value independently; a blank field inherits that value. Automatic placement and shortcode placement should not both be used for the same location.
[pomatio_tweaks_wc_availability_search]
Enable Enhanced availability finder under Settings → POM Tweaks → E-Commerce → Products. WooCommerce Bookings must be active.
[pomatio_tweaks_wc_availability_search]
The shortcode renders one date input and a results container. Its script retrieves indexed availability, displays eligible published booking products and time slots, and links the selected date and time to the product form.
Use one finder instance per page. The current markup uses one date-input identifier and one results container, so multiple instances are not an independent-widget contract.
Verify shortcode output
- Confirm
shortcode_exists()returns true only while the feature is active. - Render
[price_per_unit]on a configured product and on a normal page. - Render the booking finder, choose a date, and follow one result.
- Confirm the destination booking form selects the intended date and available slot.
- Disable the feature and confirm WordPress no longer receives its shortcode registration.
For detailed customer configuration, see Compare products by price per unit and Add a WooCommerce Bookings availability finder.