Skip to content

Developer reference

Shortcodes and template placement

Render the configurator, description, starting price and artwork controls once in an appropriate template.

PressFlow 1.25.3 · 2 min read

Guide source reviewed for PressFlow 1.25.1.

Use a page/template that provides enough width for the configurator. Do not insert it inside an existing add-to-cart form or the same product's main description.

Shortcode reference

ShortcodeAttributesBehavior
[pressflow_configurator]product_id="123"; show_description="yes" or "no"Current/explicit managed product configurator, with the main description subject to placement.
[pressflow_product_content]product_id="123"Main WooCommerce description only; explicit content placement, access guarded.
[pressflow_from_price]product_id="123"Genuine starting-job price, or quote/configure label.
[pressflow_artwork]No supported attributesArtwork hub for the relevant cart/checkout context; not arbitrary order access.

Without an ID, configurator and product-content shortcodes try the global product then the current post ID. Starting price uses the global WooCommerce product. An unrelated page normally needs an explicit product ID.

Product template with separate content

[pressflow_configurator product_id="123" show_description="no"]

[pressflow_product_content product_id="123"]

Replace the example ID. Choose theme/template description placement if your template already owns Product Content. PressFlow avoids rendering the same product's configurator or main description twice in one request. Its own product-rendering shortcodes are stripped from description rendering to prevent recursion.

Default classic placement is woocommerce_after_single_product_summary, priority 5, with PFW_Store::single. If your custom template deliberately supplies the configurator elsewhere, remove that callback after plugin boot:

<?php
defined('ABSPATH') || exit;

add_action('wp', static function (): void {
    if (class_exists('PFW_Store')) {
        remove_action('woocommerce_after_single_product_summary', [PFW_Store::class, 'single'], 5);
    }
});

That removal affects all managed products rendered through that hook. Make your template coverage match the scope. A builder's existing widget may bypass the classic hook, so inspect its actual output rather than relying only on the callback removal.

PHP renderer for starting price

<?php
defined('ABSPATH') || exit;

if (function_exists('pressflow_from_price')) {
    pressflow_from_price(123, 'custom-template'); // Echoes; does not return HTML.
}

The function accepts a product ID, a WC_Product or null for the global product. For a version-bound string integration, PFW_From_Price::html($product, 'custom-template') returns the markup; guard the class and active product. Disable an automatic starting-price placement if you are adding a second equivalent slot.

Assets and late builder rendering

PressFlow registers/enqueues its front assets for managed product pages and ordinary page content containing the configurator shortcode, and enqueues when rendering. A builder rendering content late may need its integration to enqueue the registered pfw-front stylesheet/script before the document head/footer. Inspect the result for flash/unstyled content; do not hard-code paths to versioned assets or remove required script dependencies.

The default main-description integration uses the WooCommerce product's full post_content, not the short description. Other product tabs remain separate.

Related: Product content, Hooks, Styling.

Example files

Reference examples for adapting to your shop. PHP examples are not plugin installers; review the guide and replace sample IDs before using them.

Need a hand?

Contact the PressFlow team with details of what you are trying to do.