medusa icon indicating copy to clipboard operation
medusa copied to clipboard

Shipping Methods don't get listed for cart based on requirements

Open WoodlegDev opened this issue 1 year ago • 3 comments

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

  1. Go to the Medusa store API endpoint store/shipping-options/{cart_id}.
  2. Observe that the response is an empty array despite existing shipping options that should match the cart's criteria.
  3. Compare with the results from the store/shipping-options endpoint 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. image image image image

WoodlegDev avatar Apr 26 '24 23:04 WoodlegDev

issue still exists

WoodlegDev avatar Jul 12 '24 15:07 WoodlegDev

@WoodlegDev Is this issue resolved? If yes, how??

scriptorShiva avatar Aug 22 '24 07:08 scriptorShiva

@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

WoodlegDev avatar Aug 22 '24 18:08 WoodlegDev

@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?

turistua avatar Sep 12 '24 15:09 turistua

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 ). Screenshot_15

scriptorShiva avatar Sep 12 '24 17:09 scriptorShiva

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.

github-actions[bot] avatar Oct 14 '24 02:10 github-actions[bot]

This issue was closed because it has been stalled for 3 days with no activity.

github-actions[bot] avatar Oct 18 '24 01:10 github-actions[bot]