Skip to content
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

Orders showing Shipping as 'pending' when they should be 'ready' #5119

Open
Tracked by #7511
kirstenalarsen opened this issue Apr 1, 2020 · 12 comments
Open
Tracked by #7511
Labels
blocked bug-s3 The bug is stopping a critical or non-critical feature but there is a usable workaround.

Comments

@kirstenalarsen
Copy link
Contributor

kirstenalarsen commented Apr 1, 2020

Description

New hub, most of their orders are showing as payment complete but shipping pending
[image removed - see /admin/orders with orders paid by Stripe]

There is only one payment method - Stripe.
There are four shipping methods, all pick-up
3 of them did have weight (per kg) = zero, so i have now changed them to flat rate per order and will monitor

But what is happening when I open the order - the shipping is showing as pending
image.png

But when I click on the payments tab, it switches to ready
image.png

Expected Behavior

When an order is completed and the payment is taken, the order should show as Shipping = Ready

Actual Behaviour

For some orders (not known why), it shows as Pending instead

We're not sure if this actually has any implications, other than the user can't click the 'Shipped' button on Orders page until they have opened the order and clicked another tab. But it is confusing and off-putting

Steps to Reproduce

not sure - right now seems to be just place any order through the https://openfoodnetwork.org.au/melbourne-farmers-marketplace/shop shop! I just did a test order post my updated shipping calculators and the same thing happened

Workaround

Open the order and select any other tab (payments, adjustments etc) and it clicks to Ready

Severity

I think it's s4 because we don't think it has any significant repercussions, but it is annoying and confusing to the users. and I don't think it used to happen or happens to others? So it makes me nervous

Your Environment

Mac, Chrome but I don't think is relevant

Possible Fix

@kirstenalarsen kirstenalarsen added the bug-s3 The bug is stopping a critical or non-critical feature but there is a usable workaround. label Apr 1, 2020
@lin-d-hop
Copy link
Contributor

I've got this on my long to do list - to understand the different shipping state transitions.

I believe that Stripe payment method sets Shipping State to Pending but manual payment methods set Shipping State to Ready with the little icon you can click to 'Ship'. Thought I've never confirmed this or created issues.

Next Steps:

  1. Identify the how the different Shipping States are created
  2. Make a product decision about what is the correct state transition for Shipping States
  3. Create a set of papercuts that unify these Shipping State transitions.

@RachL
Copy link
Contributor

RachL commented Apr 1, 2020

@kirstenalarsen @lin-d-hop I wonder if this isn't the same as : #4121

@luisramos0
Copy link
Contributor

I dont think this is worrying, I cant see how this could create problems elsewhere except for the actual problem of not seeing the expected state and action buttons to change it.

@kirstenalarsen
Copy link
Contributor Author

yes @RachL I think it is closely related or the same as #4121

The only thing that doesn't gell about your theory abovce @lin-d-hop is that these are ALL Stripe payments, and a couple came through as ready and the rest pending. Athough I suppose it's possible that the user had opened the orders which changed the state

@kirstenalarsen
Copy link
Contributor Author

Just some more cries of pain from the user to add here. Unfortunately I don't think it warrants an S2, but will likely be next cab for Aus S3

"I have a question about marking orders off as shipped, for some reason all of our orders are saying pending in the shipping column, even though payment has been settled through stripe in the checkout. I have to go into each order manually, click onto another part of the order (either customer details or payment) and then when I go back to the order details it has the option to ship then.
With so many orders, this is a hugely manual process and very slow… is there a quicker way to mark as ready to ship as there is from the main orders page with marking off payments?"

@RachL
Copy link
Contributor

RachL commented Apr 16, 2020

Should we close it in favor of #4121 ?

@daniellemoorhead daniellemoorhead added the AU Selected to be done by the Australian active instance label Apr 17, 2020
@luisramos0
Copy link
Contributor

I believe shipment and payment states are not, and should not be, related.
An order can shipped and not payed and payed but not shippped. We shouldnt make them related.

Looking at the spree code, I believe pending shipment is for when order is not complete yet (you cannot ship an incomplete order. Ready is for complete orders and shipped is for when the order is actually shipped.
Apart from this, there is a workflow transition from ready and pending to cancelled and another move back again to pending/ready called resume.

@lbwright22
Copy link

can this be moved to a potential papercut issue?

@lbwright22
Copy link

@mbudm mbudm self-assigned this May 19, 2020
@mbudm
Copy link

mbudm commented May 27, 2020

As discussed in this thread this issue is cause by the order shipping_state being changed from ready to pending in an adjustments callback after the checkout submit. Later, after the order is edited, another adjustment changes the shipping_state back from pending to ready. Ideally this should not happen in such an adhoc, hard to follow way.

Adjustments are a known tech debt issue and quite hard to work with/comprehend. @luisramos0 summarised that the better aproach may be to do this after we have moved Sprre code to OFN:

I'd be very glad to see that someone has an alternative approach but I think the first step to resolve this mess is to bring all the related Spree code to our side (which means moving core model classes like Order, Adjustment, OrderUpdater, etc to our side) and then clean up (remove callbacks, etc) when it's all in the OFN codebase.

@RachL
Copy link
Contributor

RachL commented Jul 28, 2021

@Matt-Yorkley @lin-d-hop do you know if this issue is still blocked?

@RachL RachL removed the AU Selected to be done by the Australian active instance label Jul 28, 2021
@Matt-Yorkley
Copy link
Contributor

Matt-Yorkley commented Jul 29, 2021

I thought it was already resolved..? 🤷‍♂️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked bug-s3 The bug is stopping a critical or non-critical feature but there is a usable workaround.
Projects
Status: All the things 💤
Development

No branches or pull requests

8 participants