Closed julianengel closed 3 days ago
This happens in every scenario:
Guest to Customer Customer to Customer Guest (same email) to Cusotomer
hey @julianengel, cannot reproduce the issue on my end. Can you share what version of Medusa utils package you have installed.
Also could you share: cat node_modules/@medusajs/utils/dist/order/order-change-action.js
.
Sure thing.
node_modules/@medusajs/utils/dist/order/order-change-action.js:
var ChangeActionType;
(function (ChangeActionType) {
ChangeActionType["FULFILL_ITEM"] = "FULFILL_ITEM";
ChangeActionType["DELIVER_ITEM"] = "DELIVER_ITEM";
ChangeActionType["CANCEL_ITEM_FULFILLMENT"] = "CANCEL_ITEM_FULFILLMENT";
ChangeActionType["ITEM_ADD"] = "ITEM_ADD";
ChangeActionType["ITEM_REMOVE"] = "ITEM_REMOVE";
ChangeActionType["ITEM_UPDATE"] = "ITEM_UPDATE";
ChangeActionType["RECEIVE_DAMAGED_RETURN_ITEM"] = "RECEIVE_DAMAGED_RETURN_ITEM";
ChangeActionType["RECEIVE_RETURN_ITEM"] = "RECEIVE_RETURN_ITEM";
ChangeActionType["RETURN_ITEM"] = "RETURN_ITEM";
ChangeActionType["CANCEL_RETURN_ITEM"] = "CANCEL_RETURN_ITEM";
ChangeActionType["SHIPPING_ADD"] = "SHIPPING_ADD";
ChangeActionType["SHIPPING_REMOVE"] = "SHIPPING_REMOVE";
ChangeActionType["SHIP_ITEM"] = "SHIP_ITEM";
ChangeActionType["WRITE_OFF_ITEM"] = "WRITE_OFF_ITEM";
ChangeActionType["REINSTATE_ITEM"] = "REINSTATE_ITEM";
})(ChangeActionType || (exports.ChangeActionType = ChangeActionType = {}));
//# sourceMappingURL=order-change-action.js.map
I'm nor sure I have utils installed?
This is all the medusa libs from the package.json
"@medusajs/admin-sdk": "latest",
"@medusajs/cli": "latest",
"@medusajs/framework": "latest",
"@medusajs/medusa": "^2.0.6",
Installing utils resolved the issue! Thank you :) Not sure how I managed to not have the, installed.
If anyone else stumbles upon this, npm i @medusajs/utils
Different question @fPolic, what's the expected flow after transferring the order? because nothing changes, and trying to do it again it says there's already has an existing active order change
Do we need to confirm it somehow?
Utils package was installed but it seems that you had an older version.
it says there's already has an existing active order change
Order Transfer uses Order Change mechanism and there can only be one active change on an order so either the transfer needs to be accepted/declined by a customer or you cancel the transfer request from Admin.
Do we need to confirm it somehow?
Order transfer is a 2 step process. Original owner of the order needs to accept the transfer request. After you created a transfer request via Admin, an event is dispatched which you can use to send an email to the owner with accept and decline links that include a token from the order change details.
This is a feature that was just introduced. We will publish a blog post with more details tomorrow and add documentation on the topic soon.
Ah, thank you! Makes sense :) Appreciate it!
I saw the function in the Admin UI a while ago but saw that it was redirecting to a 404, so figured it would come later. Much appreciated!
If I could have one favor to ask, in the blog post/documentation, if you could include how you can cancel it from the admin? Because I couldn't find it anywhere in the default admin ui :) (or if we need to make a custom button for it)
Thanks for all your hard work!
You can see all order change events in the sidebar on the order details page. There is an event in the timeline "Transfer
@fPolic That is what I thought as well, but it wasn't there.
In the server logs (npx medusa develop
), I also only saw a 200 of the post to create the transfer, but no extra logs. Then on subsequent attempts where an error was thrown, it showed the token and related data.
It could be that I'm running something that is outdated (like the utils were), but the 'cancel' button is not showing up.
Package.json file
Node.js version
v20.18.0
Database and its version
Postgres 17.2
Operating system name and version
Ubuntu 22.04
Browser name
Arc/Firefox/Safari
What happended?
When trying to change ownership of an order through the admin UI, it says: Toast - An unknown error occurred
It shows the dialogue correctly, but then it gives an unexpected error. Using the Medusa Admin UI.
Expected behavior
Change of ownership of order.
Actual behavior
Frontend: An unexpected error occurred
Backend:
Link to reproduction repo
N/A