Closed (won't fix)
Project:
Commerce Fee
Version:
1.0.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
18 Mar 2021 at 03:35 UTC
Updated:
30 Dec 2025 at 18:59 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
jsacksick commentedThere's no reason to have logic in Commerce shipping to integrate properly with Commerce Fee.
This should live in Commerce Fee.
Comment #3
jsacksick commentedThe current patch should add a condition on the shipment.
And $shipment->getShippingService() is what needs to be tested.
The commerce_fee part of the logic should be left out of this patch.
Comment #4
jsacksick commentedProvides the shipping service condition for shipments.
entity_type = "commerce_shipping_method",
The comment contradicts the actual entity type the condition is attached to.
We don't expose shipping method conditions anywhere.
Comment #5
jsacksick commentedSo the problem is, shipment conditions are exposed in the shipping method UI.
And that is used to determine whether a particular shipping method is available, so it doesn't actually make sense to have a shipping method|service condition added to shipments.
Comment #6
oadaeh commentedOkay, where would be a better place to expose the shipment conditions?
Comment #7
oadaeh commentedActually, maybe I'm not understanding what you're referring to, because I added the UI to the add/edit Commerce Fee page in the same way that the Order Items condition is added.
Comment #8
oadaeh commentedHere's another patch.
This one is applied to Commerce Fee.
I haven't added tests yet, but hopefully I addressed everything else. I'll add the tests next.
Comment #9
jsacksick commentedYou cannot do that as there's no guarantee commerce_fee_shipping is enabled, that can cause a crash.
You probably need to expose 2 settings (the shipping method, and then the service) as the same service ID can be referenced by different shipping methods.
Comment #10
jsacksick commentedSimilar to what you were doing inside commerce_shipping, it probably makes sense to swap the Fee entity class from commerce_shipping.
Similar to what's done for order items.
The logic should loop on the shipments, and pass the shipment entity to the plugin.
Comment #11
jsacksick commentedAlso, this condition should live inside commerce_shipping, otherwise it'll crash.
Because you cannot have a condition plugin targeting an entity type that doesn't exist.
So what you need to sum up:
Comment #12
damienmckennaComment #13
oadaeh commented