Line items removed from cart re-appear when another product is added
I've been having a really hard time setting up a multi-currency donation system using Drupal Commerce. I've already given up on being able to convert the currency for custom line items based on a donation amount (I've tried about 100 different approaches and none work), and now I just want to remove donations that were added in a different currency than the one associated with the language being used.
I have created a rule that checks if the line item currency is the same as the currency associated with the current language.
- The only event I could use was "After updating an existing line item" because calculate sell price seems to overwrite ALL changes except to price, which has been a huge issue for me, and there is no other event that lets me check the unchanged line item currency and the language of the current page before the cart loads.
- I set the line item quanitity to 0
- I remove the line item from both the line-item:order and current-cart-order line item lists
- I save the order
This all works fine. The line item is removed and the message about it being in the incorrect currency is displayed. The cart shows the line item has been removed.
However, if I then go back and add another product to the cart, the removed line item is BACK... it has 0 quantity, but it's showing there in the cart along with the newly added item.
I can't delete the line item because this causes a string of errors, even if I delete it after I've already removed it from the cart item lists.
I've already spent 2 days stuffing around trying to get donations to work when switching currencies. Please, please, if someone can tell me why this is happening I would be so grateful.