Hello Magento Friends,
In this tutorial, I will be justifying How to Add Product Attribute to Sales Rules Conditions in Magento 2. Just in case, you failed to check out the previous blog, How to Add Orders and Returns Widget in Magento 2.
Product attributes in Magento 2 are used to describe a product, its appearance, and behavior. Sales rules conditions are used to set discounts on particular products. But if the Magento store owners want to offer discounts on a product and that also for a specific product attribute. To do this, you need to set sales rules conditions for product attributes.
Let’s learn the steps for How to Add Product Attribute to Sales Rules Conditions in Magento 2.
Steps to Add Product Attribute to Sales Rules Conditions in Magento 2:
Step 1: Log in to Admin Panel and go to Stores > Attributes > Product
Step 2: Select your desired Product Attribute. Then, go to Storefront Properties from the left panel and set Yes to Use for Promo Rule Conditions. Lastly, Save Attribute.
Step 3: Now, navigate to Marketing > Promotions > Cart Price Rules
Step 4: Select your desired Cart Price Rules. Expand the Conditions option. Now, add the condition as per the requirement and click Save.
Hence, with the help of the above steps, you can Add Product Attributes to Sales Rules Conditions in Magento 2. If you face any challenges with the execution of the above code, notify me in the comment part below. Share the tutorial with your Magento fellow colleagues. Will be back with another solution, till then stay in touch.