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

Add shipping events to the order serializer #250

Open
hackeraks opened this issue Nov 8, 2020 · 3 comments
Open

Add shipping events to the order serializer #250

hackeraks opened this issue Nov 8, 2020 · 3 comments

Comments

@hackeraks
Copy link

I see that we have two status with respect to Orders. One per Order status which show Status of Order (IMHO show datetime of any transition) and there is another which tracks the shipping status of each orderline. In-order to show status of Order and shipment transition states like : Order placed -> packed -> shipped -> Received at Local delivery Hub -> Out for Delivery -> Delivered etc
I couldn't find this in API specifically with 'orders', which I assume that I have to implement it myself or am I missing something.
Any Help is Highly appreciated, I will be happy to implement that If this is Something that can help follow developer and is a desired feature. TY

[ { "basket": "http://127.0.0.1:8080/api/baskets/6/", "billing_address": null, "currency": "USD", "date_placed": "2020-10-10T19:26:33.808669Z", "guest_email": "", "lines": "http://127.0.0.1:8080/api/orders/3/lines/", "number": "100006", "offer_discounts": [], "owner": "http://127.0.0.1:8080/api/users/2/", "payment_url": "/api/checkout/payment-states/3/", "shipping_address": { .... }, "shipping_code": "free-shipping", "shipping_excl_tax": "0.00", "shipping_incl_tax": "0.00", "shipping_method": "Free shipping", "status": "Authorized", "total_excl_tax": "6574.45", "total_incl_tax": "6574.45", "url": "http://127.0.0.1:8080/api/orders/3/", "voucher_discounts": [] } ]

@maerteijn
Copy link
Member

Not quite understand what your question is, but my guess is that you want to get the status of an order via the API.

The OrderSerializer contains a status field, so it should be there.

Did you chnage something in your Django settings? (eg OSCARAPI_ORDER_FIELDS) ?

@hackeraks
Copy link
Author

The Status provide in OrderSerializer is status for an Order. What I am looking for is as below...

  1. Provide user a way to track the order i.e Status of order when was the state changed example Shipped (Currently it show order_place_date and doesn't include any transition date)
  2. Per orderline status like "Product dispatched" and subsequent transition of it. for example : "Arrived at Local Hub" next status could be "Out for delivery" etc.

All of this should have datetime and a possible comment or Note (example: Expected delivery date and time or Address not found)

I didn't change OSCARAPI_ORDER_FIELDS. TY

@maerteijn
Copy link
Member

Ah ok, so you want to know WHEN statuses have been changed, that makes sense.

This is implemented in Oscar with Shipping Events: https://github.com/django-oscar/django-oscar/blob/01a658c44b1231fffb92db0e95c62dda7c98a704/src/oscar/apps/order/abstract_models.py#L962

We don't provide this (yet) in the API but would be really useful. So we would need to add a ShippingEvent serializer to the orders and probably orderlines, and figure out the logic for that.

@maerteijn maerteijn changed the title Need Help with Shipping Status. Add shipping events to the order serializer Nov 10, 2020
@maerteijn maerteijn removed the question label Feb 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants