-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed #15059 Cannot reorder from the first try #20893
Conversation
Hi @shikhamis11. Thank you for your contribution
For more details, please, review the Magento Contributor Assistant documentation |
@magento-engcom-team give me test instance |
Hi @shikhamis11. Thank you for your request. I'm working on Magento instance for you |
Hi @shikhamis11, here is your new Magento instance. |
@@ -269,6 +269,7 @@ public function displayTotalsIncludeTax() | |||
*/ | |||
public function getSubtotal() | |||
{ | |||
$this->getQuote()->collectTotals()->save(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @shikhamis11 thanks for the fix! I think it's better to move quote calculation and save calls to a model. Could you perform these calls from a model or controller?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sivaschenko thanks for review . I have updated code in controller Please have a look
Hi @shikhamis11 , thanks for moving the call to a controller. The issue is that having it in the order/create/index controller will trigger the recalcualtion for both first time order and reorder. Also, such implementation is not following the CQRS principle, as this controller is designed to return information without changing the state of the system. Can you please move this call to a model or controller that are executed specifically for reorder operation? |
I am trying |
@sivaschenko Please check my last commit . The reason is that the subtotal updated correctly because the totals block is loaded after the items grid block |
Hi @shikhamis11 you are trying to recalculate quote during rendering, while, in my opinion, the good fix for the issue should be applied to calculating and saving quote correctly the first time - during the call to For the investigation of this issue, I'd compare the flow of reordering a simple product (that works fine) and a virtual product (that results in the issue). Looks like reorder of virtual product lacks processing of quote address items and I would start the investigation from In my opinion, the fix for this issue should be applied somewhere around quote relations processing. |
@sivaschenko thanks for working on this issue . Yes you are right the problem is somewhere in :initFormOrder I had tried once but didn't get any clue . I will try to debug it again |
@sivaschenko while debugging I got to know for billing address the item cache was not unset .Please review my latest changes |
Well done @shikhamis11 ! Finally, can you please squash all the commits into a single one with a meaningful commit message, i.e.: |
fa31496
to
32e0693
Compare
Hi @shikhamis11, thank you for your contribution! |
@sivaschenko after force push there this PR was closed also there in no option to reopen this so I created new one and assigned that to you . |
Fixed #15059 Cannot reorder from the first try
Preconditions
Steps to reproduce
Expected result
Actual result
Contribution checklist (*)