medusajs / medusa

Building blocks for digital commerce
https://medusajs.com
MIT License
25k stars 2.5k forks source link

Shipping Options Service Missing, canCalculate never is called. #9598

Open amaster507 opened 23 hours ago

amaster507 commented 23 hours ago

Bug report

Describe the bug

The shipping-options service seems to be missing

System information

Medusa version (including plugins): Node.js version: 20 Database: postgres Operating system: linux host with docker containers running node/postgres/redis/etc. Browser (if relevant): Chrome/NA

Steps to reproduce the behavior

  1. Implement a class extending the AbstractFulfillmentProviderService with the canCalculate and other methods.
  2. Update medusa-config.js to use the custom fulfillment provider service.
  3. Update the admin to use the custom fulfillment provider service and create shipping options using a calculated price.

Expected behavior

The custom fulfullment canCalculate should be called when listing shipping options for a calculated options.

Screenshots

See Discussion linked below

Code snippets

https://github.com/medusajs/medusa/discussions/9495

Additional context

From looking at the 1.x repo, the canCalculate method is called withing the packages > medusa > src > services > shipping-options.ts And this gets called from validatePriceType_ which gets called from validateAndMutatePrice, etc. None of these seem to exist anymore in the v2 repo. Obviously there was a refactor, and I believe these were not added back in after the refactor.

olivermrbl commented 16 hours ago

You are right, we haven't added backend support for calculated prices on shipping options yet. This is something we will look into in the coming days or right after the official release :)