openfoodnetwork
openfoodnetwork copied to clipboard
Customer gets the snail when editing an order marked as 'shipped'
Description
If a customer wants to edit an order which has been marked as shipped, the customer gets the snail.
Expected Behavior
The customer should not see the snail. it shouldn't be possible to edit the shipped order.
Actual Behaviour
The customer gets the snail.
Steps to Reproduce
- As a customer place an order.
- As a shop manager capture the payment and mark the order as shipped.
- As a customer go to your account and choose to edit the order.
- Change the amount of an item.
- Click Save changes.
- See the snail.
Animated Gif/Screenshot
Workaround
No workaround for customers.
Severity
??? bug-s3: a feature is broken but there is a workaround ??? bug-s4: it's annoying, but you can use it
Your Environment
- Version used: v4.1.33
- Browser name and version: Firefox 100
- Operating System and version (desktop or mobile): Ubuntu 20.04 LTS
Possible Fix
Hey y'all!
I am interested in getting involved with OFN, and am happy to take a stab at this issue. I have reproduced the bug but have a few clarifying questions about the expected state:
- Once an order has been shipped, do we only want to remove the Edit capability on the orders overview page and the quantity selector on the order page?
- Is it possible to cancel an order once it has been shipped? If not, we should also be removing the Cancel option on orders overview and the Cancel Order button + trash button on the order page? Not sure how this would affect the Changes Allowed Until field...
Orders Overview Page:
Order Page:
- I have noticed some strange behavior when trying to Cancel an already shipped order, shown in the GIF below. Perhaps this should be filed as a separate issue?
Hope I can help!
Hi @SamKnightGit,
Great to have you here and WELCOME! :partying_face: :wave:
It's great to see you digging into this issue! And you are asking very good questions! To my understanding it's a good solution to disable the edit and cancel options once an order has been marked as shipped - in real life you don't have a chance to change the order once it has left your enterprise. It should be listed in the list of 'past orders' instead of 'open orders'. In the backend it also doesn't seem to be possible to edit or cancel a shipped order. But to be sure let's wait for a comment of our @openfoodfoundation/train-drivers-product-owners to confirm the way forward.
In the meantime, feel free to choose any other issue you like - like #8806, which I believe is the issue you have encountered during your tests, isn't it?
In case you are not aware: You can always drop a line on our Slack for general questions, or just comment here, as you just did!
Looking forward to your contributions! :rocket:
Can my partner and I both be assigned this issue?
Hi I am Aaron's (aarozh) partner! Could we both be assigned?
I have assigned you. Thanks 💪
Hi! If there hasn't been any progress on this task, I would love to work on it!
Hey @sfayyad, it seems that @crystalysun is working on this one. Maybe best to have a look at another issue?
Hello @crystalysun just checkin in: are you still planning to work or working on this issue?
Hi @RachL , unfortunately we no longer have time to work on this issue, so feel free to assign it to someone else! Thanks
Looks like no one is working on this, I'd like to give it a go.
Hi @mgrigoriev8109 ! 👋
I'll assign you.
Thanks!!
It looks like no one is assigned to this currently. Can I give it a try?
Sure, and welcome @murjax! I'll assign it to you.
Please have a look at the previous comments, there is some valuable information. And don't hesitate to get in touch here or in our Slack in case you have any questions.
Looking forward to your contribution! 🤗
I have a question on this. Some context first:
The editable state of an order appears to be controlled be a method Order#changes_allowed?
. This checks if the order meets these conditions:
- Order complete
- Distributor allows changes
- Order cycle is open
It doesn't account for order shipped. I'm thinking of adding a condition to ensure the order is not shipped yet.
This check is also used in the account orders list to show open vs past orders. If I make the above change, shipped orders will show as past orders.
Screenshots
Before shipped, order for $30.80 is open.
After shipped, order for $30.80 is past.
My question then is: Are there any scenarios where we want to show shipped orders as still open?
Hey @murjax , welcome - thanks for picking this one :muscle:
Are there any scenarios where we want to show shipped orders as still open?
I'd say no; shipped orders are always non-editable from the customers perspective and, as such, are fine to be considered past orders.
The approach you describe, i.e., adding a 4th condition sounds good to me. Orders would then appear as Open Orders, only when all for conditions are met:
- Order complete
- Distributor allows changes
- Order cycle is open
- Order not shipped
Having the order displayed as past order should not allow the customer do access it, and should prevent the error 500 :ok_hand: