Home Forums WoodMart support forum Shop Manager Role Can’t Save Changes for Header Builder

Shop Manager Role Can’t Save Changes for Header Builder

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #594680

    luan0409
    Participant

    So i gave my shop manager guy ability to access header builder of Woodmart to change logo, header elements stuff and then after he save changes, it just keep spinning.

    https://prnt.sc/5pwh9U6U4wsa

    Only me with administrator role can save changes.

    I try to use admin menu editor to create another role with same capabilities as Admin. But still the same thing happen. Only when when the user have role “administrator” can save changes for the Header Builder

    The same thing happen with some setting using JS script

    All the option for Typography just keep spinnin, not showing the option for Shop Manager, i dont even click the Save Changes button yet so can not even change anything from the beginning:

    https://prnt.sc/Eh_73MaA36tD

    How can i give shop manager full rights to change these option. I can’t just give them all the access as Admin Role, since so many thing else to hide. I only need them to change the header builder and some Theme options

    #594745

    Artem Temos
    Keymaster
    Xtemos team

    Hello,

    Try to add the following PHP code snippet to the child theme functions.php file to fix this

    if ( ! function_exists( 'woodmart_add_shop_manager_capabilities' ) ) {
    	/**
    	 * Add shop manager capabilities for edit header builder and theme settings.
    	 * 
    	 * @param array $localize_data List of nonce for admin ajax.
    	 * 
    	 * @return array
    	 */
    	function woodmart_add_shop_manager_capabilities( $localize_data ) {
    		if ( wc_current_user_has_role( 'shop_manager' ) ) {
    			$localize_data = array_merge(
    				$localize_data,
    				array(
    					'get_builder_elements_nonce'       => wp_create_nonce( 'woodmart-get-builder-elements-nonce' ),
    					'get_builder_element_nonce'        => wp_create_nonce( 'woodmart-get-builder-element-nonce' ),
    					'builder_load_header_nonce'        => wp_create_nonce( 'woodmart-builder-load-header-nonce' ),
    					'builder_save_header_nonce'        => wp_create_nonce( 'woodmart-builder-save-header-nonce' ),
    					'builder_remove_header_nonce'      => wp_create_nonce( 'woodmart-builder-remove-header-nonce' ),
    					'builder_set_default_header_nonce' => wp_create_nonce( 'woodmart-builder-set-default-header-nonce' ),
    					'get_theme_settings_data_nonce'    => wp_create_nonce( 'woodmart-get-theme-settings-data-nonce' ),
    				)
    			);
    		}
    	
    		return $localize_data;
    	}
    	
    	add_filter( 'woodmart_admin_localized_string_array', 'woodmart_add_shop_manager_capabilities' );
    }

    Kind Regards

    #594749

    luan0409
    Participant

    Thank you so much for fast reply.

    The code work perfectly.

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘Shop Manager Role Can’t Save Changes for Header Builder’ is closed to new replies.