New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Event support for Subscription Order Statuses #1

Closed
raamdev opened this Issue Aug 24, 2016 · 17 comments

Comments

Projects
None yet
3 participants
@raamdev
Copy link
Contributor

raamdev commented Aug 24, 2016

@jaswsinc writes...

If the shop owner is also running the WooCommerce Subscriptions extension, then you have 'Subscriptions' statuses to deal with also, which are different from Order statuses. For this reason, my suggestion would be to work through Orders first and get those just the way you want them. Then at some point in the future when you have more time to test Subscriptions extensively, you can take a look at all of the possible Subscription statuses.

@raamdev raamdev added the enhancement label Aug 24, 2016

@jaswrks

This comment has been minimized.

@raamdev raamdev modified the milestone: Next Release Oct 31, 2016

jaswrks pushed a commit that referenced this issue Nov 19, 2016

jaswsinc

@jaswrks jaswrks referenced this issue Nov 19, 2016

Merged

PR: feature/1 #28

jaswrks pushed a commit that referenced this issue Nov 19, 2016

jaswsinc
@jaswrks

This comment has been minimized.

Copy link

jaswrks commented Nov 19, 2016

Referencing KBA draft: https://wpsharks.com/?post_type=kb_article&p=3092&preview=true

Support has been added for all WooCommerce events:

Orders (of any Type, excluding shop_subscription)

  • order-draft excluded intentionally.
  • order-pending excluded intentionally.
  • order-processing
  • order-completed
  • order-on-hold
  • order-cancelled
  • order-refunded
  • order-failed
  • And others added by WooCommerce extensions.

Subscriptions (Specifically for shop_subscription Type)

  • subscription-draft excluded intentionally.
  • subscription-pending excluded intentionally.
  • subscription-active
  • subscription-on-hold
  • subscription-cancelled
  • subscription-switched
  • subscription-expired
  • subscription-pending-cancel
  • And others added by WooCommerce extensions.

jaswrks pushed a commit that referenced this issue Nov 19, 2016

jaswsinc
@jaswrks

This comment has been minimized.

Copy link

jaswrks commented Nov 19, 2016

Next Release Changelog:

  • Compatibility: This release adds compatibility with WooCommerce Subscriptions. See Issue #1.
  • Compatibility: This release adds support for all WooCommerce Order and/or Subscription status changes, including those added by WooCommerce extensions such as the WooCommerce Give Order extension. See Issue #1.
@jaswrks

This comment has been minimized.

Copy link

jaswrks commented Nov 19, 2016

Tagging as partial completion. Pending review by @raamdev and publication of this KBA.

@raamdev

This comment has been minimized.

Copy link
Contributor

raamdev commented Nov 21, 2016

@jaswsinc Could you clarify what additional work is necessary here? If completion of this issue is just pending a review from me, there's no need to add the partial completion label.

@jaswrks

This comment has been minimized.

Copy link

jaswrks commented Nov 21, 2016

Just to publish the KBA. The KBA is referenced by the plugin with this update, so I tagged this issue to help as a reminder that it needs to be published before the issue can be closed. However, if you'd rather I not use the label for that it's with me.

@raamdev

This comment has been minimized.

Copy link
Contributor

raamdev commented Nov 22, 2016

@jaswsinc No problem. That's a good use for that tag, yes. Please continue to do that if there's some other work that needs to be completed before the release that the issue is attached to. 👍

@renzms

This comment has been minimized.

Copy link

renzms commented Nov 28, 2016

Tested

See comment here

@jaswrks

This comment has been minimized.

Copy link

jaswrks commented Nov 28, 2016

@raamdev writes...

That's a good use for that tag, yes.

Copy that.

@jaswrks

This comment has been minimized.

Copy link

jaswrks commented Nov 28, 2016

@renzms writes...

See comment here

That was a bug. Thanks for catching. Referencing: #19 (comment)

@renzms

This comment has been minimized.

Copy link

renzms commented Nov 29, 2016

@jaswsinc @raamdev

Possible Bug

For Subscriptions, it seems to be creating 2 orders. 1 for Subscription and 1 set as an Order.

In the testing, in Intercom Order 224 is counted as the Ordered Product and Order 225 is counted as the Subscription

On the backend however in WooCommerce, the Subscription counts as one product, Order 224:

screen shot 2016-11-30 at 7 15 38 am

When Subscription is On-Hold:
screen shot 2016-11-30 at 7 19 48 am

When Subscription is Processing (notice Subscription says active):

screen shot 2016-11-30 at 7 20 31 am

When Subscription is Completed or is Refunded (only shows up as Order 224 and as an Order):

screen shot 2016-11-30 at 7 23 24 am

When Subscription is Canceled:

screen shot 2016-11-30 at 7 25 16 am

jaswrks pushed a commit that referenced this issue Dec 3, 2016

jaswsinc
@jaswrks

This comment has been minimized.

Copy link

jaswrks commented Dec 3, 2016

@renzms I have confirmed that the above behavior is correct in all cases. It looks like a bug, but it's actually the intended behavior. Any given order can contain a subscription + something more. Internally, both are orders, but it's important for sites who sell subscriptions to know the status of both the order and also of a subscription that results from an order status changing.

What I did change in the last set of tweaks however, is that I'm now displaying the ORDER_NUMBER as ORDER_ID and instead of showing ORDER_ID for subscriptions, it now shows SUBSCRIPTION_ID to help make this a bit clearer; i.e., look less like a duplicate.

2016-12-03_06-31-00

@renzms

This comment has been minimized.

Copy link

renzms commented Dec 5, 2016

@jaswsinc

Hi Jason! Which branch is the update on? The latest version of: https://github.com/websharks/woocommerce-intercom-pro/tree/release/161124.6961-RC or is there another bleeding edge version?

