medusa
medusa copied to clipboard
Shipping Methods don't get listed for cart based on requirements
Bug report
Describe the bug
When using the store/shipping-options/{cart_id} endpoint in our Medusa store, the API returns an empty array instead of listing the available shipping options based on the cart's requirements. This issue does not occur when using the store/shipping-options endpoint, which correctly displays all shipping options with their respective minimum and maximum cart requirements. Additionally, attempting to manually add a shipping option that does not meet the cart requirements correctly prevents the addition, indicating some functionality of the shipping logic works as intended.
Steps to reproduce the behavior
- Go to the Medusa store API endpoint
store/shipping-options/{cart_id}. - Observe that the response is an empty array despite existing shipping options that should match the cart's criteria.
- Compare with the results from the
store/shipping-optionsendpoint where shipping options are displayed correctly.
Expected behavior
The expected behavior is that the store/shipping-options/{cart_id} endpoint should return a list of available shipping options that match the current cart's requirements, similar to how the generic store/shipping-options endpoint operates.
Screenshots
If applicable, add screenshots to help explain your problem.
issue still exists
@WoodlegDev Is this issue resolved? If yes, how??
@scriptorShiva unfortunately not. We implemented for the time custom logic, but it's not optimal. It's not critical for us anymore - but in my experience help is better on the discord
@scriptorShiva unfortunately not. We implemented for the time custom logic, but it's not optimal. It's not critical for us anymore - but in my experience help is better on the discord
did you implement your own logic to define which payment methods are applicable to your cart?
Yes, and also this issue is resolved by going through its implementation how its implemented. I get to know few points. This particular API using few methods as shown below before giving us result. so, most of the times if one of the function's condition did not match it return as empty array.
FOR DEBUG : You have to check all those functions in whichever service its calling and debug it accordingly.
In my case :
a. Make sure shipping options you are creating add its subtotal cart min , max value and its should range between your cart total value.
b. Everywhere in medusa when you are adding amount make sure add it by multiply with 100 and when you want to show it (show it by % by 100 so that it support decimal values ).
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 3 days.
This issue was closed because it has been stalled for 3 days with no activity.