# Magento 2 Apply Discount coupon Code Via Link

### <span style="color: #3b82f6;">Installation and User Guide for Magento 2 Apply Discount Coupon Code via Link Extension</span>

**Table of Contents**

1. [*Installation* ](#bkmrk-installation)
    - *Installation via app/code*
    - *Installation via Composer*
2. [*Configuration Settings for Auto Coupon* ](#bkmrk-configuration-settin)
    - *General Settings*
3. *[Discount Setup](#bkmrk-discount-setup)*
4. [*Discount Link* ](https://docs.scommerce-mage.com/magento-2-apply-discount-coupon-code-via-link.md#discount-link)
5. [*Front-end site view* ](#bkmrk-front-end-site-view)
    - *Successful Applied Discount Message on the Front-end*
    - *Coupon Code On the Checkout Page*

### <span style="color: #3b82f6;">Installation</span> [](#bkmrk-)

- <span style="color: #f97316;">**Installation via app/code:**</span> Upload the content of the module to your root folder. This will not overwrite the existing Magento folder or files, only the new contents will be added. After the successful upload of the package, run below commands on Magento 2 root directory.
    
     ```php
    php bin/magento setup:upgrade
    php bin/magento setup:di:compile
    php bin/magento setup:static-content:deploy
    ```
- <span style="color: #f97316;">**Installation via Composer:**</span> Please follow the guide provided in the below link to complete the installation via composer.

<p class="callout success">[https://docs.scommerce-mage.com/magento-2-extensions/installation-via-composer/installation-via-composer](https://docs.scommerce-mage.com/magento-2-extensions/installation-via-composer/installation-via-composer)</p>

### <span style="color: #3b82f6;">Configuration Settings for Auto Coupon</span> [](#bkmrk--1)

Go to **Admin &gt; Stores &gt; Configuration &gt; Scommerce Configuration &gt; Auto Coupon**

#### <span style="color: #f97316;">General Settings</span> [](#bkmrk--2)

- **Enabled –** Select "Yes" or "No" to enable or disable the module.
- **License Key –** Please add the license for the extension which is provided in the order confirmation email. Please note license keys are site URL specific. If you require license keys for dev/staging sites then please email us at <support@scommerce-mage.com>.
- **Message After Applying Code –** Message which will displays on the site after successful application of coupon code.

[![image (14).png](https://docs.scommerce-mage.com/uploads/images/gallery/2025-05/scaled-1680-/cLnimage-14.png)](https://docs.scommerce-mage.com/uploads/images/gallery/2025-05/cLnimage-14.png)

### <span style="color: #3b82f6;">**Discount Setup**</span>

You can set up the discount coupon code **from Admin &gt; Marketing &gt; Cart Price Rules &gt;** Click **"Add New Rule",** it redirects on \*\*"\*\*新ew Cart Price Rule" and by providing all the required details you can create the new rule and set up the discount code.

[![image (15).png](https://docs.scommerce-mage.com/uploads/images/gallery/2025-05/scaled-1680-/JfIimage-15.png)](https://docs.scommerce-mage.com/uploads/images/gallery/2025-05/JfIimage-15.png)

### <span style="color: #3b82f6;">**Discount Link**</span>

Once the discount is set up then on the front-end it can be applied using the below link :-

**http://{\[siteurl\]}/applydiscount/?code={\[discount\_code\]}&amp;redirect\_url={\[any\_url\_ of\_your\_site\]}**

1. **Site url –** Site base URL.
2. **Discount Code –** Discount code as set up in discount.
3. **Returning Site URL –** This is optional parameter. If defined, user will be redirected to this URL after successful application of the discount code. If not defined then User will be redirected to the Home page.

[![image (6).jpg](https://docs.scommerce-mage.com/uploads/images/gallery/2025-05/scaled-1680-/d7wimage-6.jpg)](https://docs.scommerce-mage.com/uploads/images/gallery/2025-05/d7wimage-6.jpg)

### <span style="color: #3b82f6;">Front-end Site View</span> [](#bkmrk--6)

- <span style="color: #f97316;">**Successful Applied Discount Message on the Front-end -**</span> The message you have set from **Admin &gt; Stores &gt; Configuration &gt; Scommerce Configuration &gt; Auto Coupon &gt; Message After Applying Code**, will be shown on the front-end homepage.

[![image (7).jpg](https://docs.scommerce-mage.com/uploads/images/gallery/2025-05/scaled-1680-/ErVimage-7.jpg)](https://docs.scommerce-mage.com/uploads/images/gallery/2025-05/ErVimage-7.jpg)

- <span style="color: #f97316;">**Coupon Code On the Checkout Page -**</span> Applied discount coupon code will be shown on the front-end checkout page under "Order Summary" section.

[![image (8).jpg](https://docs.scommerce-mage.com/uploads/images/gallery/2025-05/scaled-1680-/shcimage-8.jpg)](https://docs.scommerce-mage.com/uploads/images/gallery/2025-05/shcimage-8.jpg)

If you have a question related to this extension please check out our [**FAQ Section**](https://www.scommerce-mage.com/magento-2-apply-coupon-via-link.html#customfaq) first. If you can't find the answer you are looking for then please contact [**support@scommerce-mage.com**](mailto:core@scommerce-mage.com)**.**