Integrating Discount Codes with WooCommerce

You can generate Discount Codes from your WooCommerce store to offer subscribers when they subscribe through your Sumo forms. Don't have a WooCommerce store? Check out our non-WooCommerce Discount Codes guide!

Discount Codes are available on the following Sumo plans:

discount_pricing.png


WooCommerce Integration Requirements

In order to use our Woocommerce integration, you must be using WooCommerce 2.6+ and WordPress 4.4+.

Connecting Sumo to WooCommerce

The first thing to do is connect Sumo to your WooCommerce store. To do that, open List Builder and click on the Discounts tab. Then click on the Connect to WooCommerce button.wc_1.png

Now enter the name of your WooCommerce store. Click Integrate and Sumo will connect with your WooCommerce store!
wc_2.png

Note: When connecting to your WooCommerce store, you should be logged into your store with store owner credentials - not with another user's credentials.




WARNING - If you disconnect the WooCommerce integration from Sumo:

  • Any discount campaigns you create in Sumo will be lost (along with their stats)
  • Any Forms you created with Discount Codes will no longer offer codes. If you reconnect WooCommerce, you will need to re-assign a discount campaign to these Forms.


Creating a Discount Campaign

To create a Discount Campaign, open List Builder and click on the Discounts tab. Then click on the Create Discounts button to create a Discount Campaign.wc_3.png

Now you can choose the details of your Discount Campaign. Select a name and Discount type:

  • Percentage - Will reduce the order total by the specified percentage
  • Fixed Amount - Will reduce the order total by the specified amount
  • Free Shipping - Will waive the shipping fee on the order

You can also set an End Date if you want the Discount Campaign to end on a specific date.

When you're finished filling out all of the details, click the Save button and your Discount Campaign will be ready for use.

If you ever want to see the status of your Discount Campaign, click on it (or click the View button) and you can see a detailed overview of each code:3.png

  • Email - The email of the subscriber who claimed the code.
  • Source - The Form they subscribed on.
  • Page - The page on your website they subscribed on.
  • Status - The status of the code (issued/redeemed)

Assigning Discount Campaigns to Forms

The next step after creating a Discount Campaign is to assign it to one of your Sumo Forms. Open (or create) a Form and open the Success message.4.png

This is the message subscribers will see after giving you their email. Replace the default button with a Discount Code button.5.png

Now select the button and click Assign Discount. Select your Discount Campaign and make sure the text under the Assign Discount button says "Assigned Discount: <Your Discount Campaign Name>".6.png

Now after subscribing visitors will be able to click on the Discount Code button and automatically copy the discount code to use on your site immediately.

Sending Discount Codes through Autoresponder Emails

You can also send an automatic email with your Discount Code after visitors subscribe. You can read more about Autoresponder emails here.

In your Autoresponder Email, click on the Insert Discount Code button. Select a Discount Campaign if you didn't already in the Success message. Then click Save Email.8.png

Now your Autoresponder emails will send out the Discount Code issued to each subscriber!

Exporting Discount Codes

If you want an export of your Discount Campaigns, go back to the Discounts tab. Now select any Discount Campaigns you want to export, and a button labeled Export Selected will appear. Click that button and you will download a CSV file containing your Discount Campaign(s).7.png

Pushing Discount Codes as a Hidden Field

Want to send each subscriber's discount code to your Email Service Provider when they subscribe? No problem. First, make sure that you have a discount code campaign added to the form.

hidden_field_button.png

Now go into your form's Design section and click on the Hidden Fields button.

hidden_field_setup.png

  • Variable Name - This is what field name in your ESP the discount code will push to.

  • Variable Value - Enter {discount_code} here (or select it from the dropdown). This will only work if you have a discount code campaign assigned to this form!

Common WooCommerce Error Codes

Sometimes things go wrong with our Discount Code integrations. When this happens, Sumo will display an error message within the Discounts tab within Sumo. See the list below for a guide on how to navigate our most common error codes:

  • 401 (Unauthorized) - When prompted with this error, it is likely that Sumo was disconnected manually on WooCommerce's end. Another possibility is the user that connected to WooCommerce within Sumo doesn't have access to Coupons or Webhooks within WooCommerce. To verify this is not the case, make sure to connect with the Store Owner's credentials.
  • 403 (Forbidden) - In the event that you see a 403 error, it is likely that Wordpress has been setup incorrectly. Some tips on how to resolve this issue can be found at the link below:

    https://www.elegantthemes.com/blog/tips-tricks/how-to-fix-403-forbidden-error-in-wordpress

    This error message could also be displayed when a user without access to the site is trying to create Webhooks or Discount Codes. To verify this is not the case, make sure to connect with the Store Owner's credentials.
  • 404 (Not Found) - If you see this error, it is likely that the wrong URL was used to connect to WooCommerce, or the site no longer exists.
  • 520 (Unknown Error) - The 520 error is a catch-all response for when the server returns something unexpected. In the event you see this error after waiting a minute and refreshing the page, please write in to our awesome support team. They would be happy to look into this further for you.
  • 301 (Moved Permanently) - This error is generally displayed when Sumo is using the incorrect protocol for the site (http vs https), when attempting to connect to WooCommerce. If you see this message, feel free to write into our awesome support team. They would be happy to look into this further for you.

Some general notes about our WooCommerce integration:

  • If the error message returned from WooCommerce contains "Consumer key is invalid" (401) then the connection to WooCommerce from Sumo is broken, and you will need to re-connect with WooCommerce.
  • In the event that Sumo is disconnected due to an error, and you are prompted to connect, Discount campaigns will not be deleted. Discount Code campaigns are only deleted when Sumo is manually disconnected and reconnected.
  • Generally, if you are receiving an error besides a 401 error, Discount Code functionality will continue to work properly. It is also possible that multiple 520 errors could indicate a larger issue, such as the site crashing, which would prevent Discount Codes from being created. When you see an error, we recommend refreshing the page to see if the error message is temporary. If the error persists after refreshing, feel free to write in to our rockstar support team.
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.