Last active
January 27, 2018 02:12
-
-
Save bolderelements/d324b791118ce716a8bde6140929a86b to your computer and use it in GitHub Desktop.
Restocking Form Override (No Hooks)
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
<?php | |
// Add restocking form container | |
if( class_exists( 'BE_Product_Alerts_Form_Restocking' ) ) { | |
// check if enabled | |
$bepa_settings = get_option( 'woocommerce_product-alerts-restocking_settings' ); | |
if( ! is_admin() && $bepa_settings['enabled'] !== 'no' ) { | |
// check if the single product is out of stock | |
if( ! $product->is_type( 'variable' ) && ! $product->is_in_stock() ) { | |
// display form if meets all criteria | |
$restocking_form = new BE_Product_Alerts_Form_Restocking(); | |
$restocking_form->add_email_form(); | |
} | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment