@mattab opened this Issue on July 12th 2016 Member

Ecommerce orders has a cart which contains Items, where an Item is defined with a Product SKUs, product name, product category, product price, product quantity.


The JS client wrongly implements the Ecommerce cart update method, and stores the items in a javascript array indexed by product SKUs: ecommerceItems[sku] = [ sku, name, category, price, quantity ]; -> this bug means orders with duplicate skus (eg. with different prices) will be missed.

Bug reported in https://github.com/piwik/piwik/issues/10252#issuecomment-231956500 by @Slowlearneruk :+1:

Use case

Can I just present the case for the change before we write it off completely: The application I have written is a gambling game and the transactions that a user might make are individual bets. Consequently the price that they pay will vary according to what they want to gamble and there is nothing to stop them making the same bet twice over (with different stakes) if they wish. It therefore makes sense to record the individual bets as separate transactions otherwise I would lose information.

Consider as an alternative a site where the price of an item might vary (auction sites for instance) but it's SKU remains the same, one would want to represent separate purchases at different prices individually right?


  • [ ] Solve issue in JS client
  • [ ] Solve issue in PHP Tracking API client as well - here.
  • [ ] Announce in dev changelog the change
  • [ ] Contact authors of other SDKs who have implemented the ecommerce functions, to check they have implemented without the SKU indexing.
Powered by GitHub Issue Mirror