Want to find out more about coupons and vouchers in ecommerce? Discover all you need to know about creating coupon codes in PrestaShop 1.7 in our updated blog article.
A discount coupon is a great tool for drawing customer attention to some particular products and promoting your sales. In PrestaShop 1.7, vouchers and discount coupons can be created directly in the admin panel. However, it is also possible to set them up programmatically. Let’s discuss why you to offer discounts and how you can create discount codes in PrestaShop.
Why do You Need Ecommerce Сoupons and Vouchers?
Today’s ecommerce is emerging but one simple truth remains the same – getting customers is first of all about offering a better price. Most of the customers no longer see discounts and good deals as a nice gesture from the store owner or second reason to purchase a product – they take discounts for granted. However, it does not mean that you should offer coupons constantly but they should become a part of your smart pricing strategy and be available only during certain periods of time.
During the events like Black Friday or Cyber Monday it is especially significant to provide the customers with decent deals. If you don’t offer them something special, your store can be forgotten and huge profits will pass you by. Besides the obvious monetary advantage that your customers get from a coupon, there are several significant benefits that you can gain as a business owner. Here we are going to look through the top 5 most prominent advantages of using coupon codes.
#1 Discourage cart abandonment. One of the most popular reasons for cart abandonment is that the total order amount turns out to be higher than expected. After taxes, shipping and product prices are combined, the sum that appears on the screen can be frustrating. It can make potential customers leave before completing the purchase. The available discount is a way to butter them up and show that ordering your product is not going to hit their wallets as hard as they initially thought. Use coupons smart and forget about abandoned carts.
#2 Earn client’s email. Another benefit of offering coupons is that it allows you to get access to valuable data – client’s email. It gives you an opportunity to add this email to your customer database and then use for an email marketing campaign. Unless the user has specified that they do not want to subscribe and receive news and information about your company, you can regularly inform them about sales and specials.
#3 Track the activity. The use of coupons is easy to monitor. Without any additional investments or difficulties, you can analyse how the coupons attract customers and what kinds of discounts work best with your target audience. If you send one group of people a gift product coupon and another group a discount voucher, the results will show what brings more traffic to your website.
#4 Increase conversions. A good discount is a proper incentive for unplanned purchase. Comparing your products with the ones offered by your competitors, the customers are more likely to choose the website with a better price or conditions like free shipping or extra gift product. Given that most of the ecommerce websites always have some sales or specials, the right choice of coupons is coming to the forefront. Research the deals of your competitors and boost conversions.
#5 Make customers feel positive about your company. Coupons show your customers that you are not just trying to make some money here but you care about them and their shopping experience. It creates a positive company image and the customers may start associating your brand with fair prices and offers. Discount coupons work for your business reputation. On top of that, after a customer buys a product at a good discount from you, next time when they want to make a purchase, there is a high chance that they will check out your deals first.
How to Set a Coupon Code in PrestaShop Admin Panel
Now, as it is clear that coupons and vouchers are musts for your ecommerce, let’s find out how to create coupons in PrestaShop. There are two different ways to do it and in this article, we are going to describe both of them. First, you can open the admin panel and set up a coupon there. Second, you can manage it programmatically. Following the recommendations below, you won’t face any difficulties along the way.
To add a promo code to your PrestaShop webstore via the admin panel, open the admin panel and go to Sell → Catalog → Discounts. On the Cart Rules page click the Add new cart rule button in the top right corner.
Okay, let’s take a closer look at the process of adding a discount to PrestaShop. In the Name field, we specify the name of the coupon (it will be displayed on the cart page when placing the order), for example, Black Friday. After that, add a short description of the coupon and generate the code by pressing the Generate button.
On the Conditions tab, you can specify the conditions for a coupon, mainly its duration, currency and the customer groups (customers, guests or visitors) that the coupon will be visible to.
The most important settings are located on the Actions tab. These are the basic settings for a discount on interest or amount. When we select Percent (%), we indicate the percentage that will be discounted from the cart amount, if we select Amount, then we indicate a certain sum of money that will be discounted from the cart amount. Free shipping and Send a free gift settings are also located on this tab.
Click on Save and make sure the new cart rule has appeared on the list of the existing cart rules.
When buyers add a product to cart and proceed to checkout, they will enter the coupon code received, for example, by email, in the appropriate field.
Finally, they get their long-awaited discount.
How to Create a Gift Product in PrestaShop Admin Panel
Finally, let’s take a look at another way to make a customer happy – with the help of a gift product. Most of the customers remember when they receive such a compliment from the online store and when they keep it home, it will remind them of your company. Here we describe how to create an automatic coupon for a gift product in PrestaShop.
To get started, you should first create a regular coupon as described above but without generating or entering a coupon code.
Next, we enable the Send a free gift slider. Of course, you can additionally enable free shipping, a coupon for a specific customer, etc.
Type the name of the gift product in the search bar and select it from the suggested variations.
When ready, save the changes.
Now when a customer selects any product and proceeds to payment, then the product that we have selected above will automatically appear in the shopping cart.
How to Create Coupon Code in Prestashop Programmatically
In addition to this, let’s discover how you can create a coupon code in PrestaShop programmatically. All you need is to follow our guide and you will realize that it is all quite simple.
In order to create a new cart rule, you need to run the following command:
$cart_rule = new CartRule();
$cart_rule = new CartRule();
Then, you should complete the rule’s name (required) and description (optional):
$language_ids = LanguageCore::getIDs(false);
foreach ($language_ids as $language_id) {
$cart_rule->name[$language_id] = $this->trans(‘Cart rule name’);
$cart_rule->description = $this->trans(‘Cart rule description’);
}
$language_ids = LanguageCore::getIDs(false);
foreach ($language_ids as $language_id) {
$cart_rule->name[$language_id] = $this->trans(‘Cart rule name’);
$cart_rule->description = $this->trans(‘Cart rule description’);
}
How to make the coupon valid for a certain period of time (for example, for a year, beginning today):
$now = time();
$cart_rule->date_from = date(‘Y-m-d H:i:s’, $now);
$cart_rule->date_to = date(‘Y-m-d H:i:s’, strtotime(‘+1 year’));
The highlight function will inform the user that there is a voucher that can be added to one of the items in the shopping cart. If you want to enable the highlight, run the following command:
$cart_rule->highlight = true;
$cart_rule->highlight = true;
By default, the cart rule is Active and Partial use function is enabled. It means that another voucher will be generated if the current one is fully used. If the Partial use function is disabled, the rule or voucher can be used one time and even if it is not fully used, unspent balance does not convert into another coupon. If you want to disable the cart rule and Partial use function, run the following commands:
$cart_rule->partial_use = false;
$cart_rule->active = false;
$cart_rule->partial_use = false;
$cart_rule->active = false;
When several different coupons can be added to the cart, you need to have their priority set (by default the priority of all of them is 1). For example, running this command we change the priority to 10:
$cart_rule->priority = 10;
$cart_rule->priority = 10;
If you want to set the code for the cart rule, run the following command:
$cart_rule->code = ‘MYCOUPON’;
$cart_rule->code = ‘MYCOUPON’;
The cart rule use can be limited for one particular customer. For example, you want to use a coupon to make up to one of your customers for the inconvenience, then you can send them coupon with limited access to one user only. To set it up, run this command:
$cart_rule->id_customer = $id_customer;
$cart_rule->id_customer = $id_customer;
If you want to set a total quantity of available vouchers, run the following command (by default, there will be 1 voucher available):
$cart_rule->quantity = 100;
$cart_rule->quantity = 100;
To set the total available quantity of vouchers for a single user, run this command (by default, one user can redeem only one coupon):
$cart_rule->quantity_per_user = 10;
$cart_rule->quantity_per_user = 10;
If you want to create a cart rule for a free gift product, you need to specify product id and attribute id (if available):
$cart_rule->gift_product = $id_product;
$cart_rule->gift_product_attribute = $id_product_attribute;
$cart_rule->gift_product = $id_product;
$cart_rule->gift_product_attribute = $id_product_attribute;
When you want to apply a fixed monetary discount, use this command:
$cart_rule->reduction_amount = 10;
$cart_rule->minimum_amount_currency = ContextCore::getContext()->currency>id;
$cart_rule->reduction_currency = ContextCore::getContext()->currency>id;
$cart_rule->reduction_amount = 10;
$cart_rule->minimum_amount_currency = ContextCore::getContext()->currency>id;
$cart_rule->reduction_currency = ContextCore::getContext()->currency>id;
To apply a percentage (%) off to the total order amount, you can use the following command:
$cart_rule->reduction_percent = 50;
$cart_rule->reduction_percent = 50;
If you want to create a cart rule for free shipping, enable it with this command:
$cart_rule->free_shipping = true;
$cart_rule->free_shipping = true;
When you want to disallow using coupons with products which are already at a discount, run the following command:
$cart_rule->reduction_exclude_special = true;
$cart_rule->reduction_exclude_special = true;
You may also need to configure the voucher that it is available only after the order exceeds a certain amount. To set up minimum amount from which the coupon can be redeemed, you need to use these commands:
$cart_rule->minimum_amount = 10; // amount value
$cart_rule->minimum_amount_currency = ContextCore::getContext()->currency>id; // amount currency;
$cart_rule->minimum_amount_tax = true; // to specify if the amount value includes taxes or not
$cart_rule->minimum_amount_shipping = false;// to specify if the amount value includes shipping price
$cart_rule->minimum_amount = 10; // amount value
$cart_rule->minimum_amount_currency = ContextCore::getContext()->currency>id; // amount currency;
$cart_rule->minimum_amount_tax = true; // to specify if the amount value includes taxes or not
$cart_rule->minimum_amount_shipping = false;// to specify if the amount value includes shipping price
Finally, to save the cart rule, use this command:
$cart_rule->add();
$cart_rule->add();