Advanced

Theme Compatibility Deep-Dive

Last updated July 3, 2026

For most themes, the coming soon block appears in exactly the right place with no configuration — it takes over wherever your theme renders the add-to-cart button. This article is for the minority of cases where it doesn’t, and explains how the detection works so you can fix it.

This is an advanced topic. If the block already appears correctly on your products, you don’t need any of this.

How the plugin finds the add-to-cart button

WooCommerce renders the single-product add-to-cart area through a function called woocommerce_template_single_add_to_cart, which themes attach to a hook. The default is woocommerce_single_product_summary at priority 30, but themes are free to move it elsewhere.

Rather than assume the default, the plugin discovers the location at runtime, in two stages (in sscs_maybe_replace_add_to_cart()):

  1. Fast path — known locations. It checks a short list ($known_locations), which by default contains only the WooCommerce standard (woocommerce_single_product_summary @ 30). If the add-to-cart function is bound there, it swaps in the coming soon template and stops.

  2. Slow path — full scan. If no known location matches, it walks every registered hook looking for woocommerce_template_single_add_to_cart, and rebinds the coming soon template to wherever it finds it — at the same hook and priority.

This two-stage design means it works out of the box with most themes (the scan catches relocated buttons), while the known-locations list lets you skip the scan for a theme you’ve already identified.

When detection fails

The mechanism only recognises the standard woocommerce_template_single_add_to_cart callback. It cannot detect a theme that renders its add-to-cart through a completely custom function (a different callback name, a shortcode, or a block) that bypasses the WooCommerce template function entirely. In that case the coming soon block won’t appear, because there’s no recognised hook to replace.

Symptoms:

  • The product is correctly marked Mark as Coming Soon.
  • You’re viewing a single product page.
  • …but the normal add-to-cart button still shows (or nothing changes).

Fixing it

Option A — add your theme’s hook to the known locations

If your theme uses the standard function but on a non-default hook/priority, add it to the $known_locations array in super-speedy-coming-soon.php:

$known_locations = array(
    array( 'woocommerce_single_product_summary', 30 ), // WooCommerce default
    array( 'your_theme_btn_area', 10 ),                // your theme's hook + priority
);

The commented examples in the file (e.g. REHub’s rehub_woo_btn_area) show the format: array( 'hook_name', priority ).

Finding your theme’s hook and priority

To discover where add-to-cart is rendered, temporarily inspect the hook from a snippet (child theme functions.php or a code-snippets plugin):

add_action( 'wp_footer', function () {
    if ( ! function_exists( 'is_product' ) || ! is_product() ) {
        return;
    }
    global $wp_filter;
    foreach ( $wp_filter as $hook => $obj ) {
        foreach ( $obj->callbacks as $priority => $callbacks ) {
            foreach ( $callbacks as $cb ) {
                if ( $cb['function'] === 'woocommerce_template_single_add_to_cart' ) {
                    error_log( "add-to-cart is on hook '$hook' at priority $priority" );
                }
            }
        }
    }
} );

Load a product page, then check wp-content/debug.log (with WP_DEBUG_LOG enabled) for the hook name and priority — those are the values to put in $known_locations. Remove the snippet afterwards.

Option B — themes that bypass the WooCommerce function

If the scan finds nothing (the snippet above logs nothing), your theme isn’t using woocommerce_template_single_add_to_cart at all. Options:

  • Switch the product template to one that uses standard WooCommerce output, or
  • Disable the theme’s custom add-to-cart for coming soon products and let WooCommerce’s default render, or
  • Add a small amount of custom code that removes the theme’s callback and adds sscs_render_coming_soon_template in its place for coming soon products.

This is genuinely theme-specific; if you’re unsure which function your theme uses, your theme author’s support is the fastest route.

A note on the position

The block always lands exactly where the add-to-cart button would have been, because it replaces that hook. If your theme uses tabs, accordions, or split layouts, the block follows the add-to-cart’s position within them — this is by design, so it respects your theme’s layout rather than forcing a fixed spot.

Related

  • Troubleshooting — the quick checklist version of “the form doesn’t appear”.
  • Developer Hooks & Reference$known_locations and the data contract.
  • Architecture — the full design of the add-to-cart replacement (Developers).

Leave a Reply

Your email address will not be published. Required fields are marked *

×
1/1