Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


...

width50%

Table of Contents

Warning

Firefox user notice:

Please use another web browser to view this document.

Sorry for the inconvenience.

...

width30%

                                                                                                                                                                                                   

Image Modified

Magento 2 Coupon Code Generator allows generating individual coupon codes depending on custom rules. Rules determine the priority, coupon usage, format, coupon conditions, actions, and other parameters and can be attributed to specific websites and customer groups. Moreover, coupons can be designed for individual emails and automatically sent to the recipients selected in a customer database. All generated coupons are tracked from a separate table. 

Compatibility: Magento Open Source 2.3.X - 2.4.X, Magento Commerce 2.3.X - 2.4.X

Product Page

Thank you for choosing Aheadworks!

Installing Coupon Code Generator

...

Panel
borderWidth2px
borderStylesolid

1. Backup your web directory and store database

Panel
borderWidth2px
borderStylesolid

2. Download the Coupon Code Generator installation package

Panel
borderWidth2px
borderStylesolid

 3. Upload contents of the Coupon Code Generator installation package to your store root directory

...

borderWidth2px
borderStylesolid

 4. In SSH console of your server navigate to your store root folder:

No Format
cd path_to_the_store_root_folder

run the following command: :

No Format
php -f bin/magento module:enable Aheadworks_Coupongenerator

then:

No Format
php -f bin/magento setup:upgrade

after:

No Format
php -f bin/magento setup:static-content:deploy
Panel
borderWidth2px
borderStylesolid

5. Flush store cache; log out from the backend and log in again

Note

Make sure the installation is done from under the FTP administrator account. Otherwise, set 775 permissions to the store root directory after the extension is deployed.

...

width50%

...

borderWidth2px
borderStylesolid

If you are installing an extension from Aheadworks for the first time, you need to add our composer repository to your Magento store:

Panel
borderWidth2px
borderStylesolid

1. Login to your ssh console and navigate to your store folder:

Panel
borderWidth2px
borderStylesolid
cd path_to_the_store_root_folder

Run the following command:

Panel
borderWidth2px
borderStylesolid

composer config repositories.aheadworks composer https://dist.aheadworks.com/

On successful execution of the command you will be able to use the composer to install the extensions.

...

borderWidth2px
borderStylesolid

To install the extension:

2. Login to your ssh console and navigate to your store folder:

Panel
borderWidth2px
borderStylesolid
cd path_to_the_store_root_folder

...

borderWidth2px
borderStylesolid

 3. Run the following command to install the latest version of the extension:

Panel
borderWidth2px
borderStylesolid
composer require aheadworks/module-coupongenerator

if you need to install a specific version, run this command:

Panel
borderWidth2px
borderStylesolid
composer require aheadworks/module-coupongenerator:<version>
Tip

Specify the version of the extension in <version>

Panel
borderWidth2px
borderStylesolid

When prompted, enter Public Key (Username) and Private Key (Password):
Image Removed

Note

Both Public Key (Username) and Private Key (Password) can be found in My Projects and Licenses in your personal account on our site:

Image Removed

...

borderWidth2px
borderStylesolid

4. Enable the extension:

Panel
borderWidth2px
borderStylesolid
php -f bin/magento module:enable <Module_Name>
Tip

Add the product name in <Module_Name>

Next, register the extension:

Panel
borderWidth2px
borderStylesolid
bin/magento setup:upgrade

Recompile your Magento store if you are in the Production mode:

Panel
borderWidth2px
borderStylesolid
bin/magento setup:di:compile

To verify that the extension is enabled, run this command:

Panel
borderWidth2px
borderStylesolid
bin/magento module:status

Clean store cache, by running the following command:

Panel
borderWidth2px
borderStylesolid
bin/magento cache:clean

Log out and Log in the backend again.

...

borderWidth2px
borderStylesolid

To upgrade the extension:

5. To update or upgrade an extension:

Download the updated extension file. Take note of the module-name and version. Export the contents to your Magento root.

If a composer package exists for the extension, run one of the following.

Code Block
titleUpdate per module name:
composer update aheadworks/module-coupongenerator
Code Block
titleUpdater per version:
composer require aheadworks/module-coupongenerator:<version>

Run the following commands to upgrade, deploy, and clean the cache.

Panel
borderWidth2px
borderStylesolid
php bin/magento setup:upgrade --keep-generated
php bin/magento setup:static-content:deploy
php bin/magento cache:clean

Introducing Coupon Code Generator

Section

