How to Import & Export Magento 2 Commerce Gift Cards

- E-Commerce, Magento 2, Our extensions

Magento 2 Commerce Gift Cards Import Export

If you are a Magento Commerce user, there is no need to install any third-party Magento 2 gift card extensions since the platform provides the corresponding functionality out of the box. In the following post, we shed light on how to use the new feature as well as run Magento 2 gift cards import and export processes that transfer not only gift card products but also all the related data.

Magento 2 Commerce Gift Card Workflow

The functionality of coupons and gift cards in Magento 2 is often similar. And while a coupon is applied to an order, a gift card is redeemed reducing a cart’s order total. As a buyer, you get the corresponding option during checkout. Magento 2 commerce lets you enter a gift card code to apply an amount from the card to your purchase.

In a customer accounts, you can see the status and remaining balance of all gift cards. Also, note that Magento 2 lets you use both single and multiple gift cards to pay for the whole purchase or its parts.

Magento 2 Commerce Gift Cards Import Export

As a Magento 2 administrator, you can view all gift card codes applied by customers. In the Admin section, open order to see the necessary information. Besides, you can find some additional control options there. For instance, it is possible to retrieve the code to place it on a physical gift card.

In case a gift card order is canceled or refunded, it is necessary to cancel the associated gift card account manually. Magento 2 provides the following two options: deletion or deactivation.

And there are three types of gift cards in Magento 2: virtual, physical, and combined, which shared the functionality of the first two. Let’s say a few words about each one.

Magento 2 Virtual Gift Card

A standard virtual gift card is emailed to a recipient. As its buyer, you can add an optional message addressed to your special someone. Next, the card can be redeemed on any of the Luma family of websites. It is also necessary to mention that you can set the expiration date! Any standard Magento 2 gift card doesn’t bound its recipients to any terms!

Magento 2 Physical Gift Card

In the case of a physical gift card, it is packaged in a custom art mailer and sent at no charge to a specified recipient – a buyer’s special someone. There are several options of how a physical gift card can be redeemed:

  • in store;
  • by phone;
  • on website.

And like virtual gift cards, physical ones can have an expiration date customized. Let’s take a look at some other features of Magento 2 Gift Cards.

Gift Card Values

As a customer, you can determine the value of a gift card. Corresponding options are available on a product page. By default, Magento 2 supports both a fixed price field and a list of price options. Thus, the appearance of a product page regarding gift card values depends on backend settings. Also, note that all amounts appear in a currency that you use on your e-commerce website.

Gift Card Information

Next, it is necessary to complete the gift card information. If you purchase a physical gift card, enter both Sender and Recipient names. In the case of virtual or combined gift cards, it is necessary to add both Sender and Recipient emails. If you are a registered logged in customer, the Sender Name and Sender Email fields are completed automatically. As mentioned above, it is also possible to enter a message to your recipient depending on configuration.

Gift Card as Product

When you purchase a gift card, it appears as a line item in the cart with various details. For instance, you can see the name of the sender and recipient as well as the aforementioned message if applicable. Also, note that Magento 2 converts the amount associated with the gift card to the base currency of the store.

Next, a customer receives confirmation of the order. As a gift card purchaser, you can click the link in the confirmation and track the order from your account dashboard.

From a recipient side, virtual or combined gift cards are sent via email with the gift card code, name of the sender, and message, if there is one. If a buyer purchases more than one gift card, all of them are attached to a single email.

In case of physical gift cards, there are two options: a card can be shipped either directly to the recipient or the customer. As a customer, you can write a message on it and then personally deliver the gift card to the recipient.

How to Apply Gift Card

A recipient applies a gift card to purchase an item in your store. He/she applies the gift card code during checkout, and the new amount appears in the order totals block subtracted from the grand total. Next, the full balance of each gift card is subtracted from the shopping cart total.

It is also possible to use multiple gift cards to pay for a purchase. Then, the amounts are applied in ascending order: a card with the smallest remaining balance is used first. The cards are utilized until a customer runs out of them or the grand total is zero. In the latter case, the last gift card account applied to the cart receives a partial deduction. If a card has not been applied to the cart, it does not receive a deduction.

That’s how everything works for Magento 2 Commerce gift cards. Now, we can tell a few more words about their import and export.

How to Import And Export Magento 2 Gift Cards

Magento 2 mysql data import

