Forum Replies Created

Viewing 1 replies (of 1 total)
  • The following seems to do the trick by editing cart-tab.php. The settings can now be found in its own tab under WooCommerce –> Settings –> Products –> Cart Tab

    Replacing

    // Admin
    add_action( 'woocommerce_settings_image_options_after', array( $this, 'admin_settings' ), 20 );
    add_action( 'woocommerce_update_options_catalog', array( $this, 'save_admin_settings' ) );
    add_action( 'woocommerce_update_options_products', array( $this, 'save_admin_settings' ) );

    with

    // Admin
    add_filter( 'woocommerce_get_sections_products', array( $this, 'wc_ct_add_section' ) );
    add_filter( 'woocommerce_get_settings_products', array( $this, 'wc_ct_all_settings' ), 10, 2 );

    where

    // Add section to woocommerce settings
    function wc_ct_add_section( $sections ) {
    	$sections['wc_ct'] = __( 'Cart Tab', 'woocommerce-cart-tab' );
    	return $sections;
    }
    
    function wc_ct_all_settings( $settings, $current_section ) {
    	/**
    	 * Check the current section is what we want
    	 **/
    	if ( $current_section == 'wc_ct' ) {
    		return $this->settings;
    	} else {
    		return $settings;
    	}
    }

Viewing 1 replies (of 1 total)