medusajs / medusa

The world's most flexible commerce platform.
https://medusajs.com
MIT License
25.93k stars 2.6k forks source link

Shipping options can't have 0 price #8615

Closed radoslaw-sz closed 3 months ago

radoslaw-sz commented 3 months ago

Bug report

Describe the bug

I am following recipe of Digital Products here: https://docs.medusajs.com/v2/resources/recipes/digital-products/examples/standard. I created a Shipping Option and I have put 0 price (as delivery of digital product is free). Unfortunately, it causes error on checkout:

error:   Shipping options with IDs so_01J5B1TNKMHCXFCS41DTM1JCZX do not have a price
MedusaError: Shipping options with IDs so_01J5B1TNKMHCXFCS41DTM1JCZX do not have a price
    at Function.<anonymous> (/home/ubuntu/rsc/medusa/app-medusa/node_modules/@medusajs/core-flows/dist/definition/cart/workflows/list-shipping-options-for-cart.js:77:19)
    at Object.returnFn [as __resolver] (/home/ubuntu/rsc/medusa/app-medusa/node_modules/@medusajs/workflows-sdk/src/utils/composer/transform.ts:182:30)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async resolveProperty (/home/ubuntu/rsc/medusa/app-medusa/node_modules/@medusajs/workflows-sdk/src/utils/composer/helpers/resolve-value.ts:15:12)
    at async resolveValue (/home/ubuntu/rsc/medusa/app-medusa/node_modules/@medusajs/workflows-sdk/src/utils/composer/helpers/resolve-value.ts:75:7)
    at async resolveValue (/home/ubuntu/rsc/medusa/app-medusa/node_modules/@medusajs/workflows-sdk/src/utils/composer/helpers/resolve-value.ts:75:7)
    at async originalExecution (/home/ubuntu/rsc/medusa/app-medusa/node_modules/@medusajs/workflows-sdk/src/helper/workflow-export.ts:126:18)
    at async LocalWorkflow.newRun [as run] (/home/ubuntu/rsc/medusa/app-medusa/node_modules/@medusajs/workflows-sdk/src/helper/workflow-export.ts:186:12)
    at async GET (/home/ubuntu/rsc/medusa/app-medusa/node_modules/@medusajs/medusa/src/api/store/shipping-options/route.ts:34:22)
    at async /home/ubuntu/rsc/medusa/app-medusa/node_modules/@medusajs/utils/src/common/wrap-handler.ts:17:14 {
  type: 'invalid_data',
  code: undefined,

System information

Medusa version (including plugins): Node.js version: 21.7.2 Database: PostgresSQL Operating system: WSL Browser (if relevant):

Steps to reproduce the behavior

  1. Create shipping option with 0 price
  2. Add product to the cart which supports this shipping option
  3. Go to checkout
  4. Blank screen and in the logs as above

Expected behavior

0 euro/dollars etc. shall be available for shipping option.

olivermrbl commented 3 months ago

Thanks for reporting this. Will look into this asap :)