Skip to content
Farin Theme Guide
GuidesSales and Customers

Discount Codes

This section creates and manages the store’s discount codes: one code for everyone, one code for a specific customer, or hundreds of one-time codes for SMS and gift cards. The codes are WooCommerce’s own discount codes and are accepted in the cart and checkout page.

Where is it? Farin → Discount Codes

WooCommerce is requiredDiscount codes work with WooCommerce. If WooCommerce is not active, you see a message instead of this section.

Codes

The discount codes list with the new code button, search, and status buttons
Above the list: “New code”, search, the “All codes / Created one by one / Created in bulk” selector, and the status buttons.

Each row of the list shows the code, the discount amount, the usage count, the time, and its status. Codes created with “Bulk create” carry the “Created in bulk” label, and you can view only those or only single codes.

StatusMeaning
ActiveThe code is accepted right now.
ScheduledThe “From day” has not arrived yet. The buyer sees the message “This code becomes active from …”.
ExpiredThe “Until end of day” has passed.
Fully usedThe code has been used as many times as “Total uses”.
InactiveThe “Active” switch is off. The code is kept but not accepted.
TrashThe code is deleted but can still be restored.

Beside each code are these buttons: “Edit”, “Duplicate”, and “Trash”. “Duplicate” creates an inactive code with the same conditions; change its code and activate it. In “Trash”, “Restore” brings the code back inactive and “Delete permanently” erases it for good.

Creating or editing a code

“New code” or “Edit” opens the code form. The form has five sections.

OptionWhat it doesDefault
CodeWhat the buyer types. English letters and digits, at least two characters and no spaces. Letter case doesn’t matter. “Generate automatically” writes a random code.Empty
Description (for you only)A note the buyer doesn’t see, for example “Yalda campaign”.Empty
Discount type“Percentage of cart”, “Fixed amount off the cart”, or “Fixed amount off each item”.Percentage of cart
AmountThe discount percentage or amount. A percentage above 100 is not accepted.Empty
Maximum discountThe cap on a percentage discount. For example, 20% up to a cap of 500,000 Toman. Empty means no cap.Empty
Free shippingA shipping method set to “Free with a discount code” becomes free.Off
ActiveOff means the code is kept but not accepted.On

Time. Dates are Shamsi, like 1405/08/15.

OptionWhat it does
From dayThe code is accepted from the start of this day. Empty means from now.
Until end of dayThe code is accepted until 23:59 of that day. Empty means always.

Cart conditions.

OptionWhat it does
Minimum cart totalThe code is accepted only when the cart total is at least this amount.
Maximum cart totalAbove this amount the code is not accepted. It must not be smaller than the minimum total.
Can’t be combined with another codeIf this code is applied, no other code is accepted beside it.
Don’t apply to sale itemsProducts that have a sale price don’t get the discount.
First purchase onlyFor someone who is logged in and has no paid order yet. A guest must log in first.

Products and categories. “Only these products”, “All except these products”, “Only these categories”, and “All except these categories”. Search for a product by name or ID and add it. Empty means all products.

Who and how many times.

OptionWhat it does
Total usesAfter this many uses, the code becomes “Fully used”. Empty means unlimited.
Uses per buyerHow many times each buyer can enter this code.
On how many cart itemsFor “Fixed amount off each item”: the discount is calculated on how many items. Empty means all.
Only these mobile numbersOne number per line. It is checked only against a mobile number the customer has verified with an SMS code, not a number typed in the billing form.
Only these emailsOne email per line. *@company.ir means all emails of that domain.

The button at the bottom of the form is “Create code” for a new code and “Save changes” for an existing one. If a date is wrong, the end day is before the start day, or the code is a duplicate, an error message appears and nothing is saved.

Usage report

At the bottom of each code’s edit form is the “Usage report”: the order, buyer, date, order status, and discount amount for each use.

Code guessing is blockedIf someone enters wrong codes back to back, after 10 wrong attempts no new code from them is accepted for 10 minutes. The messages “The code doesn’t exist” and “This code isn’t for you” are also identical so nothing can be learned by guessing.

Bulk create

The form for creating several one-time codes
The “Create several one-time codes” form. “Can’t be combined with another code” is on in advance.

For SMS, gift cards, or campaigns: each code is accepted only once. All the codes made in one run have the same conditions.

OptionWhat it doesDefault
How many codesFrom 1 to 500 codes.Empty
PrefixThe fixed first part of the codes. For example YALDA makes codes like YALDA-K7Q2X9. English letters and digits only, up to 12 characters.Empty
Random part lengthFrom 4 to 12 characters. Characters that are easily confused (such as 0 and O or 1 and I) are not used.6
Discount typeLike the single code form.Percentage of cart
AmountThe discount percentage or amount.Empty
Maximum discountThe discount cap, only for the percentage type.Empty
Minimum cart totalThe minimum cart total to be accepted.Empty
Until end of dayThe Shamsi end date. Empty means always.Empty
First purchase onlyLike the single code form.Off
Can’t be combined with another codeLike the single code form.On
  1. Fill in the form and press “Create codes”. The codes are created active.
  2. Press “Download list (CSV)”. After creation, the number of codes created and this button appear above the form. Open the file in Excel or your SMS system.
  3. Distribute the codes. In the “Codes” tab, you can see these same codes with “Created in bulk”.

Frequently Asked Questions

A “First purchase only” code doesn’t work for guests.

Correct. Farin must know whether the buyer has purchased before, so the buyer has to log in. The message “Log in to your account first” is shown to them.

I created a code for a customer’s mobile but it isn’t accepted.

The customer must have logged in at least once with an SMS code for that number. A number that was only written in the billing form is not checked.

I deleted a code by mistake.

Press the “Trash” button at the top of the list and press “Restore” beside the code. The code comes back inactive; turn “Active” on by editing it.

Farin Theme · 1405