Closed (fixed)
Project:
Commerce Core
Version:
8.x-2.x-dev
Component:
Checkout
Priority:
Major
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
20 Mar 2021 at 16:11 UTC
Updated:
15 Jun 2023 at 12:49 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
zengenuity commentedPatch attached
Comment #3
zengenuity commentedComment #4
geek-merlinI bumped into this very same problem with a custom module.
Setting major because the project page says it blocks https://www.drupal.org/project/commerce_admin_checkout
Reviewed the code and can confirm that it trivially prevents the exception mentioned in the IS.
Triggered test again as due diligence.
Can confirm that this just finishes the related predecessor issue.
Setting RTBC based on that.
Comment #5
jsacksick commentedBut I don't consider this fix as legit... How in the world does it make sense to skip payments and allow checkout completion when the order total price is NULL? This is just a malformed order... Order total should be 0 for a free order, not NULL.
Comment #6
geek-merlinI can tell you my use case: The checkout process is entered with an empty order, and the order is filled there (and never empty on completion). This makes a fantastic UX for a broad range of use cases.
(I tried a lot to do it differently, but all other approaches were quite doomed.)
I suppose the approach in the commerce_admin_checkout module of @zengenuitiy is similar.
Also i thought if you committed the same thing in the predecessor issues:
- #2968079: Prevent exceptions on checkout page when order_total is null
- #2964692: Provide way for contrib to override NULL in order total
and if those were good to commit, this should be too.
What u think?
If you changed your mind and say the predecessor issue should never have got committed, i can imagine the following: In the above use case of an order without items, instead of a null price throwing, the order refresh sets a zero price in that case. I can work on that if you prefer.
Comment #7
jsacksick commentedCommitted, thanks!