fix problem with setCartFixedRules #1768
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem:
You redeclare setData to set imploded streets, but this method is used by Your discount model, for example
$address->setCartFixedRules($cartRules);
in result array of cart rules set like string and discount to whole cart don't work properly.
How To Reproduce:
You can reproduce this issue by giving discount to whole cart with more than 1 item in cart.
Discount applied 1 time and after that you set array of cartRules to address, but in result you set string instead array and cartFixed rule was broken.
screen shot - http://joxi.ru/vAWRbgGFMwzv2W?d=1 , http://joxi.ru/4Ak05d1hw3DVrq?d=1
Why this fix:
Just redeclare setter of CartFixedRules and call parent setData to prevent imploding strings