Skip to content

Commit d9251a5

Browse files
committed
1.5.9
1 parent b74541c commit d9251a5

4 files changed

Lines changed: 95 additions & 41 deletions

File tree

ACTIONS-FILTERS.md

Lines changed: 61 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
<td>&nbsp;</td>
1919
<td><a href="#convertkit_for_woocommerce_order_maybe_subscribe_customer_resource_id"><code>convertkit_for_woocommerce_order_maybe_subscribe_customer_resource_id</code></a></td>
2020
<td>Define the Form, Tag or Sequence ID to subscribe the Customer to for the given Product.</td>
21+
</tr><tr>
22+
<td>&nbsp;</td>
23+
<td><a href="#convertkit_for_woocommerce_order_maybe_subscribe_customer_resource_id_coupon"><code>convertkit_for_woocommerce_order_maybe_subscribe_customer_resource_id_coupon</code></a></td>
24+
<td>Define the Form, Tag or Sequence ID to subscribe the Customer to for the given Coupon.</td>
2125
</tr><tr>
2226
<td>&nbsp;</td>
2327
<td><a href="#convertkit_for_woocommerce_order_maybe_subscribe_customer_subscriptions"><code>convertkit_for_woocommerce_order_maybe_subscribe_customer_subscriptions</code></a></td>
@@ -81,7 +85,7 @@ add_filter( 'convertkit_for_woocommerce_checkout_add_opt_in_checkbox', function(
8185
</pre>
8286
<h3 id="convertkit_for_woocommerce_order_maybe_subscribe_customer_resource_id">
8387
convertkit_for_woocommerce_order_maybe_subscribe_customer_resource_id
84-
<code>includes/class-ckwc-order.php::141</code>
88+
<code>includes/class-ckwc-order.php::146</code>
8589
</h3><h4>Overview</h4>
8690
<p>Define the Form, Tag or Sequence ID to subscribe the Customer to for the given Product.</p><h4>Parameters</h4>
8791
<table>
@@ -104,19 +108,62 @@ add_filter( 'convertkit_for_woocommerce_checkout_add_opt_in_checkbox', function(
104108
<td>Order's</td>
105109
<td>string $status_new</td>
106110
<td>New</td>
111+
</tr><tr>
112+
<td>$product_id</td>
113+
<td>int</td>
114+
<td>Product ID.</td>
107115
</tr>
108116
</tbody>
109117
</table><h4>Usage</h4>
110118
<pre>
111-
add_filter( 'convertkit_for_woocommerce_order_maybe_subscribe_customer_resource_id', function( $resource_id, $order_id, $status_old, $status_new ) {
119+
add_filter( 'convertkit_for_woocommerce_order_maybe_subscribe_customer_resource_id', function( $resource_id, $order_id, $status_old, $status_new, $item['product_id'] ) {
112120
// ... your code here
113121
// Return value
114122
return $resource_id;
115-
}, 10, 4 );
123+
}, 10, 5 );
124+
</pre>
125+
<h3 id="convertkit_for_woocommerce_order_maybe_subscribe_customer_resource_id_coupon">
126+
convertkit_for_woocommerce_order_maybe_subscribe_customer_resource_id_coupon
127+
<code>includes/class-ckwc-order.php::176</code>
128+
</h3><h4>Overview</h4>
129+
<p>Define the Form, Tag or Sequence ID to subscribe the Customer to for the given Coupon.</p><h4>Parameters</h4>
130+
<table>
131+
<thead>
132+
<tr>
133+
<th>Parameter</th>
134+
<th>Type</th>
135+
<th>Description</th>
136+
</tr>
137+
</thead>
138+
<tbody><tr>
139+
<td>$resource_id</td>
140+
<td>mixed</td>
141+
<td>Form, Tag or Sequence ID | empty string.</td>
142+
</tr><tr>
143+
<td>$order_id</td>
144+
<td>int</td>
145+
<td>WooCommerce Order ID.</td>
146+
</tr><tr>
147+
<td>Order's</td>
148+
<td>string $status_new</td>
149+
<td>New</td>
150+
</tr><tr>
151+
<td>$coupon_id</td>
152+
<td>int</td>
153+
<td>Coupon ID.</td>
154+
</tr>
155+
</tbody>
156+
</table><h4>Usage</h4>
157+
<pre>
158+
add_filter( 'convertkit_for_woocommerce_order_maybe_subscribe_customer_resource_id_coupon', function( $resource_id, $order_id, $status_old, $status_new, $coupon->get_id( ) {
159+
// ... your code here
160+
// Return value
161+
return $resource_id;
162+
}, 10, 5 );
116163
</pre>
117164
<h3 id="convertkit_for_woocommerce_order_maybe_subscribe_customer_subscriptions">
118165
convertkit_for_woocommerce_order_maybe_subscribe_customer_subscriptions
119-
<code>includes/class-ckwc-order.php::165</code>
166+
<code>includes/class-ckwc-order.php::200</code>
120167
</h3><h4>Overview</h4>
121168
<p>Define the Forms, Tags and/or Sequences to subscribe the Customer to for this Order.</p><h4>Parameters</h4>
122169
<table>
@@ -151,7 +198,7 @@ add_filter( 'convertkit_for_woocommerce_order_maybe_subscribe_customer_subscript
151198
</pre>
152199
<h3 id="convertkit_for_woocommerce_order_send_purchase_data">
153200
convertkit_for_woocommerce_order_send_purchase_data
154-
<code>includes/class-ckwc-order.php::422</code>
201+
<code>includes/class-ckwc-order.php::457</code>
155202
</h3><h4>Overview</h4>
156203
<p>Define the data to send to the ConvertKit API to create a Purchase in ConvertKit https://developers.convertkit.com/#create-a-purchase</p><h4>Parameters</h4>
157204
<table>
@@ -186,7 +233,7 @@ add_filter( 'convertkit_for_woocommerce_order_send_purchase_data', function( $pu
186233
</pre>
187234
<h3 id="convertkit_for_woocommerce_order_should_opt_in_customer">
188235
convertkit_for_woocommerce_order_should_opt_in_customer
189-
<code>includes/class-ckwc-order.php::626</code>
236+
<code>includes/class-ckwc-order.php::661</code>
190237
</h3><h4>Overview</h4>
191238
<p>Determine if the Customer should be opted in to ConvertKit. If the Order already opted in the Customer, this filter will not be fired. If the Order does not permit the Customer be opted in (i.e. they declined at checkout), this filter will not be fired.</p><h4>Parameters</h4>
192239
<table>
@@ -217,7 +264,7 @@ add_filter( 'convertkit_for_woocommerce_order_should_opt_in_customer', function(
217264
</pre>
218265
<h3 id="convertkit_for_woocommerce_email">
219266
convertkit_for_woocommerce_email
220-
<code>includes/class-ckwc-order.php::658</code>
267+
<code>includes/class-ckwc-order.php::693</code>
221268
</h3><h4>Overview</h4>
222269
<p>Returns the customer's email address for the given WooCommerce Order, immediately before it is sent to ConvertKit when subscribing the Customer to a Form, Tag or Sequence.</p><h4>Parameters</h4>
223270
<table>
@@ -248,7 +295,7 @@ add_filter( 'convertkit_for_woocommerce_email', function( $email, $order ) {
248295
</pre>
249296
<h3 id="convertkit_for_woocommerce_order_name">
250297
convertkit_for_woocommerce_order_name
251-
<code>includes/class-ckwc-order.php::713</code>
298+
<code>includes/class-ckwc-order.php::748</code>
252299
</h3><h4>Overview</h4>
253300
<p>Returns the customer's name for the given WooCommerce Order, immediately before it is sent to ConvertKit when subscribing the Customer to a Form, Tag or Sequence.</p><h4>Parameters</h4>
254301
<table>
@@ -279,7 +326,7 @@ add_filter( 'convertkit_for_woocommerce_order_name', function( $name, $order ) {
279326
</pre>
280327
<h3 id="convertkit_for_woocommerce_first_name">
281328
convertkit_for_woocommerce_first_name
282-
<code>includes/class-ckwc-order.php::745</code>
329+
<code>includes/class-ckwc-order.php::780</code>
283330
</h3><h4>Overview</h4>
284331
<p>Returns the customer's first name for the given WooCommerce Order, immediately before it is sent to ConvertKit when subscribing the Customer to a Form, Tag or Sequence.</p><h4>Parameters</h4>
285332
<table>
@@ -310,7 +357,7 @@ add_filter( 'convertkit_for_woocommerce_first_name', function( $first_name, $ord
310357
</pre>
311358
<h3 id="convertkit_for_woocommerce_last_name">
312359
convertkit_for_woocommerce_last_name
313-
<code>includes/class-ckwc-order.php::777</code>
360+
<code>includes/class-ckwc-order.php::812</code>
314361
</h3><h4>Overview</h4>
315362
<p>Returns the customer's last name for the given WooCommerce Order, immediately before it is sent to ConvertKit when subscribing the Customer to a Form, Tag or Sequence.</p><h4>Parameters</h4>
316363
<table>
@@ -341,7 +388,7 @@ add_filter( 'convertkit_for_woocommerce_last_name', function( $last_name, $order
341388
</pre>
342389
<h3 id="convertkit_for_woocommerce_custom_field_data">
343390
convertkit_for_woocommerce_custom_field_data
344-
<code>includes/class-ckwc-order.php::828</code>
391+
<code>includes/class-ckwc-order.php::863</code>
345392
</h3><h4>Overview</h4>
346393
<p>Returns an array of ConvertKit Custom Field Key/Value pairs, with values comprising of Order data based, to be sent to ConvertKit when an Order's Customer is subscribed via a Form, Tag or Sequence. Returns false if no Order data should be stored in ConvertKit Custom Fields.</p><h4>Parameters</h4>
347394
<table>
@@ -396,7 +443,7 @@ add_filter( 'convertkit_for_woocommerce_custom_field_data', function( $fields, $
396443
</tbody>
397444
</table><h3 id="convertkit_for_woocommerce_initialize_admin">
398445
convertkit_for_woocommerce_initialize_admin
399-
<code>includes/class-wp-ckwc.php::113</code>
446+
<code>includes/class-wp-ckwc.php::114</code>
400447
</h3><h4>Parameters</h4>
401448
<table>
402449
<thead>
@@ -416,7 +463,7 @@ do_action( 'convertkit_for_woocommerce_initialize_admin', function( ) {
416463
</pre>
417464
<h3 id="convertkit_for_woocommerce_initialize_frontend">
418465
convertkit_for_woocommerce_initialize_frontend
419-
<code>includes/class-wp-ckwc.php::136</code>
466+
<code>includes/class-wp-ckwc.php::137</code>
420467
</h3><h4>Parameters</h4>
421468
<table>
422469
<thead>
@@ -436,7 +483,7 @@ do_action( 'convertkit_for_woocommerce_initialize_frontend', function( ) {
436483
</pre>
437484
<h3 id="convertkit_for_woocommerce_initialize_global">
438485
convertkit_for_woocommerce_initialize_global
439-
<code>includes/class-wp-ckwc.php::157</code>
486+
<code>includes/class-wp-ckwc.php::158</code>
440487
</h3><h4>Parameters</h4>
441488
<table>
442489
<thead>

languages/woocommerce-convertkit.pot

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@
22
# This file is distributed under the same license as the ConvertKit for WooCommerce plugin.
33
msgid ""
44
msgstr ""
5-
"Project-Id-Version: ConvertKit for WooCommerce 1.5.8\n"
5+
"Project-Id-Version: ConvertKit for WooCommerce 1.5.9\n"
66
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/convertkit-woocommerce\n"
77
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
88
"Language-Team: LANGUAGE <LL@li.org>\n"
99
"MIME-Version: 1.0\n"
1010
"Content-Type: text/plain; charset=UTF-8\n"
1111
"Content-Transfer-Encoding: 8bit\n"
12-
"POT-Creation-Date: 2023-02-14T13:10:06+00:00\n"
12+
"POT-Creation-Date: 2023-02-23T15:59:03+00:00\n"
1313
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1414
"X-Generator: WP-CLI 2.7.1\n"
1515
"X-Domain: woocommerce-convertkit\n"
1616

1717
#. Plugin Name of the plugin
18-
#: views/backend/product/bulk-edit.php:11
19-
#: views/backend/product/quick-edit.php:11
18+
#: views/backend/post-type/bulk-edit.php:11
19+
#: views/backend/post-type/quick-edit.php:11
2020
msgid "ConvertKit for WooCommerce"
2121
msgstr ""
2222

@@ -52,7 +52,7 @@ msgstr ""
5252
msgid "Settings"
5353
msgstr ""
5454

55-
#: admin/class-ckwc-admin-product.php:89
55+
#: admin/class-ckwc-admin-post-type.php:100
5656
msgid "ConvertKit Integration"
5757
msgstr ""
5858

@@ -436,80 +436,84 @@ msgid "Your ConvertKit API Key appears to be invalid. Please double check the va
436436
msgstr ""
437437

438438
#. translators: Resource Type
439-
#: includes/class-ckwc-order.php:232
439+
#: includes/class-ckwc-order.php:267
440440
msgid "Resource type %s is not supported in CKWC_Order::subscribe_customer()"
441441
msgstr ""
442442

443443
#. translators: %1$s: Form Name, %2$s: Form ID
444-
#: includes/class-ckwc-order.php:265
444+
#: includes/class-ckwc-order.php:300
445445
msgid "[ConvertKit] Customer subscribed to the Form: %1$s [%2$s]"
446446
msgstr ""
447447

448448
#. translators: %1$s: Tag Name, %2$s: Tag ID
449-
#: includes/class-ckwc-order.php:282
449+
#: includes/class-ckwc-order.php:317
450450
msgid "[ConvertKit] Customer subscribed to the Tag: %1$s [%2$s]"
451451
msgstr ""
452452

453453
#. translators: %1$s: Sequence Name, %2$s: Sequence ID
454-
#: includes/class-ckwc-order.php:300
454+
#: includes/class-ckwc-order.php:335
455455
msgid "[ConvertKit] Customer subscribed to the Sequence: %1$s [%2$s]"
456456
msgstr ""
457457

458458
#. translators: WooCommerce Order ID
459-
#: includes/class-ckwc-order.php:344
459+
#: includes/class-ckwc-order.php:379
460460
msgid "Order ID %s could not be found in WooCommerce."
461461
msgstr ""
462462

463463
#. translators: WooCommerce Order ID
464-
#: includes/class-ckwc-order.php:358
464+
#: includes/class-ckwc-order.php:393
465465
msgid "Order ID %s has already been sent to ConvertKit."
466466
msgstr ""
467467

468-
#: includes/class-ckwc-order.php:389
468+
#: includes/class-ckwc-order.php:424
469469
msgid "[ConvertKit] Purchase Data skipped, as this Order has no Products"
470470
msgstr ""
471471

472472
#. translators: %1$s: Error Code, %2$s: Error Message
473-
#: includes/class-ckwc-order.php:440
473+
#: includes/class-ckwc-order.php:475
474474
msgid "[ConvertKit] Send Purchase Data Error: %1$s %2$s"
475475
msgstr ""
476476

477-
#: includes/class-ckwc-order.php:453
477+
#: includes/class-ckwc-order.php:488
478478
msgid "[ConvertKit] Purchase Data sent successfully"
479479
msgstr ""
480480

481481
#. translators: %1$s: PHP class name
482-
#: includes/class-wp-ckwc.php:191
482+
#: includes/class-wp-ckwc.php:192
483483
msgid "ConvertKit for WooCommerce Error: Could not load Plugin class <strong>%1$s</strong>"
484484
msgstr ""
485485

486-
#: includes/class-wp-ckwc.php:201
486+
#: includes/class-wp-ckwc.php:202
487487
msgid "ConvertKit for WooCommerce Error"
488488
msgstr ""
489489

490490
#: views/backend/custom-field-dropdown-field.php:13
491491
msgid "(Don't send or map)"
492492
msgstr ""
493493

494-
#: views/backend/product/bulk-edit.php:18
495-
#: views/backend/product/meta-box.php:16
496-
#: views/backend/product/quick-edit.php:18
494+
#: views/backend/post-type/bulk-edit.php:18
495+
#: views/backend/post-type/meta-box.php:16
496+
#: views/backend/post-type/quick-edit.php:18
497497
msgid "Refresh sequences, forms and tags from ConvertKit account"
498498
msgstr ""
499499

500500
#. translators: %1$s: Post Type Singular Name, %2$s: Link to Integration Settings
501-
#: views/backend/product/disabled.php:15
502-
msgid "To configure the ConvertKit form, tag or sequence to subscribe customers to who purchase this %1$s, %2$s and enter a valid API Key and API Secret."
501+
#: views/backend/post-type/disabled.php:15
502+
msgid "To configure the ConvertKit form, tag or sequence to subscribe customers to who use this %1$s, %2$s and enter a valid API Key and API Secret."
503503
msgstr ""
504504

505-
#: views/backend/product/disabled.php:17
505+
#: views/backend/post-type/disabled.php:17
506506
msgid "enable the ConvertKit WooCommerce integration"
507507
msgstr ""
508508

509-
#: views/backend/product/meta-box.php:22
509+
#: views/backend/post-type/meta-box.php:25
510510
msgid "The ConvertKit form, tag or sequence to subscribe customers to who purchase this product."
511511
msgstr ""
512512

513+
#: views/backend/post-type/meta-box.php:28
514+
msgid "The ConvertKit form, tag or sequence to subscribe customers to who use this coupon."
515+
msgstr ""
516+
513517
#. translators: Plugin Name
514518
#: views/backend/review/notice.php:17
515519
msgid "We'd be super grateful if you could spread the word about %s and give it a 5 star rating on WordPress?"

readme.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Tags: email, marketing, embed form, convertkit, capture, woocommerce
55
Requires at least: 5.0
66
Tested up to: 6.1.1
77
Requires PHP: 5.6.20
8-
Stable tag: 1.5.8
8+
Stable tag: 1.5.9
99
License: GPLv2 or later
1010
License URI: http://www.gnu.org/licenses/gpl-2.0.html
1111

@@ -46,6 +46,9 @@ No. You must first have an account on ConvertKit.com, but you do not have to use
4646

4747
== Changelog ==
4848

49+
### 1.5.9 2023-02-23
50+
* Added: WooCommerce Coupons: Option to specify Form, Tag or Sequence to subscribe customer to if a specific coupon is applied at checkout
51+
4952
### 1.5.8 2023-02-14
5053
* Fix: WooCommerce Products: Refresh Sequences, Forms and Tags when refresh button clicked
5154

woocommerce-convertkit.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
* Plugin Name: ConvertKit for WooCommerce
1010
* Plugin URI: https://www.convertkit.com
1111
* Description: Integrates WooCommerce with ConvertKit, allowing customers to be automatically sent to your ConvertKit account.
12-
* Version: 1.5.8
12+
* Version: 1.5.9
1313
* Author: ConvertKit
1414
* Author URI: https://www.convertkit.com
1515
* Text Domain: woocommerce-convertkit
1616
*
1717
* WC requires at least: 3.0
18-
* WC tested up to: 7.3.0
18+
* WC tested up to: 7.4.0
1919
*/
2020

2121
// Bail if Plugin is already loaded.
@@ -28,7 +28,7 @@
2828
define( 'CKWC_PLUGIN_FILE', plugin_basename( __FILE__ ) );
2929
define( 'CKWC_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
3030
define( 'CKWC_PLUGIN_PATH', __DIR__ );
31-
define( 'CKWC_PLUGIN_VERSION', '1.5.8' );
31+
define( 'CKWC_PLUGIN_VERSION', '1.5.9' );
3232

3333
// Load shared classes, if they have not been included by another ConvertKit Plugin.
3434
if ( ! class_exists( 'ConvertKit_API' ) ) {

0 commit comments

Comments
 (0)