I am using this article to create a custom condition in the cart rule where I want to add the stock qty including other product attributes in the rule condition.
For example if product_attribute1 = Adidas and product_qty >= 100 apply the rule on that product.
I can add conditions successfully, but when I try to validate the rule with product qty. I am facing some issues.
When I debug the code and find that there is the wrong class attached in
I have changed Customer
(Magently\CustomerRule\Model\Rule\Condition\Customer) class to Product
(Magently\CustomerRule\Model\Rule\Condition\Product) class, but still it showing
Magento\Quote\Model\Quote\Address in validate function.
I need the
Magento\Quote\Model\Quote\Item class, as I review the core functionality so that I can get the product qty and validate the product qty before applying the rule in the cart.
Please let me know where the address class is defined SO I can change it or is there any other way to do this.