Want to have dynamic text for only a short period of time? We will guide you on how to have dynamic Black Friday text for your desired time frame.
Do you know that you can create dynamic text based on a date condition ensuring that you for example have relevant Black Friday text the entire day? Or relevant Christmas during the festive period? Maybe some birthday text for when your webshop celebrates anniversaries or any other desired period?
Now you know. It is indeed possible and it is very simple to do so. Just follow the steps below.
Adding the condition
You start by creating a scenario for your Black Friday content on your product.
You can read more about conditions right here: Setting up conditions
Then you add the condition and choose advanced mode instead of simple mode. In the advanced mode you add the following CEL code and save it:
Now()>=24-11-2022 22:00:00
This code means that the software must only write the text when the date and time is greater than or equal to the 24th of november at 10 pm. Se our Content Expression Language to navigate in the different date operators.
Then you add another condition with the following CEL code and save it:
Now()<=25-11-2022 22:00:00
This code means that the software must only write the text when the date and time is less than or equal to the 25th of november at 10 pm.
Remember to change the date and time so it fits your needs
The conditions now looks as below.
It means that when it is within the time period of the CEL code in the condition the scenario is true/valid and can thus be used in your descriptions.
Be aware of the timezone of the software. The timezone is based on the one your webshop are using.
Republish your template
As in any other case where there has been changes for the template make sure to republish your template. Se how you do here: How do I publish my template?
Forcing webhooks
It is recommended that you start forcing webhooks a little before depending on the amount of products that needs Black Friday text. It can take a while for several thousands products to receive updated product descriptions.
When Black Friday is over you will have to force webhooks once again so that you receive updated product descriptions without the Black Friday text.