# fluent-cart/1.5.3/app/Modules/Coupon/CouponHandler.php

FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler, version 1.5.3. 39 lines.

- Page: https://pluginprobe.com/plugins/fluent-cart/1.5.3/code/app/Modules/Coupon/CouponHandler.php
- Raw: https://pluginprobe.com/plugins/fluent-cart/1.5.3/raw/app/Modules/Coupon/CouponHandler.php
- Modified: 2025-10-14T16:36:46+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/fluent-cart/1.5.3/code/app/Modules/Coupon/CouponHandler.php#L10-L20`.

```php
<?php

namespace FluentCart\App\Modules\Coupon;

use FluentCart\App\Helpers\CouponHelper;

class CouponHandler
{
    public function register()
    {
        add_filter('fluent_cart/payments/apply_coupon', [$this, 'applyCoupon'], 10, 2);
        add_filter('fluent_cart/payments/store_applied_coupon_data', [$this, 'storeAppliedCouponData'], 10, 3);
        add_shortcode('fluent_cart_show_coupon', [$this, 'show_coupon']);
    }

    public function applyCoupon($appliedCouponList, $orderTotal)
    {
        if (!empty($appliedCouponList)) {
            $couponHelper = new CouponHelper();
            return $couponHelper->calculateCoupon($appliedCouponList, $orderTotal);
        }
        return;
    }

    public function storeAppliedCouponData($appliedCouponList = [], $appliedDiscountsList = [], $orderId = null)
    {
        $couponHelper = new CouponHelper();
        if (!empty($appliedCouponList)) {
            return $couponHelper->storeAppliedCouponData($appliedCouponList, $appliedDiscountsList, $orderId);
        }
        return;
    }

    public function show_coupon()
    {
        
      
    }
}
```
