Skip to content

Add removeEcommerceItem() and clearEcommerceCart() methods to JS tracker. #13228

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

Merged
merged 5 commits into from
Aug 1, 2018

Conversation

diosmosis
Copy link
Member

Fixes #11766

@diosmosis diosmosis added not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. Needs Review PRs that need a code review labels Jul 31, 2018
@diosmosis diosmosis added this to the 3.6.0 milestone Jul 31, 2018
@sgiehl
Copy link
Member

sgiehl commented Jul 31, 2018

Code looks good so far. There is still one JS test failing and the minified versions needs to be updated.
Guess we also need to update the developer documentation afterwards so the new methods are mentioned there.

@mattab mattab self-requested a review July 31, 2018 20:18
Copy link
Member

@mattab mattab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Feedback

@diosmosis
Copy link
Member Author

Created dev docs PR here: matomo-org/developer-documentation#258

@diosmosis
Copy link
Member Author

For the addition to the docs, here is some text that can be added after the To track Ecommerce orders, two Javascript functions are used: ... section:

There are also two other JavaScript functions you may find useful:

removeEcommerceItem(productSKU) This removes a product from the order by SKU.
clearEcommerceCart() This clears the order completely.

Generally, you only need to call these method if you don't track the order all at once and it's possible for a user to edit their cart after addEcommerceItem() is called. Otherwise, if you track an order after or as it is placed, then you just need to add the items and track the order.

@diosmosis diosmosis force-pushed the 11766-ecommerce-cart-methods branch from b062322 to 380d422 Compare August 1, 2018 06:53
@diosmosis diosmosis merged commit 7414af9 into 3.x-dev Aug 1, 2018
@diosmosis
Copy link
Member Author

cc @mattab for last two comments

@diosmosis diosmosis deleted the 11766-ecommerce-cart-methods branch August 1, 2018 07:48
@mattab mattab added Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. and removed not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. labels Aug 28, 2018
InfinityVoid pushed a commit to InfinityVoid/matomo that referenced this pull request Oct 11, 2018
…ker. (matomo-org#13228)

* Add removeEcommerceItem() and clearEcommerceCart() methods to JS tracker.

* jslint and changelog

* minify JS

* update test count

* remove newlines
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. Needs Review PRs that need a code review
Development

Successfully merging this pull request may close these issues.

3 participants