Getting your business online

Documentation for the Magento Unirgy Gift Certificate Module

I thought it would be useful for many Magento developers if I wrote some concise documentation for the Unirgy Gift Certificate Module. (Version 0.9.14)

What does it do?

The Gift Certificate module allows you to add gift certificates to your online Magento store.
They can be either electronic certificates, where a code is emailed to be redeemed on your site, they can be actual printed certificates that are mailed out to customers, or they can even be a combination of both.

Certificate codes can either be randomly generated, or created by the store owner, to match pre-printed certificate numbers.

Installing the Module

Get the extension key from the Magento Connect website, then either install through Magento Connect on your store, or with the following command executed from your magento base install directory:

./pear install magento-community/Unirgy_Giftcert

You may need to refresh your magento caches, and logout from the admin section, in order for the new gift certificate sections to display.
In your administration section, you should now have a 'Gift Certificates' link in the 'Customer' menu, and a 'Gift Certificates' link in the sidebar of the 'System' -> 'Configuration' menu.
The first is to manage all your Gift Certificates, while the 'Configuration' contains the settings.

Custom Themes

If you are using a custom theme with your Magento install, you will need to copy one file and one directory into your theme directory to make it work correctly.

From your base install directory, copy...

app/design/frontend/default/default/layout/ugiftcert.xml

to...

app/design/frontend/default/YOUR-THEME-NAME/layout/ugiftcert.xml

And then

app/design/frontend/default/default/template/unirgy

to...

app/design/frontend/default/YOUR-THEME-NAME/template/unirgy

Configuring the Module

Go to 'System' -> 'Configuration' -> 'Gift Certificates'.
Here is a synopsis of what each option does:

Auto generate certificate number [If YES, certificate numbers will be generated from a random pattern of numbers that you set below. If NO, you can assign your own number to each certificate, before you activate it.]

Certificate number pattern [The pattern of the random generated numbers.
Pattern examples:
[A*8] - 8 alpha chars
[N*4] - 4 numerics
[AN*5] - 5 alphanumeric
CERT-[A*4]-[AN*6] - CERT-HQNB-8A1NO3]

Use PIN [The purpose of the pin is not entirely clear to me. It seems to be used to check certificates on the customer balance page. It is NOT required by the customer when they actually redeem the certificate. To avoid confusion, until I find a purpose for this PIN I simply select NO]

Auto generate PIN [To generate random PIN numbers]

PIN pattern [The random pattern for the PIN]

Default status [The initial status of all certificates once they are added to someones cart. Certificates are generated even if the checkout process is not completed. But they cannot be redeemed unless the status is set to ACTIVE.]

Change status to active on payment completion [Do you want to set status to ACTIVE once payment for the certificate is confirmed. I set this to YES unless I intend to manage the entire certificate process manually. ]

Amount values configuration 5-1000

Pattern examples:
50 - 1500 : a range between $50 and $1500
25; 50; 100 : a dropdown with values of $25, $50, $100
50 : a static value of $50
- : enter "dash" to allow any amount value
For multi-currency setups enter configuration for each currency on new line, like this:
EUR: 25; 50; 100
CAD, USD: 50; 100; 200
*: 100; 200; 500
Whitespaces are optional and will be ignored.
[The example explains this field ]

Default Expiration Timespan (in days) [How long are gift certificates valid. Don't be stingy, there is nothing more frustrating to a customer than trying to use an expired certificate. ]

Allow custom message [Will you allow custom messages. If you do, be sure to disable the Magento gift message for this product, otherise it can end up with two messages.]

Custom message max length [Limit the number of characters of the message]

Enable custom message preview [Can customers preview their messages or not.]

Display full totals info in cart [Show the full certificate details in the shopping cart, or just a summary.]

Allow recipient's email [Can Certificates be emailed to customers, or not.]

Send new GC confirmation [When to send a confirmation email for new gift certificates. ]

Gift Certificate Email Sender [Who is the email sent from]

Gift Certificate Email Template for Purchaser [Template for the Gift Certificate]
Gift Certificate Email Template for Someone Else [Template for the Gift Certificate]

PIN format for email confirmations [How to display the PIN number in email certificates]

Allow recipient's address [Can certificates be delivered to a physical address]

Always handle GC as virtual products [Allows zero postage if they are]

Subscribe for extension update notifications [Notify you about updated to the module]

How to create a gift certificate product

Ok, now you have configured your settings, you are now ready to make yourself a gift certificate.

Go to 'Catalog'->'Manage Products' and click 'Add Product'.

Leave 'Attribute Set' as 'Default'
Change 'Product Type' to 'Gift Certificate'

New Gift Certificate

GENERAL
Name [something like Gift Certificate]
Weight [0, if you want free postage]
Status [Enabled]
Allow Gift Message [Select NO if you allowed messages in your Gift Certificate configuration]

INVENTORY
Manage Stock [NO, if you intend to issue unlimited certificates. I can't imagine a time when you would need stock control.]
Stock Availability [In Stock (Is this used when Manage Stock is off? Just in case!)]

CATEGORIES
You may place your gift certificate in a category, but it currently causes a small bug, where the smallest amount available is shown as the price of the product. There is a simple CSS fix for this below. It is better if you can take your customer directly to the Gift Certificate product page, and skip using categories altogether.
If you do need to use categories, once you have added your product, add this line of code to your themes styles.css file:

#product-price-390:before{content: "From "; }

Change 390 to whatever your Gift Certificate product ID is, and the price will appear as 'From $5'. This CSS trick does not work with older versions of internet explorer.

Now visit the shop and purchase a gift certificate. Go to the admin section, 'Customers'->'Gift Certificate' and activate it. Then try entering the code at check-out.

It should all be working smoothly.