From what I can tell, $lineItem->variant() hasn't been returning a string since v2.1 (97737d2) - I'm surprised it hasn't been brought up before now to be honest 😅
The tests haven't picked this issue up as the line items data was still using the old format (a string) which worked for the code. I've adjusted the tests, they failed & I've fixed the bug.
This pull request fixes a bug where line items with variant products couldn't be updated - an error was being thrown.
It was happening as the controller was expecting
$lineItem->variant()
to be a string (the key of the variant) but it was returning an array like this:From what I can tell,
$lineItem->variant()
hasn't been returning a string since v2.1 (97737d2) - I'm surprised it hasn't been brought up before now to be honest 😅The tests haven't picked this issue up as the line items data was still using the old format (a string) which worked for the code. I've adjusted the tests, they failed & I've fixed the bug.
Fixes #844