How to Import and Export WooCommerce Coupons?

The Best WooCommerce Order Import Export Plugin

7,000+ Active Installs as per WordPress Official Plugin Repository

#1 in Customer Satisfaction With Most 5 Star Reviews

WebToffee Guarantee: Get Your Money Back if You Are Not Satisfied With The Product

Buy Now!

This article explains how to Import and Export WooCommerce Coupons by using  Order / Coupon / Subscription Export Import Plugin for WooCommerce. Please refer to the product page to know more about the plugin features.

Overview

The WooCommerce Order / Coupon / Subscription Import-Export plugin allows you to import Coupons from WooCommerce store. It exports Coupons from WooCommerce store to the CSV file. Under Coupon Import / Export tab, you can import/export/merge (update existing coupons) hundreds, even thousands, of Coupons using one file which saves your effort and time of manually adding Coupons information.

For importing Coupons to your online store, you must create a CSV (Comma-Separated Values) file which contains information about mapping fields in a tabular form. You can create a CSV file by using a spreadsheet program, such as  Excel, or Google Spreadsheets. Save this file with extension .csv.  After entering all details about Coupons in the spreadsheet, you can import Coupons to your online store. With this plugin, you can also export Coupons details as a CSV file.

Coupons Import/Export tab

The plugin takes CSV file as input. It maps each field of CSV file to the field of a particular Coupons.

For example, Coupon ID field gets mapped to the identification number of the coupon and the coupon_amount field gets mapped to the total coupon amount. If you want the plugin to work correctly, you must map headers of all of the column correctly and you must ensure that all of the fields you enter must be in the correct format.

Note: While importing, if there is any mistake in your import file, your Coupon import may not work as expected. Also, the CSV Import file must be in UTF-8 format. For more information about UTF-8 encoding, read How to save CSV / Excel File as UTF-8 Encoded?

To get started you must have CSV file. You can create the one, export the coupon to get the format of CSV or download Coupon Sample CSV.
You must enter the coupon details in CSV file in the structured format as given below:
  • The first row must contain the column headers which are used for mapping the fields. The details about the mapping field are given as below:
    Column Heading Explanation Accepted value or format
    post_title  Title of Coupon  Text
    ID  Identification number of Coupon  Numerical
     Short Description of Coupon  Text
    post_status  Status of the Coupon  Text e.g. Published, Draft, etc.
     Date of the Activation of the Coupon MM/DD/YYYY

    e.g 8/26/2016  5:30:00

    post_author  Indicates the post Author   Numerical
    discount_type  Discount type applicable for the Coupon  Text and allowed values are as given below:

    For Cart Discount, the value is fixed_cart.
    For Cart % Discount, the value is percent.
    For Product Discount, the value is  fixed_product.
    For Product % Discount, the value is percent_product.

    coupon_amount  Value of the Coupon  Numerical
    individual_use  Indicates whether the coupon cannot be used in conjunction with other coupons  Text

    e.g. Yes/No

    product_ids  IDs of the product. These products need to be in the cart to use the coupon  Numerical
    exclude_product_ids  IDs of the product. These products should not be in the cart to use the coupon  Numerical
     usage_limit Indicates the number of times the coupon can be used before it is void  Numerical
    usage_limit_per_user Indicates the number of times the coupon can be used by an individual user  Numerical
     limit_usage_to_x_items Indicates the number of times the coupon can be used for any particular product  Numerical
    expiry_date  Expiry date of the coupon  MM/DD/YYYY

    e.g. 3/30/2017

    free_shipping  Indicates whether free shipping is allowed or not.  Text

    e.g. Yes/No

    exclude_sale_items Indicates whether the coupon should apply to items on sale or not  Text

    e.g. Yes/No

    product_categories  Shows the product categories to which product must belong in order to use coupon  Numerical
    exclude_product_categories  Shows the product categories to which product must not belong in order to use coupon  Numerical
     minimum_amount  Indicates the minimum spend to use the coupon  Numerical
    maximum_amount  Indicates the maximum spend to use the coupon  Numerical
     customer_email  List of allowed Email IDs, comma separated  Text

    e.g. test1@gmail.com

  • Each row contains the single coupon.

