What is a Gift Card?

A gift card is a prepaid card with a specific code and a certain amount of money used to purchase products or goods.

A reward amount in the form of a card with a specific code can be gifted to your friends, family, colleagues, etc. It is often used for business promotions. It can be used until the amount is over.

A spree application with checkout features can benefit tremendously from a gift card. It can attract more customers and lead to sales maximization. 

Spree Commerce has a Spree backend gem named “spree_gift_card” which provides gift card functionality to your spree store.

Benefits of Gift Cards:

  1. Business Owners :
    a. Enhance sales and revenue: Providing customers more options will increase sales.
    b. Encourage, build, and maintain customer loyalty: For redeeming the gift card, the customer has to visit the Spree store and probably purchase more.
    c. Avoid theft and fraud damages: Gift cards have specific code ( which is secure ), generated by the SHA algorithm, which can be used to purchase products and avail discounts.
  2. Customer Benefits :
    a. Customer convenience: Customers can purchase using gift cards according to their convenience.

How does it Work?

  1. A gift card can be created by an admin or he can enable it if already created.
  2. A gift card is treated as a normal product and purchased from your spree store.
  3. When a gift card is successfully purchased, the recipient is notified with the gift code, sender’s note, and recipient’s details.
  4. The recipient can redeem the gift card by applying the gift code during the payment checkout process.

Further Reading: 5 Reasons to Choose Spree Commerce for Your Store

Installation:

  1. Add “spree_gift_card” to your Gemfile.

a. For Spree >= 3.2
      gem 'spree_gift_card' , github: 'vinsol-spree-contrib/spree_gift_card'

b. For Spree < 3.2
      gem 'spree_gift_card', github: 'vinsol-spree-contrib/spree_gift_card', branch: 'X-X-stable'

Note: Please Use 3-1-stabilize branch for Spree 3-1

The branch option is important, it must match the version of the spree you are using. Spree integration of this depends on the version. Ie For example use branch: ‘3-7-stable’, if you are using spree 3.7.

      2. Install the gem using bundler:

bundle install

      3. Copy and run migrations

bundle exec rails g spree_gift_card:install

      4. Seed the default data using, or you can do configurations from the admin end.

rails g spree_gift_card:seed

After successful installation, you would see below links related to a Gift card in the admin section and in the front Spree multi store.

    1. On the admin side, you will see the Gift Cards link available in the side menu.

      Gift Cards link

    2. On the frontend, you can see a Buy gift card link  available on the left side.

      Shop Giftcard by brand

    3. Go to Configurations > General Settings > Gift Card Settings
      a. Flag Allow Gift Card to be redeemed.

       

      Flag Allow Gift Card to be redeemed

   4. If you click on the above Buy gift card link, you will be redirected to gift_cards/new:

Buy gift card link

Prerequisites Which Admin Needs To Set Up

Add a Store Credit Category for gift card:

Go to Configurations > Store Credit Category as per the below screenshot and make sure to name it exactly the same.

Store Credit Category

New store credit category

Now, create products which behave as a gift card from admin end:

  1. Go to Products > Products > New Product:

Create a product with the Gift Card Shipping Category and also enable IS GIFT CARD flag ticked.

  1. Create a product with the Gift Card Shipping Category
    Check GIFT CARD
    2. Add Stock for that gift card by going to the Stock section in product’s edit page:

Stock section in product’s edit pageNote: If the admin doesn’t want the gift card to be redeemed, i.e. the gift card amount not to be credited as a store credit, he can disable(uncheck) the flag ( Allow Gift Card to be redeemed ) in Configurations > General Settings > Gift Card Settings

Hooray !! You have gift cards available for users!!

Now, go to the frontend to purchase gift cards for your friends, family, and dear ones!! You can connect with Spree support if any trouble arises in integration.

How to use Gift Cards from the frontend of your Spree Store?

There are 2 flows available for gift cards:

  1. Admin can create a gift card from the backend.
    a. Login as admin
    b. Go to Gift cards, click on New Gift Card and create a gift card:

click on New Gift Card and create a gift card

Note: Here, the recipient will not receive any email for the gift card. But customizations can be done as per the requirements.

        2. A user can purchase a gift card from frontend by following the checkout process:

                a. Log in as a user.

                b. Go to Frontend, you will see a Buy gift card link on the left-hand side:

Buy gift card link on the left-hand side

c. Click on this link and a form will appear to fill out the form for the recipient, to whom you want to use the
gift card:

i. Select the amount of gift card

ii. Fill the recipient email, name and a note from the sender to the recipient.

d. Then, Click on the Add To Cart and follow the standard checkout process. Verify that the shipping category for a gift card is visible, no other shipping category is visible, as you can see below:

Click on the Add To Cart and follow the standard checkout process

Place the order for the purchased gift card

e. Place the order for the purchased gift card.

Hold on!!! Your friend hasn’t received the gift card right? Anything wrong?

You missed out to capture the payment from the backend (admin side).

f. Capture the payment for this placed order from the admin end by visiting the link for that placed order in Orders and your friend will receive the gift card purchased.

placed order in Orders and your friend will receive the gift card purchased

order message

Here, the Claim Code link available in the mail is the link to redeem your gift card.

When the recipient hits Claim Code link, the gift card amount is added as a store credit in his account.

Remember, you should hit this link after you have logged in to the application. We have done customization to avail this when user login or register.

store credit

checkout

Points to Remember:

  • You cannot purchase a gift card using a gift card.
  • The recipient will be notified only when the order’s payment is captured.
  • You can purchase a gift card using store credits and any PROMO CODES.
  • The gift card will only be redeemed in Store Credit if you are logged in the application and hit the Claim Code link available in the mail.
  • If you don’t hit the link, then you can always purchase products or goods using the gift code received in the mail.

BoTree Technologies is a leading software development company in Ahmedabad that builds top-notch software and solutions to increase business revenue and maximize productivity. Get a FREE CONSULTATION from our CEO.