Open PKarics opened 1 year ago
I cannot create a multi-vendor order from Admin UI either on v2.0.1. I guess that for the moment, multi-vendor order creation is only supported by calling the relevant GraphQL mutations (as documented here)
More details:
setOrderShippingMethod
) :x:Cannot read properties of null (reading 'toString')
, associated with mutation setDraftOrderShippingMethod (see stack trace below) :x:EDIT this trace in server logs (when selecting a vendor shipping method) might be useful.
[server] TypeError: Cannot read properties of null (reading 'toString')
[server] at idsAreEqual (/var/www/*snip*/node_modules/@vendure/core/src/common/utils.ts:42:16)
[server] at /var/www/*snip*/src/plugins/multivendor-plugin/config/mv-shipping-line-assignment-strategy.ts:47:22
[server] at Array.filter (<anonymous>)
[server] at MultivendorShippingLineAssignmentStrategy.assignShippingLineToOrderLines (/var/www/*snip*/src/plugins/multivendor-plugin/config/mv-shipping-line-assignment-strategy.ts:46:28)
[server] at processTicksAndRejections (node:internal/process/task_queues:95:5)
[server] at async OrderService.setShippingMethod (/var/www/*snip*/node_modules/@vendure/core/src/service/services/order.service.ts:915:17)
After further investigation, it turns out I had an issue with channels associated to a product variant (only default channel was assigned in DB, instead of default channel + the specific vendor channel), whereas the product itself was correctly assigned to the two channels 🤔
Therefore, in file .../multivendor-plugin/config/mv-shipping-line-assignment-strategy.ts, I had an issue in method assignShippingLineToOrderLines()
where line.sellerChannelId
could be null
and make the call to idsAreEqual()
method throw the Cannot read properties of null
error.
After unassigning / reassigning the vendor channel to the product from the admin UI, this issue did not happen anymore.
Describe the bug I would like to create a multi-vendor order on the admin-ui..
To Reproduce Steps to reproduce the behavior:
Expected behavior Order type should changed from regular to aggregate.
Environment (please complete the following information): Independent.
Additional context Possibly the type change is enough when draft state leaved so no more item change expected.