Yes, importing or exporting gift cards with the help of the standard Magento tools is possible, however it is a tedious task. But you can rely on third-party modules. Unfortunately, it has always been challenging to find a reliable import/export extension that satisfies all business needs. Most tools are limited to the import or export process correspondingly. Some of them are developed to transfer a limited number of entities, while the others lack such features as mapping or automation. Considering all these and multiple other drawbacks we’ve decided to create our module.

Meet the Improved Import & Export Magento 2 extension – your number one time-saver for all import and export tasks that take place on your e-commerce store. The module allows moving most Magento 2 entities including gift cards.

To import Magento 2 gift cards, follow these steps:

  • Go to System -> Improved Import / Export -> Import Jobs and hit the Add New Job button.
  • Configure General Settings and proceed to the Import Settings section. Here, you can select ‘Products’ among options of the Entity drop-down. Yes, the gift cards in Magento 2 commerce are just another product type and they share all the attributes with the products.
  • When the job is configured, save it and run the update.

As for the Magento 2 gift cards export, the process is entirely the same. You can configure it under  System -> Improved Import / Export -> Export Jobs.

Get Improved Import & Export Magento 2 Extension

Importing and exporting gift cards to Magento 2

In Magento 2 Commerce gift cards are an additional product type. It means that gift cards are products, and are exported and importing with ‘products’ entity. If you have ever exported or imported products to Magento 2 it will be very easy for you to master the gift card import, because every attribute should be familiar with the exception to additional_attributes column, where ALL the gift card properties are stored in native Magento 2 import and export.

As for Improved Import and Export extension for Magento 2, Firebear team introduced an additional way of importing and exporting gift cards. We have split the additional_attributes columns and extracted all gift card attributes into separate columns. This makes the gift card impot much easier because instead of composing a complex values for additional_attributes column, you can take advantage of the separate columns with simple values. This also comes in handy if you are integrating your Magento 2 with CRM or ERP system, because every setting is stored in a separate field.

Native Magento 2 gift card import and export

With native Magento 2 import and export, gift cards are exported and imported along with products, however, every gift card setting is stored in the additional_attributes column.

As per illustration above, you can see that additional_attributes column has a complex value for every gift card, covering every gift card attribute. The additional_attributes column has the following structure where all gift card attributes are separated by a comma without using spaces:

allow_message=1,email_template=giftcard_email_template,giftcard_type=Virtual,gift_wrapping_available=Yes,gift_wrapping_price=2.0000,is_redeemable=1,lifetime=365,open_amount_max=30.0000,open_amount_min=10.0000,use_config_allow_message=0,use_config_email_template=0,use_config_is_redeemable=0,use_config_lifetime=0

Every attribute will be explained in the next chapter.

As you can see, every gift card attribute either requires a set value or certain value to work. You may want to open a gift card product in your Magento 2 backend to see the perfect reference of the attributes.

Magento 2 Commerce gift card import and export attributes

With Improved Import & Export extension for Magento 2 we have split additional_attributes column into dedicated columns for every gift card attribute to make the import and export processes more user and software friendly.

To see how the gift card samples look refer to:

  • Google Sheet Master table – a google sheet with sample tables with every attribute explained
  • GitHub – Firebear Team GitHub account where you can download CSV, XML, Json, XLSX, and ODS sample files.

Below you can find every Gift Card attribute explained. For explanation of other product attributes, please refer to the main article on product import, or refer to the sample Google Sheet with products.

Where:

Attribute name Reference Values Value example
product_type REQUIRED ATTRIBUTE

Indicates the type of product.

Values:

giftcard

We are talking about gift cards 🙂

giftcard
additional_attributes Additional attributes of the product. With native Magento 2 import and export tool, all gift card attributes are stored here. If you are using Improved Import and Export extension for Magento 2. You can use separate gift card attributes, or use this column. Never both. See sample file. Value is too long.
allow_message Allow Message setting of the gift card. Defines if customers can send a custom message text with the gift card. Available values:

1 – enabled

0 – disabled

1
email_template Email Template setting of the Gift Card Information. Defines the email template that will be used with the gift card. Must contain the Template Name of the email template you want to use. giftcard_email_template
giftcard_type Defines the type of the gift card. Available values:

  • Virtual
  • Physical
  • Combined
Virtual
is_redeemable Treat Balance as Store Credit setting of the Gift Card Information. Defines if the gift card balance can be redeemed as a store credit. Available values:

1 – yes

0 – no

