• Resolved brian12988

    (@brian12988)


    I have created a plugin that adds a custom tab and section to Woocommerce. I followed the codes from other plugins and was working before.

    The documentation mentions to use
    ‘woocommerce_update_options_’ . $this->id . $current_section but it no longer fires.

    I think it was after the latest update that it stopped working. Anyone have any ideas?

    class B_Settings extends WC_Settings_Page {
    	 public function __construct() {
    		$this->id    = 'b_sync';
    		$this->label = __( 'B Sync', 'b_sync' );
    		
    		parent::__construct();
    
    		add_action( 'woocommerce_update_options_' . $this->id . '_products', array( $this, 'save_extra_products' ), 10, 0 );
    		add_action( 'woocommerce_update_options_' . $this->id . '_reviews', array( $this, 'save_extra_reviews' ), 10, 0 );
    
    		add_action( 'woocommerce_settings_page_init', array( $this, 'screen_option' ) );
    	}
    }

Viewing 1 replies (of 1 total)
  • Hi @brian12988,

    Per an API link regarding the code ‘woocommerce_update_options_’ . $this->id . $current_section the particular string is still in use.

    If it is not working it could be a conflict with a theme or another plugin. Test by removing the code, and then disabling all of your plugins except WooCommerce and change your theme to something such as Storefront then test.

    If it works after re-adding the code, then re-enable your theme, then each set of plugins until you see the issue happen again. Let us know the results!

Viewing 1 replies (of 1 total)
  • The topic ‘Woocommerce Settings not saving’ is closed to new replies.