Title: Subscriber Discounts for WooCommerce
Author: AMP-MODE
Published: <strong>2017 年 2 月 7 日</strong>
Last modified: 2023 年 4 月 4 日

---

搜尋外掛

![](https://ps.w.org/subscriber-discounts-for-woocommerce/assets/banner-772x250.
png?rev=1695892)

這個外掛**並未在最新的 3 個 WordPress 主要版本上進行測試**。開發者可能不再對這個
外掛進行維護或提供技術支援，並可能會與更新版本的 WordPress 產生使用上的相容性問題。

![](https://ps.w.org/subscriber-discounts-for-woocommerce/assets/icon-256x256.png?
rev=1695892)

# Subscriber Discounts for WooCommerce

 由 [AMP-MODE](https://profiles.wordpress.org/ampmode/) 開發

[下載](https://downloads.wordpress.org/plugin/subscriber-discounts-for-woocommerce.1.5.2.zip)

 * [詳細資料](https://tw.wordpress.org/plugins/subscriber-discounts-for-woocommerce/#description)
 * [使用者評論](https://tw.wordpress.org/plugins/subscriber-discounts-for-woocommerce/#reviews)
 *  [安裝方式](https://tw.wordpress.org/plugins/subscriber-discounts-for-woocommerce/#installation)
 * [開發資訊](https://tw.wordpress.org/plugins/subscriber-discounts-for-woocommerce/#developers)

 [技術支援](https://wordpress.org/support/plugin/subscriber-discounts-for-woocommerce/)

## 外掛說明

Your WooCommerce shop’s success may depend on growing your email mailing list. Many
customers won’t volunteer their email address without some sort of incentive. Offering
your subscribers a discount in your shop is a great way to get them to provide you
with their email address.

Subscriber Discounts for WooCommerce will create a unique discount code automatically
for your subscribers every time someone joins your MailChimp or ActiveCampaign mailing
list.

Everyone loves a discount – even a 10-15% discount could be the difference between
making the sale and losing a customer forever.

**Features**

 * Set the discount amount as either a percentage or a flat rate (i.e. 10% or $5).
 * Set the number of times a discount code can be used, and whether or not the code
   can only be used once per customer.
 * Customize the email message that is sent to your subscribers.
 * Use HTML markup in your message to fine tune the formatting.

## 安裝方式

 1. Download archive and unzip in wp-content/plugins or install via Plugins – Add New.
 2. Activate the plugin through the Plugins menu in WordPress.

## 常見問題集

### Can I customize the discount code that is generated by this plugin?

By default, the plugin will generate a random discount code, which will look something
like this _aebggfcgde_. If you do nothing else, the code returned will be random
like this.

The filter `sdwoo_discount_code` has been added to the plugin so that you can customize
the discount code that is generated.

You can use this filter to customize the discount code however you want. The discount
code that this plugin generates is the value that is passed to the filter. The filter
also passes the subscriber’s email address, which can be used in the discount code.

Here is an example of how the filter would be used. You would need to put this in
your theme’s functions.php file or in a [custom plugin](https://scottdeluzio.com/intro-wordpress-plugin-development/).

    ```
    function example_custom_discount_code( $discount, $email_address ){
        // Add your company name as a prefix to the discount code:
        $new_code = 'MyCompanyName' . $discount;
        return $new_code;
    }
    add_filter( 'sdwoo_discount_code', 'example_custom_discount_code', 10, 2 );
    ```

If using this filter, please be careful that it does not return the same discount
code for each customer.

### Are there any dependencies to use this plugin?

This plugin requires that you have WooCommerce installed, and that you have a MailChimp
or ActiveCampaign account.

### How do I use this plugin?

The plugin’s settings menu is found under WooCommerce > Subscriber Discounts. You
will need to fill out most fields in order for the plugin to work correctly.

 * MailChimp Key: This is a random string of letters and numbers that you need to
   enter in order to create a webhook in MailChimp. You can type anything you want
   here – it doesn’t have to make sense. Something like e6uyUjSzNt9XTU51M1r5 is 
   perfect. If this field is not filled in, your MailChimp subscribers won’t receive
   a discount code. If you are not using MailChimp, leave this blank.
 * ActiveCampaign Key: This is a random string of letters and numbers that you need
   to enter in order to create a webhook in ActiveCampaign. You can type anything
   you want here – it doesn’t have to make sense. Something like e6uyUjSzNt9XTU51M1r5
   is perfect. If this field is not filled in, your ActiveCampaign subscribers won’t
   receive a discount code. If you are not using ActiveCampaign, leave this blank.
 * Discount Name: Enter a label to identify discount codes in WooCommerce as having
   been generated by this plugin. For example, enter “Email subscriber discount”.
   Regardless of what you enter here the subscriber’s email address will be added
   to the end of the discount name.
 * Discount Amount: Enter how much the discount should be for. Do not enter any 
   symbols like $ or % just the number (i.e. 20)
 * Discount Type: Enter the type of discount you are offering – either a percentage
   or a flat rate.
 * Use once per customer: If the discount should expire after it has been used check
   this box.
 * Max Uses: If you want to make the discount available to customers to use multiple
   times enter how many times here.
 * Email Subject: This is the subject line used in the email sent to your subscribers.
   Something like “Thanks for subscribing to Acme Co. Newsletter” would work.
 * From Email Address: Enter the address the discount code should be sent from. 
   If you have a customer support or sales address, this would be a good email to
   enter. Try to make it an @yourdomain.com address, as some recipients may have
   trouble receiving from a GMail, Hotmail, Yahoo, etc. address.
 * From Display Name: Enter your name or the company name that the email should 
   come from.
 * Customer Placeholder Name: Enter a generic greeting name if you are using the{
   firstname} placeholder tag provided. This will allow you to have a greeting to
   the customer if they do not enter a name in their signup.
 * Message: Enter the message your customers should receive in the email. Be sure
   to include the {code} placeholder tag, otherwise they will not receive the discount
   code.

### How do I set up webhooks in MailChimp?

You can find the technical details on how to create a webhook through MailChimp 
by [clicking here](http://kb.mailchimp.com/integrations/api-integrations/how-to-set-up-webhooks).

General steps:

 * Click Audience tab > All Contacts
 * Click Settings > Webhooks
 * Click create new webhook button
 * Paste your callback URL
 * Under “What type of updates should we send” check only Subscribes (uncheck all
   other boxes)
 * Under “Only send updates when a change is made…” keep all checked unless you 
   only want to send a discount to a certain type of change.
 * Save

Your webhook callback URL should be http://yourdomain.com/?trigger-special-discount
=true&discount-key=xxxxxxxxxxxx

Replace yourdomain.com with your actual website domain, and replace xxxxxxxxxxxx
with the MailChimp Key entered in the plugin settings.

### How do I set up webhooks in ActiveCampaign?

You can find the technical details on how to create a webhook through ActiveCampaign
by [clicking here](http://www.activecampaign.com/api/webhooks.php).

General steps:

 * Click Automations tab
 * Click New Automation button
 * Click Start From Scratch
 * Click Subscribes
 * Select your list or leave as any list
 * Add Webhook as an action (paste your webhook URL)
 * Add End this automation as an action

Your webhook callback URL should be http://yourdomain.com/?trigger-special-discount
=true&discount-key=xxxxxxxxxxxx

Replace yourdomain.com with your actual website domain, and replace xxxxxxxxxxxx
with the ActiveCampaign Key entered in the plugin settings.

## 使用者評論

![](https://secure.gravatar.com/avatar/ab440b581f6ee9c420305c1768547f14d586e1a505c264fe5a733f9a588eeeb3?
s=60&d=retro&r=g)

### 󠀁[Works great](https://wordpress.org/support/topic/works-great-8036/)󠁿

 [dpbatlle](https://profiles.wordpress.org/dpbatlle/) 2021 年 12 月 22 日 1 則留言

Great plugin and enough documentation.

![](https://secure.gravatar.com/avatar/a21288ba4a1ab959b7676b5c1d5f843e5f6ee575ddd900c6834172202b5dee12?
s=60&d=retro&r=g)

### 󠀁[Work great](https://wordpress.org/support/topic/work-great-128/)󠁿

 [drigis3](https://profiles.wordpress.org/drigis3/) 2020 年 10 月 14 日 1 則留言

Plugin work great. Support good.

![](https://secure.gravatar.com/avatar/3c883fc37a3ceb986b6a796d35edb47a0e5215715eb638650ac52c99d61c2044?
s=60&d=retro&r=g)

### 󠀁[Works perfectly](https://wordpress.org/support/topic/works-perfectly-1714/)󠁿

 [faolie](https://profiles.wordpress.org/faolie/) 2019 年 7 月 29 日

Excellent setup instructions. Worked first time.

![](https://secure.gravatar.com/avatar/b830c2c99ef49d6fbc5fa6c1ba37bfbff7363c070996c0d9fae6e96b0366ebf0?
s=60&d=retro&r=g)

### 󠀁[Doesn’t work](https://wordpress.org/support/topic/doesnt-work-2052/)󠁿

 [mourogers](https://profiles.wordpress.org/mourogers/) 2018 年 12 月 14 日 1 則
留言

Followed directions, no luck. No emails sent.

![](https://secure.gravatar.com/avatar/6e880cd0e530bb7477cb57af5d6e1b1d45bbeb7ba03a39884bcf741a83395f05?
s=60&d=retro&r=g)

### 󠀁[Works like a charm](https://wordpress.org/support/topic/works-like-a-charm-1344/)󠁿

 [peaksmedia](https://profiles.wordpress.org/peaksmedia/) 2018 年 10 月 24 日

Works well .. don't have it live on my site yet, would be even more powerful if 
the emails could be a nice design. Thank you.

![](https://secure.gravatar.com/avatar/5f7bddab5f424765d5d995ac81759505af9dd4e57a13e04bece9677f84cc7fc0?
s=60&d=retro&r=g)

### 󠀁[Works wondefully](https://wordpress.org/support/topic/works-wondefully/)󠁿

 [Bage](https://profiles.wordpress.org/bagerathan/) 2018 年 6 月 10 日

It works perfectly. It would be even better if we have the option to create multiple
discounts with multiple webhooks.

 [ 閱讀全部 9 則使用者評論 ](https://wordpress.org/support/plugin/subscriber-discounts-for-woocommerce/reviews/)

## 參與者及開發者

以下人員參與了開源軟體〈Subscriber Discounts for WooCommerce〉的開發相關工作。

參與者

 *   [ AMP-MODE ](https://profiles.wordpress.org/ampmode/)
 *   [ Scott DeLuzio ](https://profiles.wordpress.org/scottdeluzio/)

[將〈Subscriber Discounts for WooCommerce〉外掛本地化為台灣繁體中文版](https://translate.wordpress.org/projects/wp-plugins/subscriber-discounts-for-woocommerce)

### 對開發相關資訊感興趣？

任何人均可[瀏覽程式碼](https://plugins.trac.wordpress.org/browser/subscriber-discounts-for-woocommerce/)、
查看 [SVN 存放庫](https://plugins.svn.wordpress.org/subscriber-discounts-for-woocommerce/)，
或透過 [RSS](https://plugins.trac.wordpress.org/log/subscriber-discounts-for-woocommerce/?limit=100&mode=stop_on_copy&format=rss)
訂閱[開發記錄](https://plugins.trac.wordpress.org/log/subscriber-discounts-for-woocommerce/)。

## 變更記錄

#### 1.5.2

 * Updated tested up to version.
 * Added Contributors.

#### 1.5.1

 * Fix: Removed testing code accidentally left in plugin, which creates new discount
   codes for testing purposes.

#### 1.5.0

 * New: Included ability to set an expiration date for the coupon code based on 
   the number of days since the coupon code creation.

#### 1.4.0

 * New: Included ability to apply coupon to specific products or product categories,
   and exclude the coupon from use with specific products or product categories.

#### 1.3.2

 * Updated WooCommerce and WordPress tested up to version.

#### 1.3.1

 * Updated WooCommerce tested up to version.

#### 1.3.0

 * New: Included filter for modifying discount code parameters. Filter sdwoo_discount_args
   gets passed the $discount_args array, which can be added to, or otherwise modified.

#### 1.2.0

 * New: Included filter for customizing the generated discount code. Filter sdwoo_discount_code
   gets passed the plugin generated discount code as well as the user’s email address.

#### 1.1.5

 * Fix: Typo in exclude sale items in create-discount.php

#### 1.1.4

 * Fix: Incorrect meta key used for excluding sale items. `exclude_sale` was used
   instead of the correct `exclude_sale_items`

#### 1.1.3

 * Added option to exclude sale items from coupon usage.

#### 1.1.2

 * Updated POT language file for translations

#### 1.1.1

 * Updated SDWOO_Create_Discount class to allow for plugin developers to extend 
   this class and integrate with other email services.

#### 1.0.0

 * Initial version

## 中繼資料

 *  版本 **1.5.2**
 *  最後更新 **4 年前**
 *  啟用安裝數 **200+**
 *  WordPress 版本需求 ** 2.9 或更新版本 **
 *  已測試相容的 WordPress 版本 **6.1.16**
 *  語言
 * [English (US)](https://wordpress.org/plugins/subscriber-discounts-for-woocommerce/)
 * 標籤:
 * [activecampaign](https://tw.wordpress.org/plugins/tags/activecampaign/)[discounts](https://tw.wordpress.org/plugins/tags/discounts/)
   [mailchimp](https://tw.wordpress.org/plugins/tags/mailchimp/)[woocommerce](https://tw.wordpress.org/plugins/tags/woocommerce/)
 *  [進階檢視](https://tw.wordpress.org/plugins/subscriber-discounts-for-woocommerce/advanced/)

## 評分

 4.1 星，滿分為 5 星

 *  [  7 個 5 星使用者評論     ](https://wordpress.org/support/plugin/subscriber-discounts-for-woocommerce/reviews/?filter=5)
 *  [  0 個 4 星使用者評論     ](https://wordpress.org/support/plugin/subscriber-discounts-for-woocommerce/reviews/?filter=4)
 *  [  0 個 3 星使用者評論     ](https://wordpress.org/support/plugin/subscriber-discounts-for-woocommerce/reviews/?filter=3)
 *  [  0 個 2 星使用者評論     ](https://wordpress.org/support/plugin/subscriber-discounts-for-woocommerce/reviews/?filter=2)
 *  [  2 個 1 星使用者評論     ](https://wordpress.org/support/plugin/subscriber-discounts-for-woocommerce/reviews/?filter=1)

[撰寫評分](https://wordpress.org/support/plugin/subscriber-discounts-for-woocommerce/reviews/#new-post)

[查看全部使用者評論](https://wordpress.org/support/plugin/subscriber-discounts-for-woocommerce/reviews/)

## 參與者

 *   [ AMP-MODE ](https://profiles.wordpress.org/ampmode/)
 *   [ Scott DeLuzio ](https://profiles.wordpress.org/scottdeluzio/)

## 技術支援

使用者可在技術支援論壇提出意見反應或使用問題。

 [檢視技術支援論壇](https://wordpress.org/support/plugin/subscriber-discounts-for-woocommerce/)

## 贊助

想要支援這個外掛的發展嗎？

 [ 贊助這個外掛 ](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=FG5QVYUDG6YUA)