Remove delete product buttons

WCMp Vendor Staff

Resolved
Viewing 4 reply threads
  • Author
    Posts
    • #124476
      MaxenceTP
      Participant

      Hello !

      How can I prevent a seller from deleting his products?
      https://prnt.sc/19gn88j

      I did not find an option in the config to change this

      Thanks for your help 🙂

    • #124477
      MaxenceTP
      Participant

      I’m not sure that’s the right category, but it’s about WCMP Core.

    • #124500

      Hi,
      Please add this code in the function.php of the current active theme :

      add_filter( 'wcmp_product_list_bulk_actions', 'wcmp_remove_product_delete_option', 10);
      function wcmp_remove_product_delete_option($bulk_action){
          unset($bulk_action['trash']);
          unset($bulk_action['untrash']);
          unset($bulk_action['delete']);
          return $bulk_action;
      }
      
      add_filter('wcmp_vendor_product_list_row_actions_column', 'wcmp_remove_product_remove_actions', 10);
      
      function wcmp_remove_product_remove_actions( $actions_col ){
          unset($actions_col['restore']);
          unset($actions_col['delete']);
          unset($actions_col['trash']);
          return $actions_col;
      }
      Copy

      Regards,

    • #124516
      MaxenceTP
      Participant

      Thanks! Problem solved :p

    • #124550

      Thank you for the update @Maxence. We are happy to help.

Viewing 4 reply threads

The topic ‘Remove delete product buttons’ is closed to new replies.