how to exclude woo wallet from one time purchase

  • Unknown's avatar

    Hi,
    I have used below code for one time purchase only, but I want to exclude wallet (Product ID 1417) from this code. Please suggest me.

    //ONE TIME PRODUCT PURCHASE
    add_filter( ‘woocommerce_is_purchasable’, ‘hide_add_cart_if_already_purchased’, 9999, 2 );
    function hide_add_cart_if_already_purchased( $is_purchasable, $product ) {

    if ( wc_customer_bought_product( ”, get_current_user_id(), $product->get_id() ) ) {
    $is_purchasable = false;

    }
    }

    return $is_purchasable;

  • Hi there,

    It looks like you need help with the WooCommerce plugin, but have landed on the support forum for WordPress.com sites instead.

    We don’t offer WooCommerce on WordPress.com (unless you are upgraded to our WordPress.com Pro Plan), so we’re not your best point of contact. The good news is that help is available by contacting WooCommerce staff here:

    https://wordpress.org/support/plugin/woocommerce/

    The folks over there are familiar with your plugin and in the best position to assist. Hope this helps point you in the right direction!

  • Unknown's avatar

    Thanks sir,
    for the suggestion.

  • The topic ‘how to exclude woo wallet from one time purchase’ is closed to new replies.