{"id":1433,"date":"2020-12-04T16:00:33","date_gmt":"2020-12-04T16:00:33","guid":{"rendered":"https:\/\/meetanshi.com\/blog\/add-product-attribute-to-sales-rules-condition-magento-2\/"},"modified":"2025-05-22T11:24:19","modified_gmt":"2025-05-22T05:54:19","slug":"add-product-attribute-to-sales-rules-condition-magento-2","status":"publish","type":"post","link":"https:\/\/meetanshi.com\/blog\/add-product-attribute-to-sales-rules-condition-magento-2\/","title":{"rendered":"How to Add Product Attribute to Sales Rules Conditions in Magento 2"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Magento 2 allows&nbsp;<a href=\"https:\/\/meetanshi.com\/blog\/create-product-attribute-in-magento-2\/\" target=\"_blank\" rel=\"noreferrer noopener\">creating product attributes<\/a>&nbsp;easily.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Product attributes make it easy to manage the products based on their characteristics. They describe the products more specifically and sets it apart from other products.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This post is all about how to&nbsp;<strong><em>add product attribute to sales rules conditions in Magento 2<\/em><\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Primarily, the sales rules conditions are useful when a store owner wishes to give discounts on specific products. However, the discount strategy amidst cutthroat competition needs to be meticulously drafted.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If the store owner wants to offer a discount on a particular product only and that too for a specific product attribute only, the below method is usful.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Once a merchant adds product attribute to sales rules condition, the condition will be applied everywhere on the storefront.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For instance, you can offer a discount on a product having a colour blue. A smartphone with less popular colour can be sold at discounted prices. Thus, adding the colour attribute to sales rule conditions can be done easily from the admin panel itself.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Steps to Add Product Attribute to Sales Rules Conditions in Magento 2<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Login<\/strong>&nbsp;to Magento 2 admin panel.<\/li>\n\n\n\n<li>Navigate to&nbsp;<strong>Stores &gt; Attributes &gt; Product<\/strong><\/li>\n<\/ul>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" src=\"https:\/\/meetanshi.com\/blog\/wp-content\/uploads\/2020\/11\/Annotation-on-2020-11-20-at-17-51-25.png\" alt=\"Annotation-on-2020-11-20-at-17-51-25\" class=\"wp-image-11760\"\/><\/figure>\n<\/div>\n\n\n<ul class=\"wp-block-list\">\n<li>Select a product attribute and navigate to&nbsp;<strong>Storefront Properties<\/strong><\/li>\n\n\n\n<li>Set&nbsp;<strong>Use for Promo Rule Conditions<\/strong>&nbsp;to<strong>&nbsp;Yes<\/strong><\/li>\n<\/ul>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" src=\"https:\/\/meetanshi.com\/blog\/wp-content\/uploads\/2020\/11\/Annotation-on-2020-11-20-at-17-55-25.png\" alt=\"Annotation-on-2020-11-20-at-17-55-25\" class=\"wp-image-11761\"\/><\/figure>\n<\/div>\n\n\n<ul class=\"wp-block-list\">\n<li>Now, go to&nbsp;<strong>Marketing &gt; Cart Price Rules<\/strong><\/li>\n<\/ul>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" src=\"https:\/\/meetanshi.com\/blog\/wp-content\/uploads\/2020\/11\/Annotation-on-2020-11-20-at-18-06-47.png\" alt=\"Annotation-on-2020-11-20-at-18-06-47\" class=\"wp-image-11762\"\/><\/figure>\n<\/div>\n\n\n<ul class=\"wp-block-list\">\n<li>Open the required cart price rule.<\/li>\n\n\n\n<li>Expand the&nbsp;<strong>Condition<\/strong>&nbsp;section and select product attribute based on your business requirement<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" src=\"https:\/\/meetanshi.com\/blog\/wp-content\/uploads\/2020\/11\/Annotation-on-2020-11-20-at-18-05-09-1.png\" alt=\"Annotation-on-2020-11-20-at-18-05-09-1\" class=\"wp-image-11763\"\/><\/figure>\n<\/div>\n\n\n<ul class=\"wp-block-list\">\n<li>For instance, here I have selected&nbsp;<strong>Color&nbsp;<\/strong>as a product attribute and condition is on color blue.<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" src=\"https:\/\/meetanshi.com\/blog\/wp-content\/uploads\/2020\/11\/Screenshot-at-November-20th-2020-6.02.45-pm.png\" alt=\"Screenshot-at-November-20th-2020-6.02.45-pm-1024x347\" class=\"wp-image-11764\"\/><\/figure>\n<\/div>\n\n\n<ul class=\"wp-block-list\">\n<li>Click&nbsp;<strong>Save<\/strong><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">This shows the sales rules condition is applied for the product Luma Water Bottle having color blue.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That\u2019s it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can also refer to the video tutorial to Add Product Attribute to Sales Rules Conditions in Magento 2 from our&nbsp;<a href=\"https:\/\/www.youtube.com\/playlist?list=PLBTOxSAJzwEjM5MilmEqj98Ib80tKBu7r\" target=\"_blank\" rel=\"noreferrer noopener\">Magento 2 video tutorial<\/a>&nbsp;series:<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"How to Display Products on Homepage in Magento 2\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/_Zfe7QSA__Y?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Do consider sharing this post with Magento Community via social media.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Thank you.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Magento 2 allows&nbsp;creating product attributes&nbsp;easily. Product attributes make it easy to manage the products based on their characteristics. They describe the products more specifically and&#8230;<\/p>\n","protected":false},"author":29,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[34],"tags":[],"class_list":["post-1433","post","type-post","status-publish","format-standard","hentry","category-magento"],"acf":[],"_links":{"self":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/1433","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/users\/29"}],"replies":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/comments?post=1433"}],"version-history":[{"count":2,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/1433\/revisions"}],"predecessor-version":[{"id":14596,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/1433\/revisions\/14596"}],"wp:attachment":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/media?parent=1433"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/categories?post=1433"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/tags?post=1433"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}