Recurring promotions

3 years 4 months ago #321577 by pastoweb
Recurring promotions was created by pastoweb
Hi, I'm using promotions for early bird and grace period discounts for my association membership
Every year I need to edit or duplicate the promotions just to change the year setting, but the periods remain the same: Decembrer 1 to December 31, and Jan 1 to February 28.

Is it possible to make them recurring, so I don't need to edit or duplicate them every year?

Please Log in to join the conversation.

3 years 4 months ago - 3 years 4 months ago #321585 by krileon
Replied by krileon on topic Recurring promotions
You shouldn't need to duplicate them if you're not changing the promotion code. Simply edit and change the dates in "Start date of validity of this promotion" and "End date of validity of this promotion". Best I can suggest is try using the Conditions to replace those parameters behavior so you can use a substitution for the year. The below might work for example.

First condition: This condition:
Date A, Field A or Value A: Order Date of the order wanting to use this promotion
Date B, Field B or Value B: Constant Value or String (CB substitutions can be used)
Value B: [cb:date format="Y" /]-12-01
Condition 1 (> for Dates): For dates: Date A > Date B (Date A must be later than Date B )

The above should result in the date they're purchasing having to be greater than YYYY-12-01 (e.g. 2020-12-01). The [cb:date format="Y" /] substitution should always output the current year.

Now you'll need a second condition to cover the end date. The below should cover this as well.

Second condition And/Or: AND
Date A, Field A or Value A: Constant Value or String (CB substitutions can be used)
Value A: [cb:date format="Y" /]-12-31
Date B, Field B or Value B: Order Date of the order wanting to use this promotion
Condition 1 (> for Dates): For dates: Date A > Date B (Date A must be later than Date B )

The above should result in the date you're purchasing having to be less than YYYY-12-31 (e.g. 2020-12-31).

You might be able to use a single condition for this, but I've not tested such a usage. That would be done with the following instead of the 2 usages above.

First condition: This condition:
Date A, Field A or Value A: Order Date of the order wanting to use this promotion
Date B, Field B or Value B: Constant Value or String (CB substitutions can be used)
Value B: [cb:date format="Y" /]-12-01
Condition 1 (> for Dates): For dates: Date A > Date B (Date A must be later than Date B )
AND Condition 2 (< for Dates): For dates: Date A < Date B + 1 month (Date A must be earlier than 1 month after Date B )

The above adds 1 month to Value B then makes sure the order date is less than that date. It's less specific than the 2 conditions, but it's easier to configure and frees up a condition slot encase you need other conditions.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.281 seconds

Facebook Twitter LinkedIn