-
Notifications
You must be signed in to change notification settings - Fork 33
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
[Improvement]: CartInterface::setCheckoutData
should accept null values as data
#217
Comments
It seems like |
@jdreesen there is no api to remove checkout data from the cart. As far as I am concerned, either there should be a way to remove checkout data from the cart or setCheckoutData should accept null as the value param (to invalidate the previously set checkout data). I think a better example would be something like this:
what do you think? |
It should definitely be possible to reset/remove the data. In our current project, we are still using Pimcore 10, where the types are still annotated in the PHPDoc. There we pass What I meant in my comment was that |
In fact, looking at the code, I'm not sure if it currently works when an What we currently do in our project is the manual serialization of such values in JSON before and deserialization after. But this is not very convenient. |
Thanks a lot for reporting the issue. We did not consider the issue as "Pimcore:Priority", "Pimcore:ToDo" or "Pimcore:Backlog", so we're not going to work on that anytime soon. Please create a pull request to fix the issue if this is a bug report. We'll then review it as quickly as possible. If you're interested in contributing a feature, please contact us first here before creating a pull request. We'll then decide whether we'd accept it or not. Thanks for your understanding. |
Improvement description
The
AbstractCartCheckoutData
class accepts null values as data attribute. In fact, by default the value is nullecommerce-framework-bundle/src/CartManager/AbstractCartCheckoutData.php
Lines 19 to 27 in 82a567e
By this logic, we should be able to set null to cart data using the implementation in CartInterface
But, CartInterface method signature does not allow this.
ecommerce-framework-bundle/src/CartManager/CartInterface.php
Lines 154 to 159 in 82a567e
The text was updated successfully, but these errors were encountered: