Guides & Documentation Site Back To Tiny Brick Store

Introduction

What is the Gift Card Suite?

The Gift Card Suite is an easy to use gift card system for Magento community edition. It features the ability to allow the customer to reload existing cards, buy mailed cards and printable cards. Everything is configurable such as SKUs for gift cards, email template for printable cards and allowable amounts to purchase.

How it Works

Gift Card Suite uses a new template for the user to buy and check balances of their gift cards. It is fully configured in the admin and all cards can be edited in the admin panel.

Installation

Before you Install

As with all our modules (and all modules in general), installing this module directly and solely in a live environment is strongly discouraged. It is recommended that it be installed in a development environment, configured, tested, and then deployed to your live environment through your deployment method of choice (i.e. - git, subversion, etc...). If this is not possible, then the next best thing would be to make a FULL backup before installation.

Pre-requisites

Code/Conflicts

  • NO EDITS OR MODIFICATIONS TO MAGENTO CORE (Typically, this includes all code inside the app/code/core folder)
  • No conflicting modules (or conflicting custom code) installed (Typically, if installed component/module affects same functionality as Gift Card Suite--gift cards/reward points, you should be wary of conflicts)

Magento Version

  • Community Edition 1.4 or Above (Tested with 1.4.1.1 as of this writing)

Installing the Basic Application

Navigate to the root of your application. You should see folders like (app, downloader, skin, etc...). If you have not already used Magento Connect or any other Pear package management for your installation, you will need to run the following:

terminal Setting up Pear

If you receive a permission error, run the following:

terminal Pear Permissions

Then (Replace /path/to... with the path to your Giftcard TarBall.):

terminal Pear Install

If you ever need to UN-install Gift Card, you can run:

terminal Pear UN-Install

These Commands Giving You Grief?

Don't give up yet. If you're not a veteran to command line, it can be just a character or two that makes the difference. If you are on a shared host, you might not be allowed to run pear installs (which is lame, but happens). If that's the case, try asking them if they could run them for you (sometimes they're nice that way). If they really are mean (or just not setup that way), then you might have to do a manual install. However, your best bet is to save it for the last option. It's definitely easier to run one command than try to copy files manually.

That's it for installation! Now you just have to configure Gift Card Suite.

Configuration

Creating The Gift Cards

The suite uses three products that need to be created. A mailable card product, printable card product, and a re-loadable card product. As you create these, note the SKU you assign to each. They should have the following attributes:

  1. Mailable card product : This should be a simple product. Visibility should be set to "Not Visible Individually". Set the price to 0(zero), as the module will set the price of the item. You should not manage stock on this product.
  2. Printable card product : This should be a virtual product as it is not shipped. This should not be visible individually, price set to zero, and do not manage stock.
  3. Re-loadable card product : This is also a virtual product, not visible individually, price set to zero, and do not manage stock.

Once products are created for the various types of cards, you have to identify them in the system. Click System->Configuration, then in the left column click on Sales. There will be a 'Gift Card' section that looks like the following:

Enter the SKUs you just created in the corresponding fields. This maps the products to the items that are added to the cart.

Settings

Set prices you will allow for gift cards. So in the 'Amounts' field make a comma separated list of prices. For example, if you allow cards to be bought for $15, $30, and $50, you would enter in this field 15,30,50.

The next three fields are for specifying the transactional email template to be used in sending printable gift cards. Also specify the email address and name that the email will come from. The transactional email MUST contain the following variables for the new card number, gift message, and balance to be passed in the email: {{var number}}, {{var msg}}, and {{var amount}}.

Cron Job

Ensure you have a cron job set up as per default Magento's requirements. The recommended interval is 5 minutes.

Note

A cron job is required to clear out any authorizations to gift cards that are abandoned. Abandoned gift card authorizations are cleared out every hour.

Shipping (Optional)

The last optional setting is setting a new shipping method. This is available if you need a shipping method for carts that only contain mailable card(s). To enable this, select the Shipping Methods from the System->Configuration screen. Select the Gift Card section. You can then select to enable the method, set it's title and name, select the set price for shipping OR set a percent of the subtotal for a shipping price. You can also select the countries the method is available in and the order you would like it to show in the list of methods.

General Usage

Managing Gift Cards

There is a new menu item in the admin called 'Gift Cards'. Under it there is a sub-item called 'Manage Gift Cards'. When you enter this section there will be a grid listing gift cards with their number and remaining balance. You can click an item to edit the details of the card. Here is where you can edit the balance of a card.

If you navigate to http://yoursite.com/giftcard (replace yoursite with the domain you installed this module on), you will see the gift card interface.

It is split into three sections: Buying a new Gift Card, Adding to a Gift Card(Re-loading), and checking a balance:

  1. Buy a Gift Card : This section the customer can buy new cards. They can either choose a physical card to be mailed to them or choose to buy a gift card to be sent to their email. If an email card is chosen, they will be required to enter an email address where the card will go. This can be any email address, even if its not the customers email that is checking out. This can be useful in sending gift cards to others. They then select the amount of the card and add it to the cart.
  2. Adding to a Gift Card : This section is used for reloading a card. The user simply enters an existing card number with an amount to re-load with, then clicks add to cart. This keeps the number associated with the cart item. So on a successful checkout the items amount will be added to the card. This will also let the user know if the card they enter is invalid or not.
  3. Checking Your Balance : This section is used for customers wanting to check the balance of their card. They simply enter their card number and click Check Balance. This will also let the user know if the card they enter is invalid or not.

Running a Test

The module adds a test card automatically. The test card number is 12341234. The starting balance is $500 and can be changed in the admin panel. If that works, then you should be set.

That's the tour. Short and sweet. Enjoy selling and accepting gift cards!

Gift Card API

The Gift Card Suite includes an API for external interaction with creation, charging, querying, and re-loading gift cards. This API is an extension of the Magento API (SOAP web service) and users and API keys are managed in the administration section of Magento.

API Methods

The following are methods provided by the Gift Card Suite.

  1. balance This method requires a gift card number to be passed to it. It returns the giftcard balance. If the card is not valid it will throw a fault 'Invalid Card'.
  2. charge This method requires both a gift card number and an amount to be charged to the card. This will deduct funds from the cards balance and also create a payment record for that gift card that can be viewed in the magento administration panel. This will also throw a fault if the card is not valid. You should check the cards balance before charging to verify funds.
  3. validate This method requires a gift card number. It simply return if the card is valid or is not valid.
  4. add This method requires an amount. This creates a new gift card. This is for purchasing gift card externally to be used on the site. This method will return the new gift card number. A fault will also be thrown if a new card cannot be created.
  5. reload This method requires both a gift card number and an amount. This method is for reloading a gift card with more funds. If the call is successful then it will return the updated card details. If there is an error it will throw a fault.

Example PHP call:

PHP Making an API Call

This is a simple SOAP service, and most languages support consuming these services. Please consult a developer or your language documentation for making calls to SOAP services to integrate with your particular system.

toc

Powered by Olark