saving woocommerce options
-
hi
first, very good and simple plugin, which makes it easy to integrate. congratulations.
now, I have found that when the plugin is active, the pmatc_sanitize_ajax_cart_settings() function is executed for any saving of woocommerce settings. as a result, changes in woocommerce settings are not saved (I think since version 9.6.0). for example, in woocommerce > settings > general, activating taxes checkbox, after saving, when the page is reloaded, the checkbox is still deactivated.
I’ve solved it for now by adding
if (strpos($option[‘id’], ‘pmatc_ajax_cart_’) === 0) {just before theswitch ($option['id']) {....edit:
another better way can be change thisadd_filter('woocommerce_admin_settings_sanitize_option', 'pmatc_sanitize_ajax_cart_settings', 10, 3)for this:add_action('woocommerce_settings_tabs_pmatc_ajax_cart', 'pmatc_register_sanitize_filter');
function pmatc_register_sanitize_filter() {
add_filter('woocommerce_admin_settings_sanitize_option', 'pmatc_sanitize_ajax_cart_settings', 10, 3);
}I hope you can fix it in future updates.
many thanks
The topic ‘saving woocommerce options’ is closed to new replies.