开发者 |
scott.deluzio
ampmode |
---|---|
更新时间 | 2023年4月4日 21:22 |
捐献地址: | 去捐款 |
PHP版本: | 2.9 及以上 |
WordPress版本: | 6.1.1 |
版权: | GNU v2+ |
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.
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.
This plugin requires that you have WooCommerce installed, and that you have a MailChimp or ActiveCampaign account.
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.
You can find the technical details on how to create a webhook through MailChimp by clicking here. General steps:
You can find the technical details on how to create a webhook through ActiveCampaign by clicking here. General steps:
exclude_sale
was used instead of the correct exclude_sale_items