Hi @all,
I have problem with Dokan plugin. It can’t topup.
I found the cause was due to the Dokan plugin preventing product owners from buying their own products. And it blocks even administrators from buying their own products (product Topup too), so here’s the solution:
add_filter('dokan_vendor_own_product_purchase_restriction', 'ftv_prevent_restriction_dokan_for_terra_wallet_product', 9999, 2);
function ftv_prevent_restriction_dokan_for_terra_wallet_product($is_purchasable, $product){
if(!function_exists('get_wallet_rechargeable_product')) return $is_purchasable;
$recharse_product_id = get_wallet_rechargeable_product()->get_id();
if($product && $product->get_id() == $recharse_product_id){
return true;
}
return $is_purchasable;
}
Hope it helps everyone a lot!