I've been able to reproduce this locally by creating a pending renewal, getting that order in your cart session, then removing the line item. Here are the steps to reproduce:
Enable taxes and choose tax-inclusive prices
Purchase a subscription product and creating a pending renewal order
Go to your My Account page and click "Pay" for this pending renewal
While on the checkout page, open a new tab and go to the Edit Order page for this renewal order
Delete the order items
Go back to the checkout page and you'll see the critical error on the page.
While debugging this issue I noticed, when we are setting $item_to_renew we are making an assumption that the order item exists.
To fix this I think we should add some defensive code in this function.
Describe the bug
Customer report in ticket 6706536-zen:
The line that is causing this issue is this line:
I've been able to reproduce this locally by creating a pending renewal, getting that order in your cart session, then removing the line item. Here are the steps to reproduce:
While debugging this issue I noticed, when we are setting
$item_to_renew
we are making an assumption that the order item exists.To fix this I think we should add some defensive code in this function.