Coupon Code Generator extension introduces simple and convenient way of issuing coupon codes:

  • Email delivery options;
  • Individual expiration dates;
  • Coupon use statistics.

The extension enhances the process behind managing and creating coupon codes. With the help of pre-defined email templates, variables and rules, the coupon codes can be generated and sent to a particular customer or customer group in few clicks.

Coupon codes usage allows for the sales campaign tracking and issued coupon codes management.

Getting Around

Section

Coupon Code Generator comes set up and ready for work with store default values, no additional manupulations needed.

The extension introduces its pages to the Marketing section the Magento 2 navigation menu. From here store administrator has an access to the following pages:

  • Generate Coupons - the main section where store administrator creates and send the coupon codes to the customers;
  • Manage Coupon Codes - the section where the coupon code related information can be found, also used for reporting purposes;
  • Manage Rules - the section where coupon code rules are created and managed.

These sections are the parts of the Coupon Code Generator "control center". When the extension is configured per administrator's requirements all the management takes place here.

In addition to Marketing section the extension introduces its general configuration options to Stores > Configuration > Aheadworks extensions > Coupon Code Generator. This section controls basic extension aspects such as: Email Sender and Email Template.

Creating rules

...

When the extension is installed the first thing administrator wants to do is to create the coupon code rules. The rules will further be used to quickly generate and send the coupon codes.

The coupon code rules can be created from Marketing > Coupon Code Generator by Aheadworks > Manage Rules

Image Removed

...

  • Click Image Removed button to look through available columns and customize the grid, remove/add columns to match your workflow;
  • Click Image Removed button to look for the rules matching a custom set of attributes;
  • Click Image Removed button to save a number of custom grid views to switch between, depending on the current task.

These active elements of the grid are shared with the Manage Coupon Codes and Generate Coupon(s) for Customers sections that will be covered later in this readme.

To create a rule click Image Removed button.

Rule Information

First two blocks of the section, General Configuration and Coupon Usage, should be familiar, as these come with the native Magento.

The third settings block though is new and allows adjusting Code Format. Here store administrator suggested specifying: coupon length, code format, code prefix and suffix, and if the parts of the code shpuld be separated by the dash.

Conditions

This section is similar to the native Magento one. Here store administrator suggested specifying the conditions on which the coupon code can be applied to the shopping cart.

Actions

Is another inherited section. Here store administrator decides on the discount type and amount, quantity and quantity step, and how the discount should handle the shipping.

In addition, an administrator can add another set of conditions controlling what items the discount should be applied to.

Once done setting up the rule store administrator clicks 'Save' button.

Now, when the rule is created one can proceed to the Generate Coupons section to issue and send coupons.

Generating coupon codes

...

To generate coupon code with the rule created administrator navigates to Marketing > Coupon Code Generator by Aheadworks > Generate Coupons section.

This section is split into two blocks. The first one Generate Coupon for Email allows generating a single coupon code for a particular email address. The second one Generate Coupon(s) for Customers allows generating coupon codes for selected number of customers.

Generate Coupon for Email

Image Removed

In this block store administrator is suggested specifying the coupon recipient's email, coupon code rule created previously, and decides if the notification email should be send to the customer.

Once every option covered administrator clicks Image Removed button to issue and send the coupons.

Info

The coupon codes are tied to the email address and cannot be generated without specifying one.

Generate Coupon(s) for Customers

Image Removed

In this block store administor is suggested specifying the customer(s) to generate the coupons for. The block comes with the filtering and column management options as the Manage Rules section.

Once the required list of customers is found and ticked, store administrator expands the Image Removed box and decides on the coupon rule and further actions.

The coupon codes have been generated and can now be tracked under Marketing > Coupon Code Generator by Aheadworks > Manage Coupon Codes

Generating coupons from customer account

In addition to the dedicated Marketing section, the extension introduces Coupons block to the customer account area of the store backend.

Image Removed

Here store administrator can quickly issue and send a coupon code while managing the customer. If Send Email with Coupon checkbox ticked upon next customer account save the notification email will be sent.

Managing Coupon Codes

...

Image Removed

...

In addition, every coupon code issue has the number of uses displayed. As per figure above, we can see that John Doe used the coupon code 4 times, and Jane 3 times. This information may come in handy when estimating the success of the sale campaign.

Extension settings

Section

The extension settings can be found under Stores > Configuration > Aheadworks extensions > Coupon Code Generator

Image Removed

Here store administrato has an access to the following settings:

Email Sender - defines the email from which the coupon code notifications will be send;

