# storeengine/2.2.0/includes/shortcode/apply-coupon-form.php

StoreEngine — Complete eCommerce Solution with Memberships, Licensing, Affiliates &amp; More, version 2.2.0. 33 lines.

- Page: https://pluginprobe.com/plugins/storeengine/2.2.0/code/includes/shortcode/apply-coupon-form.php
- Raw: https://pluginprobe.com/plugins/storeengine/2.2.0/raw/includes/shortcode/apply-coupon-form.php
- Modified: 2025-12-09T08:04:38+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/storeengine/2.2.0/code/includes/shortcode/apply-coupon-form.php#L10-L20`.

```php
<?php

namespace StoreEngine\Shortcode;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

use StoreEngine\Utils\Formatting;
use StoreEngine\Utils\Template;

class ApplyCouponForm {
	public function __construct() {
		add_shortcode( 'storeengine_apply_coupon_form', array( $this, 'render_apply_coupon_form' ) );
	}

	public function render_apply_coupon_form( array $attrs ) {
		if ( Formatting::string_to_bool( get_query_var( 'order_pay' ) ) ) {
			return '';
		}

		$attributes = shortcode_atts( [
			'placeholder'  => __( 'Coupon Code', 'storeengine' ),
			'button_label' => __( 'Apply', 'storeengine' ),
		], $attrs );

		ob_start();
		Template::get_template( 'shortcode/apply-coupon-form.php', $attributes );

		return ob_get_clean();
	}
}

```
