hi everyone, we are about to LIVE with our store and we need to reset everything to ZERO in the admin area, such as : best products purchased, best products viewed.
Anybody can tell me where can I reset it in mySQL Admin please ?
thanks in advance !
This is a discussion on Out store ready to LIVE, we need to RESET best_products_purchased, but how ? within the osCmax v2 Customization/Mods forums, part of the osCmax v2.0 Forums category; hi everyone, we are about to LIVE with our store and we need to reset everything to ZERO in the ...
hi everyone, we are about to LIVE with our store and we need to reset everything to ZERO in the admin area, such as : best products purchased, best products viewed.
Anybody can tell me where can I reset it in mySQL Admin please ?
thanks in advance !
table products
zero out the products_ordered field
how did I figure this out?
The SQL query...
$best_sellers_query = tep_db_query("select distinct p.products_id, pd.produc
ts_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_status = '1' and p.products_ordered > 0 and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and '" . (int)$current_category_id . "' in (c.categories_id, c.parent_id) order by p.products_ordered desc, pd.products_name limit " . MAX_DISPLAY_BESTSELLERS);
see where it has the "order by"? That's the key.
so endith the lesson
<think>sometimes I just sit's and thinks</think>
"Here you are with a hand full of holes, a thumb up your ass, and a big grin to pass the time of day with." - TWB
thanks met00 !! can you tell me the TABLE database of best_products_purchased ? I prefer to delete it one by one. I'm just worry I might screwed up with SQL query...
thanks again !!
I assume you are talking about the admin report...
/admin/stats_products_purchased.php
Let's look at the SQL...
$products_query_raw = "select p.products_id, p.products_ordered, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where pd.products_id = p.products_id and pd.language_id = '" . $languages_id. "' and p.products_ordered > 0 group by pd.products_id order by p.products_ordered DESC, pd.products_name";
AMAZING... this query looks a great deal like the best sellers query above!
My first glance shows that the same table is being used. Whoa! it shows that the same filed in the same table is being used (see the "order by p.products_ordered").
Now, I'm no longer working as an aerospace engineer or a rocket scientist, but my best guess is that when you zero out that field in the database it will get rid of both the "best sellers" on the customer side and the "best sellers" report on the admin side.
But, you know, I could be wrong, so you may just want to check out /admin/includes/database_tables.php and see if there is a special table there that duplicates what the products tables single field is doing. If there isn't, then my best guess is that the SQL statement isn't lying and that zeroing out the data from that one field will actually do what I said it would do in my last post.
YMMV and do not fold, bend, spindle or mutilate this post.
so endith the lesson
<think>sometimes I just sit's and thinks</think>
"Here you are with a hand full of holes, a thumb up your ass, and a big grin to pass the time of day with." - TWB
Bookmarks