To export URL Coupons Meta Data along with Coupon details from WooCommerce, please refer to the article.

Coupons import tab
Coupons import tab

The Import Screen appears as shown below:

You can import coupons from CSV file or merge the coupons with already existing coupons by importing updated CSV file.

Import Coupons

Coupons import tab
Coupons import tab

You can import all the required coupons by using Import Coupons. Click Import Coupons, the window appears as shown below:

  1. Method 1: Select a file from your computer. Click Choose File to browse a required CSV file from your computer.
  2. Method 2: Provide FTP Details. If your CSV file is on the server, then to import it,  you need to do FTP settings as explained below:
    1. Select the checkbox to enable FTP import/export.
    2. Enter FTP Server Host/IP.
    3. Enter FTP User Name.
    4. Enter FTP Password.
    5. Enter FTP Port number.
    6. Enter FTP Server Path.
    7. Select the checkbox to use FTPS.
  3. You get the mapping file option(s) for auto-mapping only if you save the mapped fields with a user-defined file name while Mapping the fields. Select the required mapping file from the Select a mapping file drop-down list as shown below:
    Select a mapping file
    Select a mapping file
  4. Enter the delimiter which separates the mapping values.
  5. Click Upload file and Import. The import window appears as shown below:
    Coupons import map fields
    Coupon import map fields
  6. You can map the fields(Woocommerce fields) with column headings ( CSV file header). Map a particular field of Map to column by using Column header  drop-down list as shown below:
    Coupon import mapping the field
    Coupon map column headers

    Select a required option from the drop-down list. Here, Coupon ID is mapped to ID.

    Note: Mapping is very helpful if you are importing CSV from some other e-Commerce platform like Magento.

    Evaluation field

    Settings for Evaluation fields
    Settings for Evaluation fields

    It is used to fix/update the required value for the particular field. The settings to modify the field are as given below:

    • Assign any required constant value to field (=)
      For Example: Suppose, you want to assign Cart Discount to Coupon Type. Under Evaluation field, write =Cart Discount in Coupon Type row.
    • Add any required value to field (+)
      For Example: Suppose, you want to add 5 to Usage Limit Per Coupon. Under Evaluation field, write +5 in Usage Limit Per Coupon row.
    • Reduce any required value from field (-)
      For Example: Suppose, you want to reduce 5 from Usage Limit Per User. Under Evaluation field, write -5 in Usage Limit Per User row.
    • Multiply by any required value to field (*)
      For Example: Suppose, you want to multiply to Maximum Amount by 1.05. Under Evaluation field, write *1.05 in Maximum Amount row.
    • Divide by any required value to field (/)
      For Example: Suppose, you want to divide the Minimum Amount by 2. Under Evaluation field, write /2 in Minimum Amount row.
    • Append any field by required value
      For Example: Suppose, you want to append Coupon Short Description with By HikeForce. Under Evaluation field, write &By HikeForce in Coupon Short Description row.
    • Prepend any field by required value
      For Example: Suppose, you want to prepend Coupon Title by WebToffee. Under Evaluation field, write &WebToffee[VAL] in Coupon Title row.

    Note : Hover the mouse on? (Help), you can see the information about Evaluation field.

  7. After mapping all the required field, you can save these mapping and evaluation fields in a file (user-defined) by using Mapping file name field.
  8. Click Submit.
  9. According to CSV file, the coupon(s) gets added to your online store. The import window appears as shown below:To see the imported coupon, navigate to Dashboard > WooCommerce > Coupon, the window appears as shown below:

Imported CouponsImported Coupons

Merge Coupons

Suppose your existing coupons got modified. To reflect that modified coupon into your online store, you can update the current Coupons by importing modified Coupon CSV file. This is called a merging of the Coupon.

