openfoodnetwork icon indicating copy to clipboard operation
openfoodnetwork copied to clipboard

Customer gets the snail when editing an order marked as 'shipped'

Open drummer83 opened this issue 2 years ago • 2 comments

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

  1. As a customer place an order.
  2. As a shop manager capture the payment and mark the order as shipped.
  3. As a customer go to your account and choose to edit the order.
  4. Change the amount of an item.
  5. Click Save changes.
  6. See the snail.

Animated Gif/Screenshot

Peek 2022-05-27 21-31

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

drummer83 avatar May 27 '22 19:05 drummer83

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: ofn_edit Order Page: ofn_order

  • 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?

ofn_cancel

Hope I can help!

SamKnightGit avatar Jun 05 '22 19:06 SamKnightGit

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:

drummer83 avatar Jun 05 '22 20:06 drummer83

Can my partner and I both be assigned this issue?

aarozh avatar Nov 16 '22 22:11 aarozh

Hi I am Aaron's (aarozh) partner! Could we both be assigned?

crystalysun avatar Nov 16 '22 22:11 crystalysun

I have assigned you. Thanks 💪

sigmundpetersen avatar Nov 17 '22 07:11 sigmundpetersen

Hi! If there hasn't been any progress on this task, I would love to work on it!

sfayyad avatar Dec 02 '22 05:12 sfayyad

Hey @sfayyad, it seems that @crystalysun is working on this one. Maybe best to have a look at another issue?

drummer83 avatar Dec 05 '22 07:12 drummer83

Hello @crystalysun just checkin in: are you still planning to work or working on this issue?

RachL avatar Dec 19 '22 14:12 RachL

Hi @RachL , unfortunately we no longer have time to work on this issue, so feel free to assign it to someone else! Thanks

crystalysun avatar Dec 19 '22 20:12 crystalysun

Looks like no one is working on this, I'd like to give it a go.

mgrigoriev8109 avatar Jan 12 '23 15:01 mgrigoriev8109

Hi @mgrigoriev8109 ! 👋

I'll assign you.

Thanks!!

jibees avatar Jan 12 '23 15:01 jibees

It looks like no one is assigned to this currently. Can I give it a try?

murjax avatar Sep 27 '23 13:09 murjax

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! 🤗

drummer83 avatar Sep 27 '23 14:09 drummer83

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. Screenshot from 2023-09-28 18-04-45

After shipped, order for $30.80 is past. Screenshot from 2023-09-28 18-05-21

My question then is: Are there any scenarios where we want to show shipped orders as still open?

murjax avatar Sep 28 '23 22:09 murjax

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:

filipefurtad0 avatar Sep 29 '23 11:09 filipefurtad0