Email Template - defines the email template which will be send to customer (templates can be found and edited at the FTP of the store under view/frontend/email).

Newsletter and general notification email variables

...

Coupon Code Generator extension allows sending coupon codes with newsletter and general emails automatically. For such purpose the extension comes with a set of variables for email templates. Once an email is sent variables are transformed into corresponding coupon code values.

There is a total of five variables.

...

{{var subscriber.generateCoupon(ruleId, alias)}}

...

{{var subscriber.getCouponCode(alias)}}

...

{{var subscriber.getCouponExpirationDate(alias)}}

...

{{var subscriber.getCouponDiscount(alias)}}

...

{{var subscriber.getUsesPerCoupon(alias)}}

...

  • ruleId - instead of the ruleId, the store owner defines an ID of the Coupon Code Generator rule that will be used to create a coupon code;
  • alias - instead of the alias, the store owner defines the preferred name of the coupon code.

For example:

Variable {{var subscriber.generateCoupon(1, 50%SHIRT)}} will generate a coupon code 50%SHIRT with the Coupon Code Generator rule ID 1 values.

...

Expand
titleWhere can I find rule ID?

Image Removed

Note

When using Coupon Code Generator variables, one should consider the following:

1) Service variable that generates the coupon code should be placed in the template BEFORE any other extension variable. This variable is used to start the coupon rule.

2) Customer groups are considered in both coupon code rule conditions and follow up email/newsletter conditions.

For example:

If coupon code rule is intended for customer group A.

And follow up email/newsletter is intended for customer group B.

The coupon code will not be generated. The email delivered will come with blanks on the variable positions.

Multiple coupon codes in a single email

To send multiple coupon codes with a single email the store owner adds as many variables as many coupon codes they want to send.

For example:

Hello!

We want to you know that currently you can get all WATCHES and BAGS from our store with 20% discount.

{{var subscriber.generateCoupon(1, WATCH20)}}

{{var subscriber.generateCoupon(2, BAG20)}}

For watches use coupon code: {{var subscriber.getCouponCode(WATCH20)}}; to get {{var subscriber.getCouponDiscount(WATCH20)}} discount.

For bags use coupon code: {{var subscriber.getCouponCode(BAG20)}}; to get {{var subscriber.getCouponDiscount(BAG20)}} discount.

Enjoy your shopping!

As you can see, variables:

{{var subscriber.generateCoupon(1, WATCH20)}}

{{var subscriber.generateCoupon(2, BAG20)}}

Are used to generate the coupon codes, while variables used later in the template are used to display generated coupon code name (getCouponCode) and discount amount (getCouponDiscount).

Coupon Code Generator Integration

...

Coupon Code Generator is integrated with Follow Up Email extension.

Follow Up Email variables

...

{{var coupongenerator.generateCoupon(ruleId, alias)}}

...

{{var coupongenerator.getCouponCode(alias)}}

...

{{var coupongenerator.getCouponExpirationDate(alias)}}

...

{{var coupongenerator.getCouponDiscount(alias)}}

...

  {{var coupongenerator.getUsesPerCoupon(alias)}}

...

The coupon codes are generate the same way as with the native Magento newsletter as has been described above.

Integration with Help Desk Ultimate

Coupon Code Generator extension, when installed along with Help Desk Ultimate by Aheadworks, allows help desk agents generate and send coupon codes directly from the ticket thread.

The extension adds its section to the ticket thread administrator menu. From here help desk agent can select the Coupon Code Generator rule created and reply to the ticket.

The coupon code will be generated automatically according to the rule conditions set and added below the ticket reply, indicating the discount customer gets.

Image Removed

Uninstalling Coupon Code Generator

...

width50%

Manual Removal

...

1. Disable the module by executing the following commands:

No Format
php bin/magento module:disable Aheadworks_Coupongenerator
php bin/magento setup:upgrade

...

2. Remove the extension files from the following folder:

No Format
app/code/Aheadworks/Coupongenerator

...

width50%

Automatic Removal (via Composer)

...

1. Disable the module by executing the following commands:

No Format
php bin/magento module:uninstall Aheadworks_Coupongenerator

...

Warning

For more information follow the product user manual on our website


Product Page

Thank you for choosing Aheadworks!

Need Customization?

You can always find the latest version of the software, full documentation, demos, screenshots, and reviews on http://aheadworks.com
License agreement: https://aheadworks.com/end-user-license-agreement
Contact Us: https://aheadworks.com/contact
Copyright © 2021 Aheadworks Co. http://www.aheadworks.com