After more debugging I figured that the reason that new order item is not bei...

Contribution Date
Technology
Contribution Project
Contribution Details

After more debugging I figured that the reason that new order item is not being created is because the form build id is not getting refreshed. Although, as per the code RefreshPageElementsHelper::updateFormBuildId() should be called every time a product is added to cart, but it looks like it is using the stale build id - when the variation is changed the second time. I am not sure why it is happening only the second time. I think I have to dig into the variation switcher as well. Maybe it is not refreshing the add to cart form build id - which it should - and it relies on the page reload to get the new build id, and it fails when the add to cart form button is ajaxed. I will ask Bojan again for some hints.

Contribution Author
Files count
0
Patches count
0