Our Prestashop connector allows you to automatically generate individual promotional codes for every recipient of a campaign who also exists in Prestashop database.
This tutorial will explain how to create a master code in Prestashop, and how to use it in a Probance One campaign to send unique promo codes to your contacts.
1. Create a master code in Prestashop
A master code is a cart rule that is created with specific settings so that it can be integrated with Probance One, and be used to generate individual promo codes.
When a master code is used in a campaign, the corresponding cart rule is duplicated to create a new – unique – promo code for every recipient who also exists in Prestashop database.
A master code must be configured with all the characteristics of the promo code you wish to send, such as the type and amount of the discount, the validity duration or the delivery fees handling. It must also fits some conditions to be identified by our connector and exported to Probance One.
Access the menu Catalog > Discounts and open the Cart rule tab. Click on Add a cart rule.
- The Information tab contains the identification and the main characteristics of the code. Your master code must configured as follow:
- Name
Choose a name that allows you to identify it easily in Prestashop. There is not name rule for the master code. - Description
The description of the rule must contain MASTER. This is what will identify the rule as a master code for Probance One. - Code
The code is used as an identifier for the master in Probance One. It cannot contain any special character. Choose a value that express the marketing object of the master code, and makes it easy to identify. - Highlight
If this option is activated, Prestashop will inform the client that a promo code is available. This setting will be applied to all promo codes generated from the master code. - Partial use
If this option is activated, a new promo code will be generated automatically when the code is used for an amount that is lower than its value (if the total paid is lower than the discount value). This setting will be applied to all promo codes generated from the master code. - Priority
The priority level defines the order in which promo codes are applied when there is more than one code used on one cart. 1 is the highest level of priority. This setting will be applied to all promo codes generated from the master code. - Status
YES must be selected, so that all the promo code generated from the master are active and usable by default.

- The Conditions tab allows you to defined when, how and by whom the code can be used. Your master code must configured as follow:
- Limit to a single client
This field must remain empty. When a code is generated from the master code, this field will contain the information of the recipient for which it was created. - Validity
The validity duration of your master code must be fit that validity you want to apply to your promo codes. When a code is generated from the master code, the start date will be replaced with the current date, and the end date will be actualized so that the difference between the two is a the same as the master code. - Minimum amount
Define the amount from which the promo code can be used. This setting will be applied to all promo codes generated from the master code. - Total available
This field must remain at 1 : every promo code generated from the master will be usable by a single client. - Total available for each user
This field must remain at 1. - Restrictions
The options here allow you to filter the application scope of the promo code.
The option Customer group selection must remain unchecked.

- The Actions tab allows your define the discount applied. Your master code must configured as follow:
- Free delivery
If this option is activated, the code will offer the delivery fees to the buyer. This setting will be applied to all promo codes generated from the master code. - Apply a discount
Specify here the discount that will be applied by the promo code. It can be defined- In percent, and be applied on the full order, one or several specific products, or on the cheapest product of the cart;
- In a fixed amount, and be applied on the full order of a specific product from the cart.
- Exclude discounted products
If this option is activated, the code will not be usable with already discounted products. This setting will be applied to all promo codes generated from the master code. - Send a free gift
If this option is activated, the code will also add a free product to the client’s cart. This setting will be applied to all promo codes generated from the master code.

Read Prestashop official documentation on cart rules configuration to learn more about the options available.
Save the cart rule: the master is created, and will be integrated in Probance One during the next daily processing.
Important: the master will be available in Probance One from the day after its created in Prestashop.
2. Configure the master in Probance One
Once the master code available in Probance One, you can configure it as promo code generation source in a newsletter or an automated campaign.
- Access the campaign page in Probance One, and click on Edit in the Personalized Offer section.

- Click on the edition icon of the BON_MASTER proposed offer.

- Select Choose the master code.

- Set the minimum number of offers to send the campaign at 1.

- Click on Add a constraint. Select bon_master in the first dropdown list, and Equal to in the second one. In the third field, fill up or select the code of your master code in Prestashop.

- Click on Save to confirm your configuration.
Important: Make sure to use the code of the master, and not its name.
Then, whenever the campaign is be sent, a new cart rule with the same configuration at the master code, the validity dates actualized, and limited to a single client is generated for every targeted contact. Each recipient will therefore receive their own promo code.
3. Include the promo code in the template
The last thing you need to do for your contacts to receive their own individual promo code is to display it in the campaign template.
To do so, you only need to add the personalization tag ${_bon_master_bon_master_1} where you want to display the code in the template. When the campaign is sent, the tag will be replaced with the promo code of each recipient.
Note: In the template preview and when sending test emails, the personalization tag is remplaced by the code of the master.