Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ShippableInterface in throughout the whole shipping cost calculation process #678

Closed
dlhck opened this issue Oct 10, 2018 · 2 comments
Closed
Assignees
Milestone

Comments

@dlhck
Copy link
Contributor

dlhck commented Oct 10, 2018

Q A
Bug report? no
Feature request? yes
BC Break report? no
RFC? yes

Currently some parts like the DefaultCarrierResolver and so on are using the ShippableInterface. Shipping rule conditions and actions are requiring the CartInterface. That means if the shippable object is no cart, the whole shipping cost calculation won't work.
So my suggestion would be to implement a function in the ShippableInterface called getSale and use the ShippableInterface throughout the whole process. If conditions or actions need some information like the store or currency of the sale, they just call getSale and get the cart or order or any other object that implements the SaleInterface

@dlhck dlhck changed the title User ShippableInterface in complete shipping cost calculation process User ShippableInterface in throughout the whole shipping cost calculation process Oct 10, 2018
@dpfaffenbauer
Copy link
Member

Well, not a 100 percent right... Shipping rule conditions and actions still require a Shippable, but the default implementations of some conditions/actions require that shipable is a cart, therefore you potentially could overwrite those.

But, you are definitely right that the current solution is not ideal

@dpfaffenbauer dpfaffenbauer added this to the 2.1.0 milestone Oct 15, 2018
@dpfaffenbauer dpfaffenbauer self-assigned this Oct 15, 2018
@dlhck dlhck changed the title User ShippableInterface in throughout the whole shipping cost calculation process Use ShippableInterface in throughout the whole shipping cost calculation process Oct 19, 2018
dpfaffenbauer added a commit to dpfaffenbauer/CoreShop that referenced this issue Jan 17, 2019
@dpfaffenbauer
Copy link
Member

Think thats already done now

@dpfaffenbauer dpfaffenbauer modified the milestones: 2.1.0, 2.0.3 Feb 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants