osCmax v2.5 User Manual
Results 1 to 4 of 4

Out store ready to LIVE, we need to RESET best_products_purchased, but how ?

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 ...

      
  1. #1
    New Member
    Join Date
    Jul 2007
    Posts
    12
    Rep Power
    0


    Default Out store ready to LIVE, we need to RESET best_products_purchased, but how ?

    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 !

  2. #2
    osCMax Development Team met00's Avatar
    Join Date
    Oct 2005
    Location
    wherever I happen to be at the moment
    Posts
    854
    Blog Entries
    2
    Rep Power
    26


    Default Re: Out store ready to LIVE, we need to RESET best_products_purchased, but how ?

    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

  3. #3
    New Member
    Join Date
    Jul 2007
    Posts
    12
    Rep Power
    0


    Default Re: Out store ready to LIVE, we need to RESET best_products_purchased, but how ?

    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 !!

  4. #4
    osCMax Development Team met00's Avatar
    Join Date
    Oct 2005
    Location
    wherever I happen to be at the moment
    Posts
    854
    Blog Entries
    2
    Rep Power
    26


    Default Re: Out store ready to LIVE, we need to RESET best_products_purchased, but how ?

    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

Similar Threads

  1. Ready to go live but a couple of hang ups! Please Help!
    By n2advnture in forum osCommerce 2.2 Modification Help
    Replies: 0
    Last Post: 11-19-2005, 08:03 AM
  2. Anyone using 1.5 with a live store?
    By Anonymous in forum osCmax v1.7 Discussion
    Replies: 6
    Last Post: 12-30-2003, 09:29 PM
  3. Almost ready to go live
    By judoka in forum osCommerce 2.2 Modification Help
    Replies: 6
    Last Post: 06-02-2003, 05:41 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •