• emiel9d

    (@emiel9d)


    I have found a little bug which happens in the following situation:
    – Bundle product with multiple optional childs
    – Add to cart with optional A, B and C
    – Add to cart with optional A, D and E
    – Reorder through my account
    – A notice “1 item from your previous order is currently unavailable and could not be added to your cart” is shown, however all items are added to the cart

    I have done some debugging and found what is causing this issue. Within /woocommerce/includes/class-wc-cart-session.php in the function ‘populate_cart_from_order’ they generate a cart ID:

    $cart_id = WC()->cart->generate_cart_id( $product_id, $variation_id, $variations, $cart_item_data );

    In my situation, the cart ID for optional A (in both order lines) is exactly the same, because the $cart_item_data is exactly the same. WooCommerce then counts the ‘new’ $cart array, filled using the $cart_id and compares this to the original $order_items.

    The cart_item_data contains two fields:
    woosb_order_again: yes
    woosb_parent_id: 123

    Because they both have the same parent product it’s not unique in this case. It would be better to add the woosb_parent_key to the order items, which is also used within the cart while ordering.

Viewing 1 replies (of 1 total)
  • Plugin Support Janilyn T

    (@janilyn409)

    Hi @emiel9d ,

    Thanks for reporting this issue to us.

    I will send a report to our developers so that they can investigate and consider a fix in the coming update.

    Best regards.

Viewing 1 replies (of 1 total)

The topic ‘Notice when ordering again’ is closed to new replies.