Giter Club home page Giter Club logo

convertkit-woocommerce's People

Contributors

davidlamarwheeler avatar ggwicz avatar growdev avatar marcboquet avatar n7studios avatar tnorthcutt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

convertkit-woocommerce's Issues

Fix form subscribe

The ckwc_convertkit_api_request() is sending no encoded data which results in a result 400 from the API.

  • Fix json encoding
  • Fix payment parameters

Add a tag based on taxonomy

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 WooCommerce specific headers

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.

  • WC requires at least: 2.6.12
  • WC tested up to: 3.3.0

Settings link

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&section=ckwc

Tags are not being applied when orders created manually

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.

Correct how we deal with names

Currently, this plugin claims to allow sending first name, last name, or both to ConvertKit:
image

However, the ConvertKit API does not support last names (unless explicitly added as a custom field):
image

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

Update accessing order properties

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()

Allow subscribing customers to more than one thing

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.

Global settings:
image

Per-product settings:
image

@dylanfeltus interested in your input here

Checkout opt-in box behavior is unintuitive

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.

Log information when API failures occur

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.

Code review

  • Remove unused functions
  • Check formatting
  • Fix misspellings
  • Add PHP Doc
  • Remove old VS doc style

Product's pid is never the same for the same product

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:

screen shot 2018-09-28 at 10 21 08

Add error handler

In ckwc_convertkit_api_request() if the $response is not WP_Error, but has some other error the body will be empty, but the response will have info in it.

Check $response['response']['code'] and $response['response']['message'] and save the values to the log and/or the Order notes.

integration php 2018-07-31 15-51-19

Fix for purchase_id

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.

Opt-in is removed if the order status is changed manually

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.

Add method for syncing past purchases

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

  • Add a meta to orders that it has been sent to ConvertKit
  • Add query to show how many orders total, how many orders have not been synced
  • Add button and progress bar on settings page to initiate the sync
  • Batch process so that it doesn't stress the server

ref: https://secure.helpscout.net/conversation/632857908/255169?folderId=956509

PHP Error Notices

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();

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.