• Resolved lebasca

    (@lebasca)


    Hi,

    I have a commission created after the order was completed but I can’t edit with the admin rights. I saw the video and the demo site, and it can be edited. I also checked this answer: Edit Commission but it doesn’t help me.

    If there another process that enables the edition of the commission?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi @lebasca, thanks for reaching WCMp Support!!

    It seems like the Admin doesn’t have access to these capabilities :
    edit_others_posts
    delete_posts
    create_posts

    So, please ask the server admin to grant you these capabilities, so you can access the edit commission page.

    Alternatively, you can add the following code snippet to function.php of the current active site :

    add_action( 'registered_post_type', 'change_caps_for_commission', 10, 2 );
    /**
    * Modify registered post type menu label
    * 
    * @param string $post_type Registered post type name. 
    * @param array $args Array of post type parameters.
    */
    function change_caps_for_commission( $post_type, $args ) {
       if ( 'dc_commission' === $post_type ) {
           global $wp_post_types;
           $args->cap->edit_others_posts = __( 'edit_others_posts', 'dc-woocommerce-multi-vendor' );
           $args->cap->delete_posts = __( 'delete_posts', 'dc-woocommerce-multi-vendor' );
           $args->cap->create_posts = __( 'create_posts', 'dc-woocommerce-multi-vendor' );
           $wp_post_types[ $post_type ] = $args;
       }
    }

    Let us know if you have any further query.

    Thread Starter lebasca

    (@lebasca)

    Thanks for your reply. It works.

    Great to know that!!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Unable to edit the commission’ is closed to new replies.