Steps to merge Coupons

  1. Select Merge coupons if exists checkbox for modifying Coupons as shown below:
    Merge coupon window
    Merge coupon window
  2. Click Import Coupons, you get Merge Coupons window as shown below:
    Merge coupons page
    Merge coupons page
  3. Browse the updated CSV file by clicking on Choose file or by using FTP.
  4. You get the mapping file option(s) for auto-mapping only if you save the mapped fields in a user-defined file while Mapping the fields. Select the required mapping file from the Select a mapping file drop-down list as shown below:
    Select a mapping file
    Select a mapping file
  5. Enter the delimiter which separates the values.
  6. Click Upload file and Import. The Merge Coupon Window appears as shown below:
    Merge Coupon Window
    Merge Coupon Window
  7. Re-Map the fields if required.
  8. Click Submit.
  9. According to the CSV file, the Coupons gets merged with existing coupons. The window appears as shown below:
    Merge Coupon successfully complete
    Merge Coupon successfully complete

    Note: If Coupon ID does not exist, then the coupon is imported as a new coupon.

Export Coupons

If you export Coupons using the plugin, you get the CSV file which contains the data about all the Coupons of the WooCommerce online store.

Export Coupons in CSV Format
Export Coupons in CSV Format

You can export all the required Coupons by using the Export Coupons option. The window appears as shown below:

  1. Offset: Enter the row number of coupon at which you wish to start the export.
  2. Limit: Enter the maximum number of coupons that you wish to export.
  3. Coupons Types:  Select Coupon Types for which you want to provide a discount from the given list:
    Export by coupon types
    Export by coupon types
  4. Sort Columns: Enter the column name(s) by which you want to sort the CSV file. If you want to sort the products by more than one column name, enter Comma(‘,’) in between the column names.
  5. Coupon Amount: Specify the amount limits by using From Amount and To Amount spin boxes.
  6. Coupon Expiry Date: Select the date from which you want to export the coupons and the date till which you want to export the coupons.
  7. Delimiter: With this field, you can change the comma separated file to ‘|’, ‘.” etc. separated file according to your requirement.
  8. Columns: if you want to export specific columns, select the checkbox for required columns. With the Column Name field, you can modify the column header in the CSV file. To do that, simply enter the required column name for the specific column.
  9. Click Export Coupons, the CSV file gets auto-downloaded to your computer. The sample exported coupon CSV file is as shown below:
    Exported CSV
    Exported CSV

    Note: You can download the Sample Exported CSV.

Export Coupon(s) from Coupons Page

Coupons Page
Coupons Page

You can directly download the export file with all the fields. To do that, navigate to Dashboard > WooCommerce > Coupons. The Coupons page appears as shown below:

  • Click Download to CSV button to export single coupon details to CSV file.
  • To export bulk coupons, select them. From Bulk Action drop-down list, select Download Coupon as CSV and click Apply. All the information about selected Coupon gets auto-downloaded to CSV file.

Export URL Coupons

To export the URL coupon details along with the metadata, you need to add the code snippet in the child theme’s functions.php.
Note: WooCommerce URL Coupons plugin must be installed in your online store to export the URL Coupon.

Edit URL Coupon
Edit URL Coupon

Once the WooCommerce URL Coupons plugin is installed, you can add the URL Coupon to the online store. It is shown below:

After adding the URL coupon,  you can export the details of Coupon with the metadata. The metadata fields are as given below:

  • meta:_wc_url_coupons_unique_url
  • meta:_wc_url_coupons_redirect_page
  • meta:_wc_url_coupons_redirect_page_type
  • meta:_wc_url_coupons_product_ids
  • meta:_wc_url_coupons_defer_apply

Check out our Order / Coupon / Subscription Export Import Plugin for WooCommerce.

The Best WooCommerce Order Import Export Plugin

7,000+ Active Installs as per WordPress Official Plugin Repository

#1 in Customer Satisfaction With Most 5 Star Reviews

WebToffee Guarantee: Get Your Money Back if You Are Not Satisfied With The Product

Buy Now!

Leave a Reply

Your email address will not be published. Required fields are marked *