Working with coupon codes

The Kentico E-commerce Solution allows you to boost your sales using discounts on products, orders or shipping costs. Product coupons and gift cards always require a coupon code to be applied. Optionally, you can also configure free shipping offers, Buy X Get Y discounts and order discounts to be applied only if customers enter an appropriate coupon code.

To manage coupon codes, use the administration interface of the related discount or offer:

  • Product coupons application – edit a coupon on the Coupons tab.
  • Gift cards application – edit a gift card on the Coupons tab.
  • Order discounts application – edit a discount on the Coupons tab.
  • Free shipping offers application – edit an offer on the Coupons tab.
  • Buy X Get Y discounts application – edit a discount on the Coupons tab.

Coupon codes for order discounts, free shipping offers and Buy X Get Y discounts

For free shipping offers, order discounts and Buy X Get Y discounts, the Coupons tab is available only for discounts that have the corresponding check box selected on the General tab.

Enabling coupons for order discount and free shipping offers

If you distribute the coupon codes, i.e. virtual vouchers, among your customers, they can enter the codes during the checkout process to receive discounts or pay for their orders.

Manually adding coupon codes

To manually add coupon codes for discounts or gift cards:

  1. Click Create coupon code.

  2. Enter the coupon code properties:

    Property

    Description

    Coupon code

    A combination of letters, digits and other characters that make up the code of the coupon, for example, OD16-CHRISTMAS (coupon for order discounts), FREE-SHIPPING-CANADA (coupon for free shipping offers), FREE-SHOES (coupon for Buy X Get Y discounts), etc. The code serves as a unique identifier for the coupon.

    You cannot change the value for existing coupon codes.

    If your eligible customers enter the code during the checkout process, they receive the discount.

    Note: Coupon codes are not case sensitive. For example, if you create a “FREE-SHIPPING” coupon code, customers can also enter the code as “free-shipping” or “FREE-shipping”.

    Redemption limit

    Specify how many times your customers can use the coupon code (i.e., enter the code during the checkout process) to receive the discount. The system counts redemptions once for each order, not for each product affected by the related discount.

    Leave the field empty to allow unlimited use of the coupon code.

    Note: The redemption limit is not available for gift card coupon codes, which instead keep track of the Remaining value.

    Remaining value

    Only displayed for gift card coupon codes (you cannot manually edit this property).

    Every gift card coupon code starts with a value equal to the gift card amount. When redeemed, the coupon code is either fully used up, or if the gift card value is greater than the order’s price, the remainder is saved for the given coupon code. While the remaining value is greater than zero, the coupon code can be redeemed again in other orders (with a reduced value).

  3. Click Save.

The system creates a new coupon code. You can now export the coupon codes and distribute them among your customers.

Setting the number of available coupon uses

For most types of discounts and offers, every coupon code allows one or more applications of the discount to an order. You can configure the allowed number of applications (redemptions) for each code.

For gift card coupon codes, the number of uses cannot be configured and the system instead tracks the Remaining value. Every gift card coupon code represents a single voucher with a value equal to the gift card amount, and can be applied until the entire value is used up.

To change the number of available coupon code uses:

  1. Edit () the required coupon code.
  2. Specify how many times customers can use the coupon code (Redemption limit). Clear the value to allow unlimited use of the coupon code.
    Specifying how many times customers can use a coupon
  3. Click Save.

Your customers can now use the coupon code as many times as specified.

Important: When a coupon code is applied to an order, the system always counts 1 redemption for the code, even if the related discount applies multiple times to the items contained in the order. For example, if an order contains 10 units of products that are affected by the discount, the system counts only 1 redemption for the applied coupon code, not 10.

Generating coupon codes

