How to Dynamically Discount Prices based on Product Title or Other Attribute?

Case:

There are products for Men, Women, and Baby. We offer a 20% discount on products having title Men and a 10% discount on products having title Women. Other products will be the same. Let’s follow these steps to learn how to dynamically discount prices based on product title or other attributes:

Solution:

Step 1: We are going to create a dynamic price with a 20% discount for Men.

Go to CTX Feed -> Dynamic Attributes menu on Dashboard. Click Add New button. In the Dynamic Attribute, input field write a name for this Attribute. Note: Do not use any special character in Attribute Name.

For example, we call it Discount for Men. Then, click on the Add Condition button. Then a new row appears to declare your discount.

At the Attribute select option, choose the Price. Then, select the greater than option from Condition. It will be greater than 0. Then select pattern as the output type. Its value is -20%.

Then select Price as the default attribute.

Save this dynamic attribute.

create dynamic discount prices based on product title

Step 2: We are going to create a dynamic price with a 10% discount for Women.

Go to CTX Feed -> Dynamic Attributes menu on Dashboard. Click Add New button. In the Dynamic Attribute input field, write a name for this Attribute. For example, we call it Discount for Women. Then, click on the Add Condition button. Then a new row appears to declare your discount.

At the Attribute select option, choose the Price. Then, select the greater than option from Condition. It will be greater than 0. Then select pattern as the output type. Its value is -10%.

Then select Price as the default attribute.

Save this dynamic attribute.

Final Step: Finally, we create a dynamic attribute for modifying the price in feed.

Go to CTX Feed -> Dynamic Attributes menu on Dashboard. Click Add New button. In the Dynamic Attribute input field write a name for this Attribute.

For example, we name it Discount for Men and Women.

Then, click on the Add Condition button. Then a new row appears to declare your discount.

  1. At the attribute select option, choose the Title.
  2. Then, select the contains from the Condition selection option.
  3. This condition value is Men.
  4. Then, the output type is Attribute. This is default selected.
  5. Then, choose the Discount for Men attribute from the value section list.

Then, click on the Add Condition button. Then a new row appears to declare your discount.

  1. At the attribute select option, choose the Title
  2. Then, select the contains from the Condition selection option.
  3. This condition value is Women.
  4. Then, the output type is Attribute. This is default selected.
  5. Then, choose the Discount for Women attribute from the value section list.

Then select Price as the default attribute.

Save this dynamic attribute.

Lastly, make a feed with the output value as Discount for Men and Women

create dynamic discount prices based on product title

The generated feed is

create dynamic discount prices based on product title

You can also watch a step by step video to learn how you can dynamically discount prices based on product title or other attribute with the CTX feed WooCommerce product feed generator plugin in this following video tutorial:

5 thoughts
  1. Is there a good way to use this technique to set a discounted sales price on the font end of the website? Say I wanted to discount all products from a certain brand in a specific product category by 15%, and set my sale start and end dates as well.

    1. Hi Brad,

      Our plugin is designed to apply changes on the feed only. So, applying sale price on the front end won’t be possible with our plugin. But, you can use plugins like WOOOCS and our plugin is compatible with WOOCS.

      Thank you,

  2. What must be done if our discount is based on product category? Dynamic Attribute is not in the “Value” dropdown. Please assist.

    1. Hi James,

      Please, go to Make feed > click the Clear Cache button on the right top and find the newly created dynamic attribute from the dropdown.
      If you are not getting it on the list, reach out to our technical team from here – webappick.com/contact to get a quick fix.

      Thank you,

  3. the calculation is always wrong. i give -24% in my price value and i get higher discount than i should.

Leave a Reply

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.