• Resolved Hassan Hossinie

    (@onlinerir)


    hello

    how to i can disable delete product permanently
    set $force_delete = false

    Please set this filter hook

    I could not find everything I looked for Where the product is removed Disable permanent deletion

    Please let me know how to resolve

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support roshni07

    (@roshni07)

    Hello @onlinerir,

    Can you please use the mentioned CSS on your theme additional CSS section :

    .row-actions span:nth-child(2) {
        display: none;
    }

    It should help you hide it πŸ™‚

    Thread Starter Hassan Hossinie

    (@onlinerir)

    Hello

    I am a professional developer And this solution of yours does not work for me

    I also changed the code in this file:
    wp-content\plugins\dokan-lite\includes\Dashboard\Templates\Products.php
    line:
    520
    this code:
    dokan()->product->delete( $product_id, true );
    changed:
    dokan()->product->delete( $product_id, false );

    But still the product is completely erased.

    Plugin Support Rashed Ripon

    (@rur165)

    Hello @onlinerir ,

    The change you have made on the code will disable the force delete warning because the “delete” function parameter is like that. You can see it here –

    Path: \dokan-lite\includes\Product\Manager.php
    Function: delete()

    Now, if you want to remove the vendor option to delete product permanently, you can use this code –

    add_filter('dokan_product_row_actions', function($row_action) {
    	unset($row_action['delete']);
    	return $row_action;
    });
    
    add_filter('dokan_bulk_product_statuses', function($bulk_actions) {
    	unset($bulk_actions['delete']);
    	return $bulk_actions;
    });

    You can also remove this capability from the seller user role – dokan_delete_product

    I hope this helps.

    Thank you πŸ™‚

    Thread Starter Hassan Hossinie

    (@onlinerir)

    i want when product deleted , it moved to trash

    but now deleted permamently

    Plugin Support Rashed Ripon

    (@rur165)

    Hello @onlinerir ,

    Unfortunately, I do not have the exact example to make this function modified to set the product to trashed. You may want to use this WordPress function – wp_trash_post( int $post_id ) replacing the delete functionality.

    Thank you πŸ™‚

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.