Created
July 18, 2025 19:51
-
-
Save MadCowWeb/58a1503d9c8ec2d54644def3ba968eb9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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)