magento-lts
magento-lts copied to clipboard
Allow admin guest order and reorder
Description (*)
One of my store managers mentioned in passing how she got around having to replace an order for a guest checkout. I am not sure why this is not possible in stock Magento. Maybe there is a good reason, but it seems to work just fine.
Related Pull Requests
Fixed Issues (if relevant)
- Fixes #244
Manual testing scenarios (*)
- Place a guest order
- Press the newly available "reorder" button in admin
- All details show up, and the order seems to be placed fine.
Questions or comments
Does anyone know why Magento has this disabled? I see others on Stackoverflow as well as in the linked issue asking about it, but the stack overflow answer involved changing a block to add the button: https://magento.stackexchange.com/questions/86531/re-order-for-guests-in-magento
I did PR into 20.0 in case it's breaking in any way.
Contribution checklist (*)
- [x] Pull request has a meaningful description of its purpose
- [x] All commits are accompanied by meaningful commit messages
- [x] All automated tests passed successfully (all builds are green)
- [x] Add yourself to contributors list
I made this PR too early, I do see some issues.
On the second order, customer name is "Guest" and customer group ID is default customer group, not "NOT LOGGED IN".
I think this is because there's a default customer object attached, and for example that sets the customer group to the default from config.
I will investigate this more and push changes if possible.
I would first evaluate whether this feature is useful and how often it is used.
On the customer's side if he has an account then he can place any past order that he can edit in the shopping cart. As a store I would encourage guest buyers to set up accounts and present the reasons maybe give bonuses.
On the administrator side we can have several situations. You are asked by a guest customer to place an order from the past and this button is useful. You look for the order and place it again. I have never personally encountered this situation. Secondly, I do not recommend this way to be done by the administrator in stores where it is necessary for that customer to agree to the terms and conditions, but also to the processing of personal data.
We can also have the situation described by you but here it is either a request of editing a current open order, or of doubling the existing one with cancellation. Magento did not allow the editing of orders and I consider this a lack as long as you have the customer's consent to do some actions when you do not have the product, quantity or assortment available in stock.
If it is up to me I would implement an option in the store configuration let's say Orders section so that this Reorder button appears or not depending on what the administrator decides. E.g. only for registered customer, only for Guest, for both or not at all. I have this approach because there are stores where more users could have access to the Orders section in Backend and the administrator must decide the appearance of the button. The default value I would set it for "Don't show it" because of the reasons related to legal issues.
If what I said above is not wanted or will not be implemented and if this button still appears for the registered customer orders, I don't see any reason why it wouldn't appear for the guests as well.
@ADDISON74 The main reason the store manager needs to reorder a guest order is that the carrier has lost the package in transit, or it arrives damages. In that case, the manager would create a new order, change the price to $0 on each product, and submit so it can be fulfilled as normal during order processing.
Right now, they have to open the old order in a separate window and manually copy each part of the billing/shipping address and re-add the items to the quote, which is time consuming and can be error prone.
As for the config, there is already the option in the admin configuration, but I believe this controls the frontend reorder button as well. Turning it off will definitely remove the reorder button in the admin too. That option could be expanded in another PR to include more options. For this PR however, I think it was probably just a bug that reorder didn't work for guest checkout, so the Magento devs just hid the button as a workaround.
Pushed commit, admin is now able to create a new guest order, as well as reorder a guest order. I have done light testing and it seems to work so far, I will test more thoroughly.
Screenshot of Sales > Orders > Create New Order:
There was very clearly support at one time for this feature, as evidenced by snippets of code below in the current code. I do not know at what point the Magento team probably broke the feature and just decided to hide the "Reorder" button on guest orders.
https://github.com/OpenMage/magento-lts/blob/bafc48f508ea619c4edcd94dee8931b929db6640/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Form/Account.php#L81-L83
https://github.com/OpenMage/magento-lts/blob/bafc48f508ea619c4edcd94dee8931b929db6640/app/code/core/Mage/Adminhtml/Model/Sales/Order/Create.php#L359-L361
https://github.com/OpenMage/magento-lts/blob/bafc48f508ea619c4edcd94dee8931b929db6640/app/code/core/Mage/Adminhtml/Model/Sales/Order/Create.php#L1383-L1385
https://github.com/OpenMage/magento-lts/blob/bafc48f508ea619c4edcd94dee8931b929db6640/app/code/core/Mage/Adminhtml/Model/Sales/Order/Create.php#L1561-L1562
I added a couple of comments on parts of the PR to explain what is happening to make the changes more clear.
I appreciate your effort. Do you have a screenshot of the buttons in the Sales > Orders section?
@ADDISON74
Sales > Orders (Nothing changed)
Sales > Orders > Create New Order (Added "Create Guest Order" button)
Order View (Added "Reorder" button for guest order)
I just found this PR now. It's a useful and also non-intrusive feature. I tested it and it works correctly on 20.0.14
Makes no sense to me to have reoders for guests. Then it needs no guest account. Same for admin created orders.
@sreichel how about if the order arrived damaged and we need to send a new one. It’s tedious to manually copy every field, especially address.
I will see if I can rebase today.
Makes no sense to me to have reoders for guests. Then it needs no guest account. Same for admin created orders.
It would be useful to us in some cases where the customer needs to create orders on the fly, for example at expos events.
Of course it can be useful in some cases, but is it something that is used by many users?
Im not an expert, but does it not violate GDPR/DSVGO?
Data from guest orders is not meant to be for operational processes. (???)
(Creating guest orders from backend ... why?)
I agree with this PR and AFAIK it doesn't create problems with GDPR, but it has conflicts and notes to be addressed.
Guest orders are for "anonymized" data. Of course they are in your DB, but only for legal/financial purposes.
For backend orders you have a phone call, an email, ... why to create a guest order? (Also from sellers view?!?)
Imho it better to an extension.
I still think it's useful when somebody created a guest order from the frontend and needs a reorder or when customer-service has to create a one-stop order for somebody.
I think simple the fact that it seems to have been supported in core at one point but disabled (probably due to some bug and they were lazy) is enough to warrant this PR: https://github.com/OpenMage/magento-lts/pull/2233#issuecomment-1161934642