1
lifetime Lifetime (days) setting of the Gift Card Information. Defines for how many days the gift card should be valid at the store. Can only contain numerals 123
open_amount_max Open Amount To. Defines the maximal value of the gift card’s open amount. Can only contain numerals 123
open_amount_min Open Amount From. Defines the minimal value of the gift card’s open amount. Can only contain numerals 12
use_config_allow_message Defines if Allow Message setting of the gift card, should use default store value Available values:

0 – no

1 – use default

0
use_config_email_template Defines if Email Template setting of the gift card, should use default store value Available values:

0 – no

1 – use default

0
use_config_is_redeemable Defines if Treat Balance as Store Credit setting of the gift card, should use default store value Available values:

0 – no

1 – use default

1
use_config_lifetime Defines if Lifetime (days) setting of the gift card, should use default store value Available values:

0 – no

1 – use default

0
giftcard_amount Amount of the gift card. Can store multiple values separated by a comma. Can only contain numerals separated by a comma, without spaces. 10.0000,20.0000,30.0000
giftcard_allow_open_amount Open Amount setting of the gift card. Defines if customer can manually define the amount of the gift card they want to purchase. Available values are:

1 – open amount

0 – only store administrator specified amounts

1

As you can see the gift cards share product attributes and their import is pretty much straightforward.

Improved Import & Export Magento 2 Extension Features

Magento 2 oracle import

As you can see, it is not a problem to import and export Magento 2 Commerce gift cards if you use the Improved Import & Export Magento 2 module. But what other features does the extension offer?

Below, we shed light on more enhancements that improve other processes related to data transfers. The Improved Import & Export Magento 2 plugin offers lots of advantages over both the standard solutions and other third-party extensions.

The module has already become a number one import/export tool for hundreds of merchants all over the world. If your e-commerce activities are related to integrations, data transfers, and synchronizations with external systems, you can dramatically enhance corresponding tasks with Improved Import & Export. Let’s start our exploration with the automation of data transfers.

Automated Import & Export Processes

Our module provides two types of automated data transfers. Firstly, you can create schedules to launch the import and export processes within certain intervals. Secondly, it is possible to use event-based triggers to launch the import and export processes automatically after a specified action is done.

Schedules

The Improved Import & Export Magento 2 extension lets you create update schedules on the basis of cron. Automate data transfer by creating custom update schedules or selecting one of the predefined intervals. Note that every provided range can be customized after you choose it.

At the same time, the Improved Import & Export extension lets you simplify transfers of Magento 2 gift cards using profiles that have no schedules. Chances are, some of your integrations are random or asynchronous; at the same time, you may need to transfer gift cards only once, so no schedule is necessary. Instead, run related data transfers manually. And don’t forget that it is possible to launch every scheduled profile asynchronously whenever you want.

Configure a schedule as shown below:

Events

Another way of automating data transfers as well as Magento 2 gift card import and export are represented by event-based triggers. The alternative method of moving data between your e-commerce store and external platforms offers improvements required to enable real-time updates, but you need to specify a proper trigger.

For instance, an event when a customer places an order can play this role. It launches a new export process that transfers order data (or any specified entity) to a selected platform. Thus, you get instant import or export procedures with the Improved Import & Export Magento 2 extension.

Note that it is possible to use both system and custom events as triggers. After a trigger is defined, specify conditions to increase the efficiency of updates. For further information, follow this link: How to Run Magento 2 Import or Export After Specific System Event or Process.

Advanced Mapping Features

It is impossible to transfer information from external systems to Magento 2 directly. Furthermore, even Magento 1 to Magento 2 transfers are interrupted by the necessity to edit attributes that differ on each platform.

Thus, a seamless connection between your Magento 2 website and an external platform is hard to achieve unless you use the Improved Import & Export Magento 2 extension. Below, we shed light on how our module helps to solve the problem of different attribute standards.

Mapping Presets

The problem is not so scary as it looks if you use the Improved Import & Export extension. Our module offers multiple mapping presets designed to match external designations to the corresponding internal ones in a matter of seconds.

Select and apply a preset related to your integration, and the module will do all the work for you. Improved Import & Export analyzes the input data and matching all third-party attributes to the corresponding ones used within your Magento 2 database automatically.

In the case of the default attribute editing, you have to transfer data via files and edit their content manually on every update. Our extension turns everything into a one-time procedure that takes a few seconds only and consists of a few clicks. The following image illustrates the process:

Matching Interface

In case a preset is absent, map attributes manually right in the admin section. The Improved Import & Export Magento 2 extension offers a user-friendly interface where you can select a third-party designation and specify the corresponding internal one in front of it. Do the same actions for all third-party attributes as shown below:

