The "Coupon Conditions" plugin extends HikaShop's coupon system with formula-based conditions and value formulas. You can control when a coupon can be used based on cart data, user data, addresses, or product fields, and optionally override the discount amount with a dynamic calculation.
Features
- Define condition formulas to restrict coupon usage based on cart, user, product, or address data.
- Define value formulas to dynamically calculate the coupon discount amount, overriding the coupon's configured percentage or flat value.
- Multiple condition rows: each row can target specific coupons, and have its own condition, value formula, error message, and logic operator.
- Conditions and value formulas can be used independently or together in the same row.
- Works alongside all existing coupon restrictions (product, category, date, quota, etc.).
- Compatible with the auto-loaded coupons and multi-coupon plugins.
- Tax-aware price tags with
:tax and :notax modifiers.
- Math functions:
min(), max(), abs(), round(), ceil(), floor().
Installation
Easy and quick !
- Download the plugin on our website
- Install it on your Joomla website (extension manager)
- Enable the "HikaShop Coupon Conditions" plugin via the Joomla plugins manager
- Edit the plugin and configure your conditions and value formulas.
Usage
- This HikaShop Coupon Conditions plugin is compatible with all the editions of HikaShop
- HikaShop 6.1.1 or newer required
- Compatible with PHP 5 minimum
- GPL v3
- No limit of time
- No limit of use
Conditions
Condition formulas are evaluated when a coupon is applied. If the condition returns false, the coupon is rejected with a customizable error message. This works alongside the existing coupon restrictions in HikaShop (product, category, date, quota, etc.).
Example conditions:
{cart.price} > 100 : cart total must exceed 100
{shipping_address.address_post_code} == '75001' : restrict to a specific postal code
{cart.cart_product_quantity} >= 3 : require at least 3 items in the cart
{user.user_email} == This email address is being protected from spambots. You need JavaScript enabled to view it.' : restrict to a specific user
{product.product_quantity} > 5 : product-level condition (all products must match with AND, or at least one with OR)
Value formulas
Value formulas let you dynamically calculate the coupon discount amount based on cart and product data. When a value formula is set, it overrides the coupon's configured discount value (percentage or flat amount) with a calculated flat amount. You can use a value formula without a condition, or combine both.
Example value formulas:
min({cart.cart_product_quantity}, 4) * {product.unit_price} : 100% coupon limited to 4 items (e.g. 6 tickets ordered, 4 free + 2 paid)
max({cart.price} - 50, 0) : discount everything above 50
{cart.cart_product_quantity} * 5 : flat discount per item in the cart
{product.unit_price} * 0.5 : 50% off calculated as a flat amount per product
When the formula references product-level tags (e.g. {product.unit_price}), it is evaluated once per product in the cart and the results are summed.
Available tags
{cart.price} : total cart price (without tax by default)
{cart.cart_product_quantity} : total quantity of all products in the cart
{product.unit_price} : unit price of a product (without tax by default)
{product.price} : line price of a product (unit price x quantity)
{product.cart_product_quantity} : quantity of a product in the cart
{product.*} : any product field, including custom fields (e.g. {product.product_weight})
{order.*} : any order/cart custom field
{cart.*} : any cart object field
{user.*} : any user field (e.g. {user.user_email})
{billing_address.*} / {shipping_address.*} : any address field (e.g. {shipping_address.address_post_code})
Tag modifiers
{product.unit_price} : price without tax (default for price tags)
{product.unit_price:tax} : price with tax included
{cart.price:notax} : explicitly without tax
Available functions
min(), max(), abs(), round(), ceil(), floor(), strlen(), mb_strlen(), substr(), trim(), str_word_count(), and standard arithmetic operators (+, -, *, /). Parentheses and comparison operators (>, <, >=, <=, ==, !=) are also supported.
Changelog
1.1.1 on the 6th of April 2026
- Fixed the {cart.cart_product_quantity} tag not being computed from cart products when not directly available on the cart object, causing value formulas using it to be silently skipped.
1.1.0 on the 2nd of April 2026
- Added value formula support to dynamically calculate the coupon discount amount based on cart and product data.
- Added
:tax and :notax modifiers on price tags to control tax handling in formulas.
- Added
min() and max() functions for use in formulas.
- Price tags now default to without-tax values, matching how coupon amounts are typically handled.
1.0.0 on the 14th of December 2025
- Initial release of the plugin with formula-based coupon conditions.