Results 1 to 10 of 15

Hybrid View

  1. #1
    Join Date
    Apr 2007
    Posts
    139
    Plugin Contributions
    0

    Default Re: Random Products Display on Homepage

    Great. At least I got the gift certificate removed.

  2. #2
    Join Date
    May 2007
    Posts
    29
    Plugin Contributions
    0

    Default Re: Random Products Display on Homepage

    I just made changes to remove random display for new products so I thought of posting it here.

    File to change: /includes/modules/YOUR_TEMPLATE/new_products.php

    1. Add sort by date to the $new_products_query variable (around line 19 & 25). Mine looks like this:
    PHP Code:
    $new_products_query "select p.products_id, p.products_image, p.products_tax_class_id, p.products_price, p.products_date_added
                               from " 
    TABLE_PRODUCTS " p
                               where p.products_status = 1 " 
    $display_limit .
                               
    " order by p.products_date_added desc"
    PHP Code:
    $new_products_query "select distinct p.products_id, p.products_image, p.products_tax_class_id, p.products_date_added,
                                               p.products_price
                               from " 
    TABLE_PRODUCTS " p
                               left join " 
    TABLE_SPECIALS " s
                               on p.products_id = s.products_id, " 
    TABLE_PRODUCTS_TO_CATEGORIES " p2c, " .
                               
    TABLE_CATEGORIES " c
                               where p.products_id = p2c.products_id
                               and p2c.categories_id = c.categories_id
                               and c.parent_id = '" 
    . (int)$new_products_category_id "'
                               and p.products_status = 1 " 
    $display_limit .
                               
    " order by p.products_date_added desc"
    2. Around line 38, change
    PHP Code:
    $new_products $db->ExecuteRandomMulti($new_products_queryMAX_DISPLAY_NEW_PRODUCTS); 
    to
    PHP Code:
    $new_products $db->Execute($new_products_queryMAX_DISPLAY_NEW_PRODUCTS); 
    3. Scroll down and find this line:
    PHP Code:
    $new_products->MoveNextRandom(); 
    and change it to
    PHP Code:
    $new_products->MoveNext(); 

  3. #3
    Join Date
    Apr 2007
    Posts
    139
    Plugin Contributions
    0

    Default Re: Random Products Display on Homepage

    Hi Battra,

    Nice...May I have look at your URL?

  4. #4
    Join Date
    May 2007
    Posts
    29
    Plugin Contributions
    0

    Default Re: Random Products Display on Homepage

    My Zen cart is still at my local PC I plan to use it as a gallery/showcase instead of shopping cart and that's why I need to put the latest item (chronological, not random) on the main page.

 

 

Similar Threads

  1. v151 Random display of products on Product Listing
    By Kevin205 in forum General Questions
    Replies: 2
    Last Post: 16 Mar 2013, 08:42 PM
  2. Can I display a random collection of products on my main page?
    By canemasters in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 15 Apr 2012, 02:42 PM
  3. Remove 'New Products' and display random products
    By xman888 in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 19 Apr 2011, 06:48 AM
  4. Homepage Wont Display Featured Products
    By limelites in forum General Questions
    Replies: 4
    Last Post: 26 Feb 2010, 02:17 AM
  5. Display Random products instead of New Products on Index
    By vegascoug in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 17 Sep 2009, 09:35 AM

Posting Permissions

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