{"id":29675,"date":"2024-03-05T04:49:05","date_gmt":"2024-03-05T04:49:05","guid":{"rendered":"https:\/\/doc.probance.com\/?post_type=tutoriels&#038;p=29675"},"modified":"2025-01-14T13:16:37","modified_gmt":"2025-01-14T13:16:37","slug":"generating-unique-promo-codes-in-prestashop","status":"publish","type":"tutoriels","link":"https:\/\/doc.probance.com\/en\/knowledge-base\/generating-unique-promo-codes-in-prestashop\/","title":{"rendered":"Generating unique promo codes in Prestashop"},"content":{"rendered":"\n<p><em>Our Prestashop connector allows you to automatically generate individual promotional codes for every recipient of a campaign who also exists in Prestashop database.<\/em><\/p>\n\n\n\n<p><em>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.<\/em><\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"ancre1\">1. Create a master code in Prestashop<\/h2>\n\n\n\n<p>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.<\/p>\n\n\n\n<p>When a master code is used in a campaign, the corresponding cart rule is duplicated to create a new \u2013 unique \u2013 promo code for every recipient who also exists in Prestashop database.<\/p>\n\n\n\n<p>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.<\/p>\n\n\n\n<p>Access the menu&nbsp;<strong>Catalog &gt; Discounts&nbsp;<\/strong>and open the<strong>&nbsp;Cart rule<\/strong>&nbsp;tab. Click on&nbsp;<strong>Add a cart rule<\/strong>.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>The<strong>&nbsp;Information<\/strong>&nbsp;tab contains the identification and the main characteristics of the code. Your master code must configured as follow:<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Name<\/strong><br>Choose a name that allows you to identify it easily in Prestashop. There is not name rule for the master code.<\/li>\n\n\n\n<li><strong>Description<\/strong><br>The description of the rule must contain&nbsp;<strong>MASTER<\/strong>. This is what will identify the rule as a master code for Probance One.<\/li>\n\n\n\n<li><strong>Code<\/strong><br>The code is used as an identifier for the master in Probance One.<strong>&nbsp;It cannot contain any special character<\/strong>. Choose a value that express the marketing object of the master code, and makes it easy to identify.<\/li>\n\n\n\n<li><strong>Highlight<\/strong><br>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.<\/li>\n\n\n\n<li><strong>Partial use<\/strong><br>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.<\/li>\n\n\n\n<li><strong>Priority<\/strong><br>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.<\/li>\n\n\n\n<li><strong>Status<\/strong><br><strong>YES<\/strong>&nbsp;must be selected, so that all the promo code generated from the master are active and usable by default.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1787\" height=\"908\" src=\"https:\/\/doc.probance.com\/wp-content\/uploads\/2025\/01\/image.png\" alt=\"\" class=\"wp-image-29676\" srcset=\"https:\/\/doc.probance.com\/wp-content\/uploads\/2025\/01\/image.png 1787w, https:\/\/doc.probance.com\/wp-content\/uploads\/2025\/01\/image-300x152.png 300w, https:\/\/doc.probance.com\/wp-content\/uploads\/2025\/01\/image-1024x520.png 1024w, https:\/\/doc.probance.com\/wp-content\/uploads\/2025\/01\/image-768x390.png 768w, https:\/\/doc.probance.com\/wp-content\/uploads\/2025\/01\/image-1536x780.png 1536w\" sizes=\"auto, (max-width: 1787px) 100vw, 1787px\" \/><\/figure>\n\n\n\n<ol start=\"2\" class=\"wp-block-list\">\n<li> The&nbsp;<strong>Conditions<\/strong>&nbsp;tab allows you to defined when, how and by whom the code can be used. Your master code must configured as follow:<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Limit to a single client<\/strong><br>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.<\/li>\n\n\n\n<li><strong>Validity<\/strong><br>The validity&nbsp;<strong>duration<\/strong>&nbsp;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.<\/li>\n\n\n\n<li><strong>Minimum amount<\/strong><br>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.<\/li>\n\n\n\n<li><strong>Total available<\/strong><br>This field must remain at 1 : every promo code generated from the master will be usable by a single client.<\/li>\n\n\n\n<li><strong>Total available for each user<\/strong><br>This field must remain at 1.<\/li>\n\n\n\n<li><strong>Restrictions<\/strong><br>The options here allow you to filter the application scope of the promo code.<br>The option&nbsp;<strong>Customer group selection<\/strong>&nbsp;must remain unchecked.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1787\" height=\"908\" src=\"https:\/\/doc.probance.com\/wp-content\/uploads\/2025\/01\/image-1.png\" alt=\"\" class=\"wp-image-29679\" srcset=\"https:\/\/doc.probance.com\/wp-content\/uploads\/2025\/01\/image-1.png 1787w, https:\/\/doc.probance.com\/wp-content\/uploads\/2025\/01\/image-1-300x152.png 300w, https:\/\/doc.probance.com\/wp-content\/uploads\/2025\/01\/image-1-1024x520.png 1024w, https:\/\/doc.probance.com\/wp-content\/uploads\/2025\/01\/image-1-768x390.png 768w, https:\/\/doc.probance.com\/wp-content\/uploads\/2025\/01\/image-1-1536x780.png 1536w\" sizes=\"auto, (max-width: 1787px) 100vw, 1787px\" \/><\/figure>\n\n\n\n<ol start=\"3\" class=\"wp-block-list\">\n<li>The&nbsp;<strong>Actions<\/strong>&nbsp;tab allows your define the discount applied. Your master code must configured as follow:<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Free delivery<\/strong><br>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.<\/li>\n\n\n\n<li><strong>Apply a discount<\/strong><br>Specify here the discount that will be applied by the promo code. It can be defined<ul><li>In percent, and be applied on the full order, one or several specific products, or on the cheapest product of the cart;<\/li><li>In a fixed amount, and be applied on the full order of a specific product from the cart.<\/li><\/ul>This setting will be applied to all promo codes generated from the master code.<\/li>\n\n\n\n<li><strong>Exclude discounted products<\/strong><br>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.<\/li>\n\n\n\n<li><strong>Send a free gift<\/strong><br>If this option is activated, the code will also add a free product to the client\u2019s cart. This setting will be applied to all promo codes generated from the master code.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1787\" height=\"998\" src=\"https:\/\/doc.probance.com\/wp-content\/uploads\/2025\/01\/image-2.png\" alt=\"\" class=\"wp-image-29682\" srcset=\"https:\/\/doc.probance.com\/wp-content\/uploads\/2025\/01\/image-2.png 1787w, https:\/\/doc.probance.com\/wp-content\/uploads\/2025\/01\/image-2-300x168.png 300w, https:\/\/doc.probance.com\/wp-content\/uploads\/2025\/01\/image-2-1024x572.png 1024w, https:\/\/doc.probance.com\/wp-content\/uploads\/2025\/01\/image-2-768x429.png 768w, https:\/\/doc.probance.com\/wp-content\/uploads\/2025\/01\/image-2-1536x858.png 1536w\" sizes=\"auto, (max-width: 1787px) 100vw, 1787px\" \/><\/figure>\n\n\n\n<p>Read&nbsp;<a href=\"https:\/\/docs.prestashop-project.org\/1.7-documentation\/v\/french\/guide-utilisateur\/vendre\/gerer-catalogue\/mettre-en-place-promotions\/regles-paniers#reglespaniers-ongletactions\">Prestashop official documentation on cart rules configuration<\/a>&nbsp;to learn more about the options available.<\/p>\n\n\n\n<p>Save the cart rule: the master is created, and will be integrated in Probance One during the next daily processing.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-style-important is-layout-flow wp-block-quote-is-layout-flow\">\n<p><strong>Important:&nbsp;<\/strong>the master will be available in Probance One from the day after its created in Prestashop.<\/p>\n<\/blockquote>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"ancre2\">2. Configure the master in Probance One<\/h2>\n\n\n\n<p>Once the master code available in Probance One, you can configure it as promo code generation source in a newsletter or an automated campaign.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Access the campaign page in Probance One, and click on&nbsp;<strong>Edit<\/strong>&nbsp;in the&nbsp;<em>Personalized Offer<\/em>&nbsp;section.<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1828\" height=\"953\" src=\"https:\/\/doc.probance.com\/wp-content\/uploads\/2025\/01\/image-3.png\" alt=\"\" class=\"wp-image-29685\" srcset=\"https:\/\/doc.probance.com\/wp-content\/uploads\/2025\/01\/image-3.png 1828w, https:\/\/doc.probance.com\/wp-content\/uploads\/2025\/01\/image-3-300x156.png 300w, https:\/\/doc.probance.com\/wp-content\/uploads\/2025\/01\/image-3-1024x534.png 1024w, https:\/\/doc.probance.com\/wp-content\/uploads\/2025\/01\/image-3-768x400.png 768w, https:\/\/doc.probance.com\/wp-content\/uploads\/2025\/01\/image-3-1536x801.png 1536w\" sizes=\"auto, (max-width: 1828px) 100vw, 1828px\" \/><\/figure>\n\n\n\n<ol start=\"2\" class=\"wp-block-list\">\n<li>Click on the edition icon of the&nbsp;<strong>BON_MASTER proposed offer<\/strong>.<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1828\" height=\"1023\" src=\"https:\/\/doc.probance.com\/wp-content\/uploads\/2025\/01\/image-4.png\" alt=\"\" class=\"wp-image-29688\" srcset=\"https:\/\/doc.probance.com\/wp-content\/uploads\/2025\/01\/image-4.png 1828w, https:\/\/doc.probance.com\/wp-content\/uploads\/2025\/01\/image-4-300x168.png 300w, https:\/\/doc.probance.com\/wp-content\/uploads\/2025\/01\/image-4-1024x573.png 1024w, https:\/\/doc.probance.com\/wp-content\/uploads\/2025\/01\/image-4-768x430.png 768w, https:\/\/doc.probance.com\/wp-content\/uploads\/2025\/01\/image-4-1536x860.png 1536w\" sizes=\"auto, (max-width: 1828px) 100vw, 1828px\" \/><\/figure>\n\n\n\n<ol start=\"3\" class=\"wp-block-list\">\n<li>Select&nbsp;<strong>Choose the master code<\/strong>.<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1828\" height=\"1023\" src=\"https:\/\/doc.probance.com\/wp-content\/uploads\/2025\/01\/image-5.png\" alt=\"\" class=\"wp-image-29691\" srcset=\"https:\/\/doc.probance.com\/wp-content\/uploads\/2025\/01\/image-5.png 1828w, https:\/\/doc.probance.com\/wp-content\/uploads\/2025\/01\/image-5-300x168.png 300w, https:\/\/doc.probance.com\/wp-content\/uploads\/2025\/01\/image-5-1024x573.png 1024w, https:\/\/doc.probance.com\/wp-content\/uploads\/2025\/01\/image-5-768x430.png 768w, https:\/\/doc.probance.com\/wp-content\/uploads\/2025\/01\/image-5-1536x860.png 1536w\" sizes=\"auto, (max-width: 1828px) 100vw, 1828px\" \/><\/figure>\n\n\n\n<ol start=\"4\" class=\"wp-block-list\">\n<li>Set the&nbsp;<strong>minimum number of offers to send the campaign<\/strong>&nbsp;at 1.<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1828\" height=\"1113\" src=\"https:\/\/doc.probance.com\/wp-content\/uploads\/2025\/01\/image-6.png\" alt=\"\" class=\"wp-image-29694\" srcset=\"https:\/\/doc.probance.com\/wp-content\/uploads\/2025\/01\/image-6.png 1828w, https:\/\/doc.probance.com\/wp-content\/uploads\/2025\/01\/image-6-300x183.png 300w, https:\/\/doc.probance.com\/wp-content\/uploads\/2025\/01\/image-6-1024x623.png 1024w, https:\/\/doc.probance.com\/wp-content\/uploads\/2025\/01\/image-6-768x468.png 768w, https:\/\/doc.probance.com\/wp-content\/uploads\/2025\/01\/image-6-1536x935.png 1536w\" sizes=\"auto, (max-width: 1828px) 100vw, 1828px\" \/><\/figure>\n\n\n\n<ol start=\"5\" class=\"wp-block-list\">\n<li>Click on&nbsp;<strong>Add a constraint<\/strong>. Select&nbsp;<strong>bon_master<\/strong>&nbsp;in the first dropdown list, and&nbsp;<strong>Equal to<\/strong>&nbsp;in the second one. In the third field, fill up or select the<strong>&nbsp;code<\/strong>&nbsp;of your master code in Prestashop.<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1828\" height=\"1251\" src=\"https:\/\/doc.probance.com\/wp-content\/uploads\/2025\/01\/image-7.png\" alt=\"\" class=\"wp-image-29697\" srcset=\"https:\/\/doc.probance.com\/wp-content\/uploads\/2025\/01\/image-7.png 1828w, https:\/\/doc.probance.com\/wp-content\/uploads\/2025\/01\/image-7-300x205.png 300w, https:\/\/doc.probance.com\/wp-content\/uploads\/2025\/01\/image-7-1024x701.png 1024w, https:\/\/doc.probance.com\/wp-content\/uploads\/2025\/01\/image-7-768x526.png 768w, https:\/\/doc.probance.com\/wp-content\/uploads\/2025\/01\/image-7-1536x1051.png 1536w\" sizes=\"auto, (max-width: 1828px) 100vw, 1828px\" \/><\/figure>\n\n\n\n<ol start=\"6\" class=\"wp-block-list\">\n<li>Click on<strong>&nbsp;Save&nbsp;<\/strong>to confirm your configuration.<\/li>\n<\/ol>\n\n\n\n<blockquote class=\"wp-block-quote is-style-important is-layout-flow wp-block-quote-is-layout-flow\">\n<p><strong>Important:&nbsp;<\/strong>Make sure to use the code of the master, and not its name.<\/p>\n<\/blockquote>\n\n\n\n<p>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&nbsp;<strong>for every targeted contact<\/strong>. Each recipient will therefore receive their own promo code.<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"ancre3\">3. Include the promo code in the template<\/h2>\n\n\n\n<p>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.<\/p>\n\n\n\n<p>To do so, you only need to add the personalization tag&nbsp;&nbsp;<code>${_bon_master_bon_master_1}<\/code>&nbsp;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.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-style-note is-layout-flow wp-block-quote-is-layout-flow\">\n<p><strong>Note:&nbsp;<\/strong>In the template preview and when sending test emails, the personalization tag is remplaced by the code of the master.<\/p>\n<\/blockquote>\n<div id=\"wpmem_restricted_msg\"><p>This content is restricted to site members.  If you are an existing user, please log in.  New users may register below.<\/p><\/div><div id=\"wpmem_login\"><a id=\"login\"><\/a><form action=\"https:\/\/doc.probance.com\/en\/knowledge-base\/generating-unique-promo-codes-in-prestashop\/\" method=\"POST\" id=\"wpmem_login_form\" class=\"form\"><input type=\"hidden\" id=\"_wpmem_login_nonce\" name=\"_wpmem_login_nonce\" value=\"f834b2436e\" \/><input type=\"hidden\" name=\"_wp_http_referer\" value=\"\/en\/wp-json\/wp\/v2\/tutoriels\/29675\" \/><fieldset><legend>Existing Users Log In<\/legend><label for=\"log\">Username or Email<\/label><div class=\"div_text\"><input name=\"log\" type=\"text\" id=\"log\" value=\"\" class=\"username\" required  \/><\/div><label for=\"pwd\">Password<\/label><div class=\"div_text\"><input name=\"pwd\" type=\"password\" id=\"pwd\" class=\"password\" required  \/><\/div><input name=\"a\" type=\"hidden\" value=\"login\" \/><input name=\"redirect_to\" type=\"hidden\" value=\"https:\/\/doc.probance.com\/en\/knowledge-base\/generating-unique-promo-codes-in-prestashop\/\" \/><div class=\"button_div\"><input name=\"rememberme\" type=\"checkbox\" id=\"rememberme\" value=\"forever\" \/>&nbsp;<label for=\"rememberme\">Remember Me<\/label>&nbsp;&nbsp;<input type=\"submit\" name=\"Submit\" value=\"Log In\" class=\"buttons\" \/><\/div><\/fieldset><\/form><\/div><div id=\"wpmem_reg\"><a id=\"register\"><\/a><form name=\"form\" method=\"post\" action=\"https:\/\/doc.probance.com\/en\/knowledge-base\/generating-unique-promo-codes-in-prestashop\/\" id=\"wpmem_register_form\" class=\"form\"><input type=\"hidden\" id=\"_wpmem_register_nonce\" name=\"_wpmem_register_nonce\" value=\"6cc3867c56\" \/><input type=\"hidden\" name=\"_wp_http_referer\" value=\"\/en\/wp-json\/wp\/v2\/tutoriels\/29675\" \/><fieldset><legend>New User Registration<\/legend><label for=\"username\" class=\"text\">Choose a Username<span class=\"req\">*<\/span><\/label><div class=\"div_text\"><input name=\"username\" type=\"text\" id=\"username\" value=\"\" class=\"textbox\" required  \/><\/div><label for=\"first_name\" class=\"text\">First Name<span class=\"req\">*<\/span><\/label><div class=\"div_text\"><input name=\"first_name\" type=\"text\" id=\"first_name\" value=\"\" class=\"textbox\" required  \/><\/div><label for=\"last_name\" class=\"text\">Last Name<span class=\"req\">*<\/span><\/label><div class=\"div_text\"><input name=\"last_name\" type=\"text\" id=\"last_name\" value=\"\" class=\"textbox\" required  \/><\/div><label for=\"user_email\" class=\"text\">Email<span class=\"req\">*<\/span><\/label><div class=\"div_text\"><input name=\"user_email\" type=\"email\" id=\"user_email\" value=\"\" class=\"textbox\" required  \/><\/div><input name=\"a\" type=\"hidden\" value=\"register\" \/><input name=\"wpmem_reg_page\" type=\"hidden\" value=\"https:\/\/doc.probance.com\/en\/knowledge-base\/generating-unique-promo-codes-in-prestashop\/\" \/><div class=\"button_div\"><input name=\"submit\" type=\"submit\" value=\"Register\" class=\"buttons\" \/><\/div><div class=\"req-text\"><span class=\"req\">*<\/span>Required field<\/div><\/fieldset><\/form><\/div>","protected":false},"excerpt":{"rendered":"<p>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 [&hellip;]<\/p>\n","protected":false},"author":6,"featured_media":0,"template":"","sujets":[653],"class_list":["post-29675","tutoriels","type-tutoriels","status-publish","hentry","sujets-coupons"],"_links":{"self":[{"href":"https:\/\/doc.probance.com\/en\/wp-json\/wp\/v2\/tutoriels\/29675","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/doc.probance.com\/en\/wp-json\/wp\/v2\/tutoriels"}],"about":[{"href":"https:\/\/doc.probance.com\/en\/wp-json\/wp\/v2\/types\/tutoriels"}],"author":[{"embeddable":true,"href":"https:\/\/doc.probance.com\/en\/wp-json\/wp\/v2\/users\/6"}],"wp:attachment":[{"href":"https:\/\/doc.probance.com\/en\/wp-json\/wp\/v2\/media?parent=29675"}],"wp:term":[{"taxonomy":"sujets","embeddable":true,"href":"https:\/\/doc.probance.com\/en\/wp-json\/wp\/v2\/sujets?post=29675"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}