• Resolved roberto22

    (@roberto22)


    Hi,

    Hi, i am giving some free products with a cart total of $0.00. I am using this snippet because i still need to user to select only cash on delivery as payment method for these products:

    add_filter( ‘woocommerce_cart_needs_payment’, ‘__return_true’ );

    But the snippet also shows partial payment. How can i disable partial payment when cart is 0. https://prnt.sc/14sspwy

    Thanks in advanced!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Subrata Mal

    (@subratamal)

    @roberto22 Use add_filter('woo_wallet_disable_partial_payment', '__return_true');.

    Thread Starter roberto22

    (@roberto22)

    Hi,

    The partial payment still shows when cart is 0 https://prnt.sc/14sspwy

    I need the partial payment to be only disable when cart is 0, if the cart is greater than 0 the partial payment has to be enable.

    Thanks for the help!

    Thread Starter roberto22

    (@roberto22)

    Hi,

    You helped me with this code to hide partial payment for specific categories, and the code works perfectly. But if i offer a free product and cart value is 0, the partial payment shows. Is there a way to edit the snippet so it also hide partial payment when cart value is 0. Thanks!

    `add_filter(‘woo_wallet_disable_partial_payment’, ‘woo_wallet_disable_partial_payment_callback’);

    if (!function_exists(‘woo_wallet_disable_partial_payment_callback’)) {

    function woo_wallet_disable_partial_payment_callback($is_disable) {
    $category_ids = array(543, 537);
    foreach (wc()->cart->get_cart() as $key => $cart_item) {
    $product_id = $cart_item[‘product_id’];
    $product = wc_get_product($product_id);
    $term_ids = $product->get_category_ids(‘edit’);
    foreach ($term_ids as $term_id) {
    if (in_array($term_id, $category_ids)) {
    $is_disable = true;
    break;
    }
    }
    }
    return $is_disable;
    }
    }

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Partial payment when cart is 0’ is closed to new replies.