Remove unnecessary hook and code from version 12.6
-
Hi, thanks for the plugin.
The issue you fixed in version 12.6 June 14 2018 actually created problem for me. I have been using the
woocommerce_before_add_to_cart_button
hook to load all type of custom fields into bootstrap modal.I removed below hooks using
remove_action
hook to fix the problem// Rendering fields on product page add_action ( 'woocommerce_before_add_to_cart_button', 'ppom_woocommerce_show_fields', 15); add_action ( 'woocommerce_single_variation', 'ppom_woocommerce_show_fields', 15);
Earlier you used only
woocommerce_before_add_to_cart_button
hook to render fields but in this version you used both hooks which is available on the variable.php file into woocommerce template. That’s the main reason of fields duplication.Please remove below hook from plugin.class.php file.
add_action ( 'woocommerce_single_variation', 'ppom_woocommerce_show_fields', 15);
Also remove below code from woocommerce.php file from your plugin
// @Reason: variable product render fields twice. To stop this we add following code. if( $product->get_type() == 'variable' && current_filter() == 'woocommerce_before_add_to_cart_button') { return; }
At the moment, I have been commenting above code due to problem in my case. Removing
woocommerce_single_variation
hook with above code will fix the problem for all users not just me.
- The topic ‘Remove unnecessary hook and code from version 12.6’ is closed to new replies.