Integrate with WooCommerce output safely

POM Tweaks exposes feature-specific integrations rather than one general WooCommerce API. Confirm the target product type, cart implementation, and enabled tweak before consuming one.

Product and dependency boundaries

  • [price_per_unit] needs WooCommerce, the enabled Price per unit tweak, a product page, and saved unit metadata.
  • [pomatio_tweaks_wc_availability_search] needs WooCommerce Bookings and the enabled modern availability finder.
  • pom_tweaks_get_terms_url() needs WooCommerce and the enabled product-specific terms module.
  • PDF catalog filters run only while the PDF catalog module and WooCommerce are active.

Guard optional calls:

if ( function_exists( 'pom_tweaks_get_terms_url' ) ) {
    $terms_url = pom_tweaks_get_terms_url( $product );
}

Classic Checkout and Checkout Block

Product-specific terms publishes Store API data and validates acceptance for Checkout Block as well as Classic Checkout. By contrast, classic checkout-hook content and classic field filters depend on their corresponding WooCommerce PHP locations and should not be assumed to appear in Checkout Block.

When extending a checkout integration:

  1. identify Classic Checkout, Checkout Block, or both;
  2. test guest and authenticated customers;
  3. test simple and variable products;
  4. test cart recalculation, taxes, coupons, shipping, and gateways;
  5. inspect the created order and its emails;
  6. repeat with the POM Tweaks feature disabled.

Output and cache behavior

Escape helper results with esc_url() before using them in links. Shortcodes return HTML and should be rendered through normal WordPress shortcode processing rather than called as PHP functions.

Booking availability is an indexed view, not a reservation. Do not cache its result as a permanent promise of availability. The booking product form remains authoritative.