• Mình đang sử dụng plugin KiotVietSync để đồng bộ với website woocommerce của mình, tuy nhiên hiện tại chỉ có Admin user mới có thể truy cập được menu của Kiot. Mình thử hook trong file function.php thì menu đã hiện trong bảng điều khiển của Shop Manager user, tuy nhiên khi mình nhấn vào một menu bất kỳ của Kiot thì bị lỗi “Rất tiếc, bạn không thể truy cập trang này”.

    if (is_admin()) {  
        add_action('admin_menu', 'add_plugin_for_shop_manager');  
    }
      
    function add_plugin_for_shop_manager() {  
        if (!current_user_can('manage_options')) {  
        	add_menu_page('KiotViet Sync',
                'KiotViet Sync',
                'manage_woocommerce',
                'plugin-kiotviet-sync',
                array('display_plugin_setup_page'),
                '',
                '10');
    		add_submenu_page('plugin-kiotviet-sync', 'Thiết lập thông tin đồng bộ', 'Thiết lập thông tin đồng bộ', 'manage_woocommerce', 'plugin-kiotviet-sync', array('action_kiotvietsync_config'));
            add_submenu_page('plugin-kiotviet-sync', 'Danh sách sản phẩm đồng bộ', 'Danh sách sản phẩm đồng bộ', 'manage_woocommerce', 'plugin-kiotviet-sync-product', array('action_kiotvietsync_product'));
            add_submenu_page('plugin-kiotviet-sync', 'Danh sách đơn đặt hàng', 'Danh sách đơn đặt hàng', 'manage_woocommerce', 'plugin-kiotviet-sync-order', array('action_kiotvietsync_order'));
            add_submenu_page('plugin-kiotviet-sync', 'Lịch sử đồng bộ', 'Lịch sử đồng bộ', 'manage_woocommerce', 'plugin-kiotviet-sync-history', array('action_kiotvietsync_history'));
        }
    }

    Hy vọng Kiot có thể hỗ trợ mình cách để cho phép Shop Manager quản lý được KiotVietSync, và nếu có thể tích hợp được tính năng này cho lần update sau thì càng tuyệt vời ạ (ví dụ tính năng chọn những user roles nào có thể quản lý được plugin).
    Mình cảm ơn.

The topic ‘Allow Shop Manager to access plugin’ is closed to new replies.