convertkit / convertkit-woocommerce Goto Github PK
View Code? Open in Web Editor NEWConvertKit Integration with WooCommerce
License: GNU General Public License v3.0
ConvertKit Integration with WooCommerce
License: GNU General Public License v3.0
Customer request: https://app.intercom.io/a/apps/e4n3xtxz/inbox/inbox/2911962/conversations/21216804933
Would allow for subscribing customers to ConvertKit when a WooCommerce order has the status "On-Hold".
The ckwc_convertkit_api_request()
is sending no encoded data which results in a result 400 from the API.
Add option to send billing_last_name
as part of the fields array.
Ref: https://secure.helpscout.net/conversation/602032206/232230?folderId=956509
Usecase
billing_email
and first_name
with the product's tag.Add a setting for store owner to choose a tag to add to customers who purchase a product from a specific category. For example:
Category | Tag assigned |
---|---|
Clothing | bought-clothing |
Food | bought-food |
Add these lines to the plugin file and update with the correct versions. WooCommerce checks these settings to notify the customer which plugins do and do not work with the version of WooCommerce they are using.
The settings link on the Plugins page links here:
/wp-admin/admin.php?page=wc-settings&tab=integration
But if another plugin (WooCommerce Google Analytics Integration ) is installed that uses the page at a higher priority then CK settings are not shown without clicking the tab.
Change the link to include "section"
/wp-admin/admin.php?page=wc-settings&tab=integration§ion=ckwc
Change Convert Kit to ConvertKit
Per http://developers.convertkit.com/#create-a-purchase
Add purchase.integration
and integration_key
to API requests.
When orders are created from the WordPress dashboard customers are not being tagged.
Reason: CKWC_Integration::order_status()
is checking for $opt_in_correct
, but this meta is not defined.
During normal checkout CKWC_Integration::add_opt_in_checkbox()
fires and sets the meta. That method is hooked in using woocommerce_checkout_update_order_meta
, but the action is only fired from within WC_Checkout
when using the front-end checkout.
Fix: CKWC_Integration::add_opt_in_checkbox()
needs to be hooked into the manual order creation process.
Currently, this plugin claims to allow sending first name, last name, or both to ConvertKit:
However, the ConvertKit API does not support last names (unless explicitly added as a custom field):
Regardless, the way the plugin is attempting to send first + last name (when that option is selected) is to concatenate them and send them as a name
parameter with the API request, which is legacy behavior.
At a bare minimum, we need to remove the option to send both first and last name. We could additionally support sending last name as a custom field. However, according to the API documentation that field has to be defined in the ConvertKit app before it will accept data, which makes that a potential UX hurdle.
Related support ticket:
https://app.intercom.io/a/apps/e4n3xtxz/inbox/inbox/conversation/20565468215
Related to ConvertKit/convertkit-wordpress#164, a user should be able to fetch a fresh list of forms/tags/sequences from ConvertKit so that if they add a new form/tag/sequence in their account, they can refresh the list from this screen instead of having to go to the main ConvertKit plugin settings screen.
Accessing order properties directly in WooCommerce 3.0 is no longer allowed and WC spews warnings.
Change occurrences of this:
$order->billing_email
to this:
$order->get_billing_email()
To ensure backwards compatibility with WC 2.6 will need to add a check with version_compare()
Almost all strings output by the plugin currently lack an accompanying textdomain.
@gammons Please add this repo to the CircleCi. Thanks!
Currently, our integration settings allow subscribing a purchaser to a single Sequence, Form, or Tag. This is somewhat limiting; store owners may want to subscriber customers to e.g. a tag and a sequence. Of course this can be done with an automation inside of ConvertKit, but it's worth considering if we should add the ability here.
@dylanfeltus interested in your input here
Research if there are any events to hook CK API actions into the workflow of Memberships/Subscriptions.
Check on adding tags for orders created via the WP dashboard.
ref: https://secure.helpscout.net/conversation/483234785/144776?folderId=956509
and
https://wordpress.org/support/topic/tag-customers-from-woocommerce-manual-orders/
Add filter for other plugins to manage what is sent to CK for subscription. Use case is a membership site with separate form for student.
ref: https://secure.helpscout.net/conversation/567356699/207036?folderId=956509
Pasting notes from a recent ticket:
https://app.intercom.io/a/apps/e4n3xtxz/inbox/inbox/3066130/conversations/23609512049
My guess is that the customer didn't check the opt-in box at checkout. That option is turned on in the ConvertKit WooCommerce addon settings.
For what it's worth, I really don't like how the plugin works with this setting; I think it's confusing and unintuitive. Unfortunately, changing it could result in unintended consequences for existing sites, so I've been hesitant to do so.
Right now, if that option is turned on, then things like tag/form/sequence subscriptions will only happen if the buyer checks the opt-in box at checkout.
BUT, purchase data is always sent, regardless of if the buyer checks that box. As a result, buyers get added to the ConvertKit email list even if they haven't checked the box.
We don't currently have good logging for when subscribing & sending purchase data to ConvertKit doesn't happen (for whatever reason). Need to add more logging for failure cases.
Test with WC 3.0.
Issue
A customer had a curl timeout when the order was placed:
Currently there isn't a way to re-send payment data.
Fix
ref: https://secure.helpscout.net/conversation/690338672/287269?folderId=956509
Adding a logging option will help with troubleshooting installs on customers sites.
We can use the WC_Logging class so the log files are accessible via the WordPress dashboard.
Scenario:
ref: https://secure.helpscout.net/conversation/605326371/234426?folderId=956509
We have a couple customers writing in saying that each purchase creates a new product on ConvertKit. Looking at the logs, it seems like the WooCommerce plugin always increment the id of a product. My gut feeling is that everytime a purchase comes in, a new product is created and then that new product is used to send the API request to us.
For the same product, we should receive the same pid
. Here's a screenshot of the log we receive from the same plugin/user/account:
To help store administrators know when a customer is tagged based on purchasing a product, include an order note for the event.
Purchases are being sent to the CK API using the Cart Item ID instead of the Product ID. This is causing each product to be unique on the CK side.
CKWC_Integration::save_opt_in_checkbox()
will correctly save the meta value for ckwc_opt_in at checkout, but if the order goes to Processing then the administrator changes it to any other status the value is set to "no".
If the Subscribe Event is set to Completed the customer will not be tagged/subscribed correctly.
Notes
Customers installing the latest version of the plugin that implements the purchases endpoint want the ability to sync orders place in WooCommerce prior to enabling the ConvertKit plugin.
Tasks
ref: https://secure.helpscout.net/conversation/632857908/255169?folderId=956509
https://app.intercom.io/a/apps/e4n3xtxz/inbox/inbox/conversation/20788961962
Sometimes a tag is not applied even when a product is purchased. It looks like this may be only happening when multiple products are purchased in an order; not sure yet.
Need to add better logging to isolate when this occurs.
Add form/tag/course to the Product Variation level.
ref: https://secure.helpscout.net/conversation/359163751/79635/?folderId=936326#
When someone subscribes from Checkout page, create a unique coupon for them and send in the New Order email.
ref: https://www.facebook.com/groups/woohelp/permalink/2059925707567207/
CKWC is throwing up some PHP errors - please fix them as soon as possible:
[09-May-2019 08:30:37 UTC] PHP Notice: billing_first_name was called <strong>incorrectly</strong>. Order properties should not be accessed directly. Backtrace: require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('wp_loaded'), WP_Hook->do_action, WP_Hook->apply_filters, WC_Form_Handler::checkout_action, WC_Checkout->process_checkout, WC_Checkout->process_order_without_payment, WC_Order->payment_complete, WC_Order->save, WC_Order->status_transition, do_action('woocommerce_order_status_changed'), WP_Hook->do_action, WP_Hook->apply_filters, CKWC_Integration->order_status, WC_Abstract_Legacy_Order->__get, wc_doing_it_wrong Please see <a href="https://codex.wordpress.org/Debugging_in_WordPress">Debugging in WordPress</a> for more information. (This message was added in version 3.0.) in /home/...../public_html/wp-includes/functions.php on line 4667
[09-May-2019 08:30:37 UTC] PHP Notice: billing_last_name was called <strong>incorrectly</strong>. Order properties should not be accessed directly. Backtrace: require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('wp_loaded'), WP_Hook->do_action, WP_Hook->apply_filters, WC_Form_Handler::checkout_action, WC_Checkout->process_checkout, WC_Checkout->process_order_without_payment, WC_Order->payment_complete, WC_Order->save, WC_Order->status_transition, do_action('woocommerce_order_status_changed'), WP_Hook->do_action, WP_Hook->apply_filters, CKWC_Integration->order_status, WC_Abstract_Legacy_Order->__get, wc_doing_it_wrong Please see <a href="https://codex.wordpress.org/Debugging_in_WordPress">Debugging in WordPress</a> for more information. (This message was added in version 3.0.) in /home/......./public_html/wp-includes/functions.php on line 4667
[09-May-2019 08:30:37 UTC] PHP Notice: billing_email was called <strong>incorrectly</strong>. Order properties should not be accessed directly. Backtrace: require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('wp_loaded'), WP_Hook->do_action, WP_Hook->apply_filters, WC_Form_Handler::checkout_action, WC_Checkout->process_checkout, WC_Checkout->process_order_without_payment, WC_Order->payment_complete, WC_Order->save, WC_Order->status_transition, do_action('woocommerce_order_status_changed'), WP_Hook->do_action, WP_Hook->apply_filters, CKWC_Integration->order_status, WC_Abstract_Legacy_Order->__get, wc_doing_it_wrong Please see <a href="https://codex.wordpress.org/Debugging_in_WordPress">Debugging in WordPress</a> for more information. (This message was added in version 3.0.) in /home/....../public_html/wp-includes/functions.php on line 4667
You probably need to use these:
$order->get_billing_first_name();
$order->get_billing_last_name();
$order->get_billing_email();
Customer reporting that subscribers are added when PayPal is
Reproduce:
ref: https://secure.helpscout.net/conversation/290601994/40831/
Right now, our WooCommerce add-on lets a user choose one "order status" to trigger sending info to ConvertKit.
This feature would provide two separate settings for the order status to initiate the trigger; one for physical products, and one for virtual products.
Related ticket: https://app.intercom.io/a/apps/e4n3xtxz/inbox/inbox/conversation/23152207352
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.