R Rafina Panel guide
Guides / Sales and customers

Discount Codes

In this section you create discount codes that the customer enters in the cart or on the checkout page. Each code can have its own usage limit, expiry date, product scope, and payment gateway.

Where is it? Rafina Panel → Discount Codes

Top of the discount code creation form with the code, discount type, amount, and expiry date fields
Top of the “New discount code” form: code name, discount type and amount, and expiry date
NoteThe codes in this section are WooCommerce coupons. The WooCommerce plugin must be active for this section to work; otherwise the message “WooCommerce must be active to use discount codes.” is shown.

Creating a discount code

  1. In the “Discount code” field, write the exact text the customer must enter, for example NOWRUZ1405. Case doesn’t matter.
  2. Choose the “Discount type” and “Discount amount”.
  3. If the code should have an end date, click the “Expiry date (optional)” field and choose the last day from the Jalali calendar.
  4. Under “Usage limits”, set the total limit and the per-user limit.
  5. If needed, limit the code to certain categories or a specific payment gateway.
  6. Click the “Create discount code” button. The code immediately appears in the “Registered codes” list at the bottom of the page.

Part one: code, type, and amount

OptionWhat it does
Discount CodesThe text the customer types in the cart. Upper and lower case are treated the same.
Discount typeIt has three modes: “Percentage of the whole cart”, “Fixed amount off the whole cart”, and “Fixed amount off each item”.
Discount amountIn percentage mode the number is between 1 and 100. In the two amount modes, the amount is written in Toman (or the store’s currency unit). The help text under the field changes by itself when the type changes.
Expiry date (optional)Clicking the field opens the Jalali calendar and you choose the end day; the “Today” button sets that day and “Clear” removes the date. Empty means the code has no end date. The code expires at the end of that day.
The Jalali calendar open under the expiry date field with Today and Clear buttons
Choosing the expiry date from the Jalali calendar

Part two: usage limits

Usage limit fields including total limit, per-user limit, minimum and maximum cart amount, and emails
Limits of each code
OptionWhat it does
Total usage limitHow many times this code can be used across the whole store. Empty or zero means unlimited.
Usage limit per userHow many times each user can use this code. Usually set to 1. Empty means unlimited.
Maximum number of eligible itemsMeaningful only for “Fixed amount off each item” and “Percentage”; it sets how many units of the item the discount applies to. Empty means unlimited.
Minimum cart amount (Toman)The code is accepted only when the cart total is at least this amount. In the codes list it appears with the “Cart minimum” label.
Maximum cart amount (Toman)The code is not accepted for carts above this amount. Empty means no limit.
Only for these emails (optional)One email per line. If filled, only a customer with one of these emails can use the code. Empty means everyone.

Part three: product scope

Category list with search and payment gateway options
Limiting the code to categories and gateways
OptionWhat it does
Only for these categoriesA list of all store categories with a “Search categories…” field. If no category is chosen, the code works on all items and “All items” is written above the list; when categories are chosen, it is replaced by the count of chosen categories and a “Clear all” button.
Payment gateway“All gateways”, “Only selected gateways”, or “All except selected gateways”. With the last two, the list of the store’s active gateways opens for ticking. If no gateway is active, it says to first turn one on in the “Payment gateway” section.
NoteThe gateway limit is checked only when the order is placed. On the checkout page, a note appears beside gateways that are not compatible with the code, and if the buyer orders with an incompatible gateway they get the message “Code … cannot be used with gateway …” and the code is removed from the order.

Marketplace options (only with the Dokan plugin)

If the Dokan plugin is active on the site, two more options appear in the form:

OptionWhat it does
Code for all vendorsWhen on, the code also applies to all vendors’ items; when off, only to the store’s own items.
Except these vendorsThis code is not accepted on the items of a ticked vendor.

Part four: switches and internal note

Switches for active code, free shipping, not combining with other codes and sales, and the internal note field
Final form switches and the “Create discount code” button
OptionWhat it doesDefault
Code is activeAn inactive code is created and kept but not accepted in the cart. Useful for preparing a code before a campaign starts.On
Gives free shippingThis code also gives the buyer free shipping.Off
Do not combine with other codesWhen on, the customer can’t use this code alongside another discount code.Off
Don’t apply to sale itemsItems that already have a discount don’t get this discount code.Off
Internal note (optional)A note for yourself, like “Nowruz campaign, Instagram only”. It is seen only on this page and is not shown to the customer.Empty

Registered codes list

The registered codes box with counter and search
The “Registered codes” box; the newest codes appear first

This box shows all the store’s codes with the columns “Code”, “Discount”, “Usage” (times used out of limit), “Per user”, “Expiry”, and “Status”. The status is one of “Active”, “Inactive”, “Expired”, or “Limit reached”, and the cart minimum is written under each code. Find a code with the “Search code…” field, and the list pages with “Previous” and “Next”.

  • Edit: The form at the top of the page is filled with that code’s values and its title becomes “Edit discount code”. After changing, click “Save changes” or “Cancel”.
  • Delete: After you confirm “Delete this discount code?”, the code is removed.

FAQ and troubleshooting

A customer says the code doesn’t work; what should I check?

Check the status in the codes list: “Expired” means the date has passed, “Limit reached” means the total usage limit is used up. If the code is “Active”, check the cart minimum, category scope, email list, and gateway limit. An inactive code is also not accepted in the cart.

Does a discount code created by “Abandoned carts” or “Customer club” appear here?

Yes. Those codes are WooCommerce coupons too and each is limited to that customer’s email; you don’t need to do anything to create them manually.

Should I give a code to an affiliate marketer?

First create the code here, then in “Affiliate program ← Marketers” use the “Rate and discount code” button to enter the code name for that marketer. Affiliate program guide