Results 1 to 7 of 7
  1. #1
    Join Date
    Sep 2005
    Posts
    23
    Plugin Contributions
    0

    Default Upcoming Products as a sidebox

    Heya

    I wasn't able to find anything on searching the forums, but has anyone any idea how to add a sidebox for upcoming products, preferably including thumbnails and price along with the date available?

    I would imagine it's only a case of taking the code from the upcoming products template and customizing it to fit a sidebox, but I'm not sure.

    Any help appreciated.

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Upcoming Products as a sidebox

    Clone the whats_new sidebox but use the date for the products_date_available in the products table on the select statement to determin who to use ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  3. #3
    Join Date
    Sep 2005
    Posts
    23
    Plugin Contributions
    0

    Default Re: Upcoming Products as a sidebox

    Quote Originally Posted by Ajeh
    Clone the whats_new sidebox but use the date for the products_date_available in the products table on the select statement to determin who to use ...
    Cool thanks for the advice.

    I'm thinking that you are meaning this part of the select query:

    where products_status = '1'

    and replace it with

    where products_date_available = "1"

    Not sure what I would need to replace the 1 with though, as it's not just 1/0 switch on that column.

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Upcoming Products as a sidebox

    Nope sure don't ...

    You need to change table names and field names and method of select to produce the random product to be displayed from the 1 to many upcoming products ...

    The whats_new sidebox is just a good pattern to follow ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  5. #5
    Join Date
    Mar 2005
    Posts
    99
    Plugin Contributions
    0

    Default Re: Upcoming Products as a sidebox

    hey spunky....did you get this to work mate?

    id like it too but there isnt enough information here for me to implement it.

    Tim

  6. #6
    Join Date
    Jul 2006
    Location
    UK
    Posts
    158
    Plugin Contributions
    0

    Default Re: Upcoming Products as a sidebox

    Quote Originally Posted by Ajeh View Post
    Nope sure don't ...

    You need to change table names and field names and method of select to produce the random product to be displayed from the 1 to many upcoming products ...

    The whats_new sidebox is just a good pattern to follow ...
    Hi Ajeh,

    Would need a bit of help please. I have changed the table names but how do I change the method of select please?

    Here is my sidebox code:
    PHP Code:
    <?php
    //*****************************************************************
    //*****************************************************************
    //                   whats_new scroller for Zen-Cart v1.3                
    //                          originally by sn0ut                                
    //           Place this file in your sideboxes template overrides dir    
    //     includes\templates\%your_template%\sideboxes\tpl_whats_new.php    
    //                                                                    
    //*****************************************************************
    //*****************************************************************
    // $Id: tpl_whats_new.php,v 1.0 23/08/2006  sn0ut $ 




    // *****************************************************************|
    // ******************** CONFIG OPTIONS **************************** |
    // Change the values here to modify how the marquee looks and works |
    // *****************************************************************|
    $scroll_amount =    "1"// scroll amount
    $scroll_delay =     "5";  // scroll delay
    $scroll_direction "up"// scroll direction (can be up, down, left or right)
    $scroll_behaviour "scroll"// scroll behaviour (can be scroll, alternate or slide) ** Seems to make no diff **
    $box_height =       "160"// height of whats new box
    // *****************************************************************|
    // *********************** END CONFIG ***************************** |
    // *****************************************************************|






    $display_limit zen_get_products_products_date-available_timelimit();  // filters by admin settings 
    $content "";   // clear sidebox previous content
    $content .= '<div id="' str_replace('_''-'$box_id 'Content') . '" class="sideBoxContent centeredContent">';
    $random_products_date_available _query "select p.products_id, p.products_image, p.products_tax_class_id, p.products_price, pd.products_name
                               from " 
    TABLE_PRODUCTS " p, " TABLE_PRODUCTS_DESCRIPTION " pd
                               where p.products_status = 1 " 
    $display_limit "
                               and p.products_id = pd.products_id
                               order by products_date_available asc
                               limit " 
    MAX_RANDOM_SELECT_NEW;


        
    $random_products_date_available  $db->Execute($random_products_date_available _query);
           
    $i 0;
        while (!
    $random_products_date_available ->EOF) {
        
    $rn .=      '<br /><center><a href="' zen_href_link(zen_get_info_page($random_products_date_available ->fields['products_id']), 'products_id=' .                 $random_products_date_available ->fields['products_id']) . '">' zen_image(DIR_WS_IMAGES $random_products_date_available ->fields['products_image'], $random_products_date_available ->fields[    'products_name'], SMALL_IMAGE_WIDTHSMALL_IMAGE_HEIGHT) . ' </a><br /><a href="' zen_href_link(zen_get_info_page($random_products_date_available ->fields    ['products_id']), 'products_id=' $random_products_date_available ->fields['products_id']) . '">' $random_products_date_available ->fields['products_name'] . '</a><br />' .    zen_get_products_display_price($random_products_date_available ->fields['products_id']) . '</center><br /><br />' "\n";
        
    $i++;
        
    $random_products_date_available ->MoveNext();
     }

        
    $total $i;

        if (
    $total 1) { //if more than one new product exists in the db then scrolling begins
        
    $content .= '<MARQUEE behavior= "' $scroll_behaviour '" align= "center" direction= "' $scroll_direction '" height="' $box_height '" scrollamount= "' $scroll_amount '" scrolldelay= "' $scroll_delay '" onmouseover=\'this.stop()\' onmouseout=\'this.start()\'>' $rn .'</MARQUEE>';
     }

     elseif (
    $total == 1) {  // If only one new product exists in the db then the box will remain static
        
    $content .=  $rn;
     }

     else { 
    //  If there are no new products then this text is displayed
        
    $content .= "No new products this month!";
     }
        
    $content .= '</div>';

    ?>
    Any help would be much appreciated.

    Cheers
    Claire

  7. #7
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Upcoming Products as a sidebox

    Take a peek at the upcoming module in the:
    /includes/modules/upcoming_products.php

    and adapt that SELECT statement to work with the randomization ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

 

 

Similar Threads

  1. How to disable boxes 'New Products For', 'upcoming products' etc.'?
    By yalus in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 3 Feb 2011, 03:49 PM
  2. Upcoming Products
    By sadwargamer in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 16 Aug 2009, 09:12 PM

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
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR