• Hello,

    the option to buy only once is applied to all products even if they do not have the “buy only once” tick.

    Thank you

    Federico

Viewing 1 replies (of 1 total)
  • I’ve had the same issue, the problem occurs in the function change_cart_item_quantities. It checks to see whether an item in the cart has been purchased before, but It’s not checking whether the product is set as limited or what the global setting currently is before removing the item from the cart.

    Starting on line 180 of the main plugin file, I fixed the issue for now by changing

    $is_limited = get_post_meta($cart_item['product_id'], 'buy_once', true);
    
    if(in_array($cart_item['product_id'], $already_ordered_ids)) {
    $cart->remove_cart_item($cart_item_key);
    } elseif{...}

    To the following

    $is_limited = get_post_meta($cart_item['product_id'], 'buy_once', true);
    
    if (in_array($cart_item['product_id'], $already_ordered_ids) && ($is_limited == '1' || (isset($this->settings['work_mode']) && $this->settings['work_mode'] == '1'))) {
    $cart->remove_cart_item($cart_item_key);
    } elseif{...}
    • This reply was modified 1 year, 9 months ago by spinjamie.
Viewing 1 replies (of 1 total)
  • The topic ‘The single choice option doesn’t work’ is closed to new replies.