Skip to content

Instantly share code, notes, and snippets.

@MadCowWeb
Created July 18, 2025 19:51
Show Gist options
  • Select an option

  • Save MadCowWeb/58a1503d9c8ec2d54644def3ba968eb9 to your computer and use it in GitHub Desktop.

Select an option

Save MadCowWeb/58a1503d9c8ec2d54644def3ba968eb9 to your computer and use it in GitHub Desktop.
add_action('woocommerce_after_add_to_cart_form', 'cr_custom_bis_button_composites_only', 9);
function cr_custom_bis_button_composites_only() {
if (!function_exists('WC_BIS')) return;
global $product;
if (!$product || !$product->is_type('composite') || $product->is_in_stock()) return;
// Output form matching plugin's expected structure
?>
<div id="wc_bis_product_form" data-bis-product-id="<?php echo esc_attr($product->get_id()); ?>">
<?php if (! is_user_logged_in()) : ?>
<input type="text" id="wc_bis_email" name="wc_bis_email" class="input-text" placeholder="<?php esc_attr_e('Enter your e-mail', 'woocommerce-back-in-stock-notifications'); ?>" />
<?php endif; ?>
<button class="button" type="button" id="wc_bis_send_form" name="wc_bis_send_form">
<?php esc_html_e('Notify me', 'woocommerce-back-in-stock-notifications'); ?>
</button>
</div>
<?php
}
@MadCowWeb
Copy link
Author

Running Woo back in stock notifications with composite products. (not supported).

This basically adds the button for you (in my case, I only wanted it to run on Composite products)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment