How toTurn off Popularity reporting?

Hi,



Has anyone figured out how to"Turn off Popularity reporting"?



Everytime someone visits a product, it is keeping a tally. This is eating up to many resources with 200K products. I tried to comment out the following in config.php, but it did not make any difference.



//Popularity rating

//define(‘POPULARITY_VIEW’, 3);

//define(‘POPULARITY_ADD_TO_CART’, 5);

//define(‘POPULARITY_DELETE_FROM_CART’, 5);

//define(‘POPULARITY_BUY’, 10);





Thanks for the help,

Dan

I’d like to disable this too. I’m guessing it is found in some of the core php files. I just found in controllers/customers/products.php this line…


// Increase product popularity

It looks like the piece of code following that is what increases the view totals which would be the most server intensive part. I just commented it out and it seems to be working as expected.

I’m not a big fan of the way this works either. We already have “bestsellers” which ranks the true popularity of items in “your” store based on number sold. Instead of having a popularity sort I’d rather have a ratings sort, that sorts based on the average customer rating given to that product, not some meaningless added/removed from cart popularity contest.



This is one of the items on my “to-do” list. I hope CS Carts beats me to it though. :slight_smile:

I also just removed “popularity” from the little dropdown box for sorting options. I found a line in /core/fn.catalog.php and commented it out. This removed it from the dropdown box customers see.


'popularity' => array('description' => fn_get_lang_var('popularity'), 'default_order' => 'desc')



I agree Rating would be more valuable sort method as long as you have a lot of ratings.



Here is a thread about product sorting… and how to add a sort by product code option:

[url]http://forum.cs-cart.com/showthread.php?t=14820[/url]

I wonder if rating would be that easy. I don’t have any ratings so I can’t really test it.

After a few days of running with Popularity on, my site begins to slow down. To turn off Popularity reporting, follow these instuctions.



In the file controllers/customers/products.php , comment out these 2 lines at the end of the file.





//db_query(“INSERT INTO ?:product_popularity ?e ON DUPLICATE KEY UPDATE viewed = viewed + 1, total = total + ?i”, $_data, POPULARITY_VIEW);



//$_SESSION[‘products_popularity’][‘viewed’][$_REQUEST[‘product_id’]] = true;