reaction
reaction copied to clipboard
Attribute checks in shipping restrictions don't work for nested item properties (e.g. parcel.*)
Issue Description
The checks for shipping restrictions based on an item's properties only work top for level properties such as price. An attribute deny rule that uses the property "weight", as mentioned in the documentation (https://docs.reactioncommerce.com/docs/concepts-fulfillment), does not work, since the property "weight" is nested in "parcel".
Steps to Reproduce
- Create a product with the parcel.weight attribute set
- Create a shipping method
- Create a shipping restriction with the attribute "weight" which would exclude the shipping method for the product if it was applied (as explained in the documentation)
- See that the shipping method is available for the product in checkout process
Possible Solution
Access item properties with _.at(item, attribute.property)
in attributeDenyCheck.js. Change the property in the documentation to "parcel.weight"