Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Piwik add-on


osRainMan

Recommended Posts

Hi,

 

felt it was time to contribute something in return for using osCommerce since a number of years.

 

Concerns the piwik addon in 2.3.4 BS.

 

Checking the reporting in PiWiK I noticed that product category is always the same, irrespective of the product concerned.

 

Checking the code in ht_piwik.php I noticed a potential bug in line 57. This line contains the PHP code to establish the product name and product category. The current version doesn't properly join the products and products2categories tables which results in a random category name.

 

Adding 'and p.products_id = p2c.products_id' to the MySQL query solves this problem.

 

After inserting this the line 57 looks like

 

$products_query = tep_db_query("select p.products_id, pd.products_name, cd.categories_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, ". TABLE_CATEGORIES_DESCRIPTION ." cd WHERE p.products_id = pd.products_id and p.products_id = p2c.products_id and p2c.categories_id = cd.categories_id and p.products_id = " . (int)$HTTP_GET_VARS['products_id'] . " and pd.language_id ='" . (int)$languages_id . "' and cd.language_id ='".(int)$languages_id."'");

 

P.S: Couldn't find a topic related to PiWiK that I could use.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...