The third column is untouched in the example above, but you can set hardcoded values there. These values will be specified to all items bound to attribute. For instance, with the “Default Value” column, you can import products from different store views directing all of them to a single one. You only need to specify a corresponding store view as a hardcoded value for the “_store” attribute.

Attribute Values Mapping

The same approach can be applied to attribute values mapping. The Improved Import & Export Magento 2 extension reduces headaches related to external designations even in such small aspects as attribute values. Although they usually don’t prevent import processes, there are always some exceptions. At the same time, it is necessary to spend lots of time and effort editing third-party attribute values after the update is made.

With the Improved Import & Export Magento 2 extension, you get a user-friendly interface for matching them. Choose a third-party designation and specify the internal one in front of it. Repeat the process for every third-party value. For further information, follow this link: Attribute Values Mapping.

Attribute Values Editing

In addition to matching, the Improved Import & Export module lets you edit attribute values in bulk. The extension offers the following rules:

  • Add a prefix to multiple attribute values;
  • Add a suffix to multiple attribute values;
  • Split multiple attribute values;
  • Merge multiple attribute values.

Combine rules and create conditions to increase their efficiency. Follow this link for further information: How to Modify Attribute Values During Import and Export in Magento 2.

Category Mapping

And when you move products from other e-commerce websites, our extension is also helpful. Since external online stores may have a different catalog structure, you will need to adjust it after import to put products to proper categories of your website. Manual editing requires tons of time and effort, but the Improved Import & Export extension simplifies your routine dramatically. Our module lets you match external product categories to ones used internally. The following gif image illustrates the process:

It is even possible to create new categories on the fly if necessary. Select a parent category and specify the name of a new one. That’s it! Both features are described in the following article: Category Mapping.

Attributes On The Fly

And when your update file doesn’t include a complete spectrum of data preventing import processes, the Improved Import & Export Magento 2 extension lets you avoid future errors due to the ability to create attributes on the fly. The module enables you to specify all parameters necessary for the attribute generation with the help of the following general form:

Attribute|attribute_property_name:attribute_property_value|…

The full process is described in this article: Product attributes import.

Extended Connectivity Options

By default, Magento offers only one way of data synchronization – you have to use files to exchange information between platforms. But it is possible to avoid the standard limitation with the Improved Import & Export extension. Our module not only offers several more ways of creating a bridge between your e-commerce platform and external systems but also provides an extended range of supported file formats.

Multiple File Standards

Unfortunately, Magento is bound to CSV files only. The support for the single format is enough for some cases, but it doesn’t cover all business needs of a company regarding all its integrations. As for the Improved Import & Export Magento 2 extension, it substantially increases the number of supported formats. Thus, you can freely transfer XML, JSON, ODS, and Excel files with the help of our tool. Furthermore, it is possible to apply all other features to them. For instance, mapping or schedules are equally supported regarding the chosen file format.

Multiple File Sources

Multiple connection options represent another way the Improved Import & Export Magento 2 extension increases the flexibility of file transfers:

  • FTP/SFTP. Use a local or remote server to move data files.
  • Dropbox. The same functionality is possible with your Dropbox account.
  • URL. If you only need to import a data file, specify its URL.

And don’t forget that the Improved Import & Export Magento 2 extension supports file archives. It extracts compressed data automatically, so you don’t need to do that manually before every update.

Alternative Ways of Import & Export

As for alternative ways of import and export, they are represented by API integrations and intermediary services. In the case of the former ones, the Improved Import & Export Magento 2 extension lets you use one of the following standards to synchronize your e-commerce store with external systems: REST, SOAP, and GraphQL.

When it comes to intermediary services, it is possible to streamline different online sheets to achieve the same goal. Use Google Sheets, Office 365 Excel, or Zoho Sheet to exchange data between Magento 2 and external systems. The integration on the basis of Google Sheets looks as follows:

Magento 2 Google Sheet import

Watch the following video to see the extension in action:

Final Words

While Magento 2 Commerce offers the gift card functionality out of the box, it doesn’t let you import and export them including all the corresponding data. If you migrate from one store to another, you will never transfer information about what gift cards. Thus, data about how much each card has been redeemed will remain on your old website. Luckily, there is the Improved Import & Export Magento 2 Extension. It allows moving gift cards and all the related data between Magento and external systems. For further information, follow the link below and contact our support:

Get Improved Import & Export Magento 2 Extension