It hasn't updated on my end while using the latest RC:
screen shot 2016-12-06 at 12 00 45 am

@renzms

This comment has been minimized.

Copy link

renzms commented Dec 5, 2016

@jaswsinc

Scratch that last comment above ^ :)

Looks like it updated after I updated the WP Sharks Core and refreshed the page, as well as Intercom Dashboard.

screen shot 2016-12-06 at 12 08 30 am

@raamdev Looks good to me! 👍

@raamdev

This comment has been minimized.

Copy link
Contributor

raamdev commented Dec 5, 2016

@jaswrks

This comment has been minimized.

Copy link

jaswrks commented Dec 5, 2016

Awesome. Thanks for the testing! :-) Much appreciated.

raamdev added a commit to wpsharks/woocommerce-intercom that referenced this issue Dec 10, 2016

Phing release of v161209.85885 with the following changes:
- **Bug Fix:** Call to undefined method `WC_Order::get_currency()` should be `get_order_currency()`. Reported by @raamdev in [this GitHub issue](wpsharks/woocommerce-intercom-pro#4).
- **Bug Fix:** Before a new Event is generated to track a user's Order or Subscription status on the Intercom side, a new API call is now made to ensure that a matching User does in fact exist on the Intercom side before an Event is created. This corrects a problem reported in the previous release that resulted in an error during checkout: `User Not Found`. See [Issue #6](wpsharks/woocommerce-intercom-pro#6 (comment))
- **Bug Fix:** In the Event API calls, `amount` must be given in **cents** (i.e., total x 100) for proper calculation on the Intercom side. Closes [this GitHub issue](wpsharks/woocommerce-intercom-pro#17).
- **New Feature:** It is now possible to configure the Intercom Messenger icon display settings so that it's only shown to logged-in users, only to logged-out users, or to everyone (default behavior). See: **Dashboard → WooCommerce → Intercom → Messenger Display Options**.
- **New Feature:** Adding support for URI Inclusion patterns. See [Issue #12](wpsharks/woocommerce-intercom-pro#12).
- **New Feature:** Adding support for URI Exclusion patterns. See [Issue #12](wpsharks/woocommerce-intercom-pro#12).
- **New People Attribute:** This release adds a new People Attribute by the name of `wp_user_id`, giving support reps. the ability to track WP User IDs in Intercom.
- **New Filter:** A new filter has been exposed: `js_snippet_attrs`. This allows a developer to add their own custom attributes; above and beyond what is already defined by WooCommerce Intercom Pro itself.
- **New Filter:** `add_filter('woocommerce_intercom_js_snippet_enable', '__return_false');` to disable the JS snippet selectively.
- **Enhancement:** Standardizing Event names sent to Intercom. New format: `order-[status]`. See [Issue #19](wpsharks/woocommerce-intercom-pro#19).
- **Enhancement:** Adding `wp_home_url` and `wp_network_home_url` fields to JS Snippet to make it easier for support representatives to identify the origin of a customer request; e.g., whenever a single Intercom account is being used to support more then one WordPress installation, or multiple child sites/domains in a Multisite Network. See [Issue #22](wpsharks/woocommerce-intercom-pro#22).
- **Intercom `user_id`:** This release changes the way an Intercom `user_id` is generated. Instead of just the WP User ID, the Intercom `user_id` is now formulated in a way that allows a single Intercom account to be used for multiple installations of WordPress. The `user_id` sent to Intercom is now made up of two parts. 1. A hash of the current WordPress `home_url()` (normalized). 2. The current user's WordPress ID (or, in the case of guest checkout, an `e-`, followed by a hash of the user's email address). The final `user_id` becomes: `[location hash].[user ID]`; e.g., `3610a686.123`, `3610a686.e-9943c993` (guest).
- **Compatibility:** Adding support and compatibility with WPML's `ICL_LANGUAGE_CODE` so the Intercom messenger will always be displayed in an appropriate language.
- **Compatibility:** This release adds compatibility with WooCommerce Subscriptions. See [Issue #1](wpsharks/woocommerce-intercom-pro#1).
- **Compatibility:** This release adds support for all WooCommerce Order and/or Subscription status changes, including those added by WooCommerce extensions such as the WooCommerce Give Order extension. See [Issue #1](wpsharks/woocommerce-intercom-pro#1).
- **Compatibility:** Removing API Key setting for Intercom in favor of a Personal Access Token. There is now a configuration field under: **WP Dashboard → WooCommerce → Intercom** settings where you can supply a Personal Access Token for API calls to Intercom. Use the instructions provided in this area to generate and fill-in your Personal Access Token. See [Issue #20](wpsharks/woocommerce-intercom-pro#20).
- **Compatibility:** Adding support for guest checkout events that track a customer by email address instead of by user ID. Closes [this GitHub issue](wpsharks/woocommerce-intercom-pro#6).
- **Compatibility:** Updating `composer.json` to specify that we will use the Intercom SDK v3.x (but not 4.x) until a full review of a new major release has been completed.
- **Cleanup:** Moving JS snippet into a template file w/ replacement code. Closes [this GitHub issue](wpsharks/woocommerce-intercom-pro#8).
@raamdev

This comment has been minimized.

Copy link
Contributor

raamdev commented Dec 10, 2016

WooCommerce Intercom Pro v161209.85885 has been released and includes changes from this GitHub Issue. See the changelog for further details.


This issue will now be locked to further updates. If you have something to add related to this GitHub Issue, please open a new GitHub Issue and reference this one (#1).

@raamdev raamdev closed this Dec 10, 2016

@wpsharks wpsharks locked and limited conversation to collaborators Dec 10, 2016

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.