To have the system generate multiple coupons at once:

  1. Click Generate coupon codes.

  2. Specify the properties of the coupon code generator:

    Property

    Description

    Quantity

    Specify how many coupon codes the system generates after you click Generate.

    Coupon code prefix

    The system generates random coupon codes. The coupon code prefix allows you to enter a prefix to be shared by all codes generated in the current batch operation, for example, CHRISTMAS- (coupons for order discounts), CANADA- (coupons for free shipping offers), 20OFF- (coupons for Buy X Get Y discounts), etc. If you leave the field empty, the system generates coupon codes without a shared prefix.

    Redemption limit

    Specify how many times your customers can use the coupon code to receive the discount. The system counts redemptions once for each order, not for each product affected by the related discount.

    Leave the field empty to allow unlimited use of the coupon code.

    Note: The redemption limit is not available for gift card coupon codes, which instead keep track of the remaining value. Every gift card coupon code represents a single voucher with a value equal to the gift card amount, and can be applied until the entire value is used up.

  3. Click Generate.

The system creates the specified number of new coupon codes, optionally with the specified code prefix. You can now export the coupon codes and distribute them among your customers.

Exporting coupon codes

To export the coupon codes of a discount or gift card:

  1. Click  in the Actions column.

    • This opens the Actions drop-down menu.
      Available export actions
  2. Select the export format as required:

    • Export to Excel – exports data shown in the list to an XLSX spreadsheet.

    • Export to CSV – exports data shown in the list to a CSV file.

    • Export to XML – exports data shown in the list to an XML file

    • Advanced export – opens a dialog allowing you to export data to the three formats mentioned above (XLSX, CSV, XML) based on detailed settings.

      After executing an action from the drop-down menu, your browser’s standard file download dialog pops up. The dialog allows you to open or save a file with the exported data just as if you were downloading any other file.

You can now distribute the coupon codes among your customers via any available communication channels.

Configuring pages to allow customers to enter coupon codes

To allow customers to enter coupon codes for discounts or gift cards on the pages of your on-line store:

  1. Open the Pages application.

  2. Select the required page in the content tree.

  3. Switch to the Edit -> Design tab.

  4. Add the Coupon codesweb part to the appropriate web part zone.

  5. Configure the web part properties.

    We strongly recommend leaving the web part’s Show Apply button property enabled. This allows customers to instantly apply coupon codes while viewing the page.

    If Show Apply button is disabled, the web part only applies the entered coupon code when moving to the next step in the checkout process.

  6. Click Save & Close.

The Coupon codes web part uses a transformation to display the coupon codes applied to the customer’s shopping cart. The transformation allows you to format the coupon codes according to any requirements of your website’s design.

When configuring the Coupon codes web part, assign the transformation into the Transformation name property. You can either Select an existing transformation or create a New one.

When writing the code of transformations for coupon code items:

  • Use the Code field to access the coupon code text – {% Code %} in Text / XML transformations, <%# Eval<string>(“Code”) %> in ASCX transformations.
  • If you apply hotfix 11.0.29 or newer, you can use the IsApplied field to evaluate whether the coupon code is valid for the current shopping cart – {% IsApplied %} in Text / XML transformations, <%# Eval<bool>(“IsApplied”) %> in ASCX transformations. This allows you to add formatting options for coupon codes that are no longer valid, for example after products are removed from the cart and the total price falls under the value required by the coupon code’s discount.
  • Call the GetDiscountCouponCodeRemoveButton method to add elements that allow customers to remove applied coupon codes. The method generates an <input> element (of the submit type) that removes the specified coupon code from the shopping cart when clicked. The method has the following parameters:
    • couponCode (required) – the text of the removed coupon code.
    • cssClass (optional) – the name of the CSS class assigned to the generated input element.
    • buttonText (optional) – the text caption of the input element (assigned to the value attribute).
Example - Text / XML transformation



<div>
  <div class="label">
    <span>{% HTMLEncode(Code) %}</span>
  </div>
  <div class="button">
    {% GetDiscountCouponCodeRemoveButton(Code, "btn") %}
  </div>
</div>


Output of the Coupon codes web part with two coupon codes applied

After adding the Coupon codes web part to your website’s checkout pages, you can distribute coupon codes among your customers. Customers can then use these codes to receive discounts or redeem gift cards.

Coupon code restrictions per order

When validating coupon codes, the system only accepts one code per discount for each order. For example, if a customer knows 2 different coupon codes for a 10% order discount, they can apply the codes to 2 different orders, but cannot apply both to a single order to get a 20% discount.

Gift cards are an exception to this rule – a single gift card can be applied multiple times to the same order with different coupon codes.