coopcycle / coopcycle-web

Logistics & marketplace platform. Only for worker-owned business.
https://coopcycle.org
Other
565 stars 128 forks source link

Unable to set fulfilment method to `delivery` (stuck in the `collection` (takeaway) state) #4081

Open vladimir-8 opened 5 months ago

vladimir-8 commented 5 months ago

Describe the bug

Unable to set fulfilment method to delivery (stuck in the collection (takeaway) state)

To Reproduce Steps to reproduce the behavior:

  1. Start an order in a restaurant that supports both delivery and collection (put some item in the cart) (see screenshot: "Specialty coffee bar")
  2. Set fulfilment method to collection (takeaway)
  3. Go to a restaurant that supports only delivery (see screenshot: "Burger Bar")
  4. Begin a new order there (put some item in the cart)
  5. See that collection (takeaway) is Not available at the moment and it's impossible to switch to delivery

(The reverse also does not work; if initially an order is started in a restaurant that supports only delivery (see screenshot: "Burger Bar") and then switched to a restaurant that supports both delivery and collection it's not possible to select collection)

Expected behavior

It should be possible to select a correct fulfilment method. Ideally, it should be already pre-selected

Screenshots If applicable, add screenshots to help explain your problem.

Screenshot 2024-03-20 at 14 17 01


Screenshot 2024-03-20 at 14 17 13

Additional context Add any other context about the problem here.

As I understand when switching restaurants we keep takeaway in the Order object, but while rendering the page we don't include cart[takeaway] in the form, because the restaurant does not support it. Which makes it impossible to disable this property from the frontend.

A possible solution is always sent /restaurant/{id}/cart/address request while editing an address, and disable takeaway there

vladimir-8 commented 5 months ago

@Paul-Eraman-CoopCycle adding this issue to the backlog, as I assume that this scenario is very rare