Results 1 to 8 of 8

Hybrid View

  1. #1
    Join Date
    Jul 2007
    Posts
    110
    Plugin Contributions
    0

    Default 2 products on a row in Whats new?

    Hi!
    I just installed thecontribution Whats new 2 but I would like the products to appear on the same row and not underneath each other.
    Can someone please help me with this one?
    Below is the code I think it would be in.

    best regards,
    Ola

    <?php
    /**
    * Side Box Template
    *
    * @package templateSystem
    * @copyright Copyright 2003-2005 Zen Cart Development Team
    * @copyright Portions Copyright 2003 osCommerce
    * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
    * @version $Id: tpl_whats_new.php 2982 2006-02-07 07:56:41Z birdbrain $
    *
    * rebuild by PeterB
    * www.openhosting.sk
    * peter DOT bohus AT openhosting DOT sk
    *
    */

    $content = "";
    $content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent centeredContent">';
    if (($random_whats_new_sidebox_product->fields['products_id']) != ($random_whats_new_sidebox_product2->fields['products_id'])) {
    $content .= '<a href="' . zen_href_link(zen_get_info_page($random_whats_new_sidebox_product->fields['products_id']), 'products_id=' . $random_whats_new_sidebox_product->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $random_whats_new_sidebox_product->fields['products_image'], $random_whats_new_sidebox_product->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '<br />' . $random_whats_new_sidebox_product->fields['products_name'] . '</a><br />' . $whats_new_price;
    /*...uprava pre druhy produkt...*/
    $content .= '<br /><a href="' . zen_href_link(zen_get_info_page($random_whats_new_sidebox_product2->fields['products_id']), 'products_id=' . $random_whats_new_sidebox_product2->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $random_whats_new_sidebox_product2->fields['products_image'], $random_whats_new_sidebox_product2->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '<br />' . $random_whats_new_sidebox_product2->fields['products_name'] . '</a><br />' . $whats_new_price2;
    /*...konec upravy...*/
    $content .= '</div>';
    } else {
    $content .= '<a href="' . zen_href_link(zen_get_info_page($random_whats_new_sidebox_product->fields['products_id']), 'products_id=' . $random_whats_new_sidebox_product->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $random_whats_new_sidebox_product->fields['products_image'], $random_whats_new_sidebox_product->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '<br />' . $random_whats_new_sidebox_product->fields['products_name'] . '</a><br />' . $whats_new_price;
    $content .= '</div>';
    }

    ?>

  2. #2
    Join Date
    Jan 2005
    Location
    USA, St. Louis
    Posts
    3,710
    Plugin Contributions
    9

    Default Re: 2 products on a row in Whats new?

    Quote Originally Posted by jagge View Post
    Hi!
    I just installed thecontribution Whats new 2 but I would like the products to appear on the same row and not underneath each other.
    Can someone please help me with this one?
    Below is the code I think it would be in.

    best regards,
    Ola

    <?php
    /**
    * Side Box Template
    *
    * @package templateSystem
    * @copyright Copyright 2003-2005 Zen Cart Development Team
    * @copyright Portions Copyright 2003 osCommerce
    * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
    * @version $Id: tpl_whats_new.php 2982 2006-02-07 07:56:41Z birdbrain $
    *
    * rebuild by PeterB
    * www.openhosting.sk
    * peter DOT bohus AT openhosting DOT sk
    *
    */

    $content = "";
    $content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent centeredContent">';
    if (($random_whats_new_sidebox_product->fields['products_id']) != ($random_whats_new_sidebox_product2->fields['products_id'])) {
    $content .= '<a href="' . zen_href_link(zen_get_info_page($random_whats_new_sidebox_product->fields['products_id']), 'products_id=' . $random_whats_new_sidebox_product->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $random_whats_new_sidebox_product->fields['products_image'], $random_whats_new_sidebox_product->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '<br />' . $random_whats_new_sidebox_product->fields['products_name'] . '</a><br />' . $whats_new_price;
    /*...uprava pre druhy produkt...*/
    $content .= '<br /><a href="' . zen_href_link(zen_get_info_page($random_whats_new_sidebox_product2->fields['products_id']), 'products_id=' . $random_whats_new_sidebox_product2->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $random_whats_new_sidebox_product2->fields['products_image'], $random_whats_new_sidebox_product2->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '<br />' . $random_whats_new_sidebox_product2->fields['products_name'] . '</a><br />' . $whats_new_price2;
    /*...konec upravy...*/
    $content .= '</div>';
    } else {
    $content .= '<a href="' . zen_href_link(zen_get_info_page($random_whats_new_sidebox_product->fields['products_id']), 'products_id=' . $random_whats_new_sidebox_product->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $random_whats_new_sidebox_product->fields['products_image'], $random_whats_new_sidebox_product->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '<br />' . $random_whats_new_sidebox_product->fields['products_name'] . '</a><br />' . $whats_new_price;
    $content .= '</div>';
    }

    ?>
    You shouldn't have to adjust anything there to get two side by side. In "configuration", "index listing", what do you have set for:
    New Products Columns per Row

  3. #3
    Join Date
    Jul 2007
    Posts
    110
    Plugin Contributions
    0

    Default Re: 2 products on a row in Whats new?

    Hi,
    it was set to 3. I tried to set it to 2 but nothing happened?
    This is the other file that followed the contribution.

    /Ola

    <?php
    /**
    * whats_new sidebox - displays a random "new" product
    *
    * @package templateSystem
    * @copyright Copyright 2003-2005 Zen Cart Development Team
    * @copyright Portions Copyright 2003 osCommerce
    * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
    * @version $Id: whats_new.php 4162 2006-08-17 03:55:02Z ajeh $
    *
    * rebuild by PeterB
    * www.openhosting.sk
    * [email protected]
    *
    */
    // display limits
    //$display_limit = zen_get_products_new_timelimit();
    $display_limit = zen_get_new_date_range();
    $random_whats_new_sidebox_product_query = "select p.products_id, p.products_image, p.products_tax_class_id, p.products_price
    from " . TABLE_PRODUCTS . " p
    where p.products_status = 1 " . $display_limit . "
    limit " . MAX_RANDOM_SELECT_NEW;
    $random_whats_new_sidebox_product = zen_random_select($random_whats_new_sidebox_product_query);
    if ($random_whats_new_sidebox_product->RecordCount() > 0 ) {
    $whats_new_price = zen_get_products_display_price($random_whats_new_sidebox_product->fields['products_id']);
    $random_whats_new_sidebox_product->fields['products_name'] = zen_get_products_name($random_whats_new_sidebox_product->fields['products_id']);
    $random_whats_new_sidebox_product->fields['specials_new_products_price'] = zen_get_products_special_price($random_whats_new_sidebox_product->fields['products_id']);
    /* ...uprava pre zobrazenie druheho produktu...
    require($template->get_template_dir('tpl_whats_new.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_whats_new.php');
    $title = BOX_HEADING_WHATS_NEW;
    $title_link = FILENAME_PRODUCTS_NEW;
    require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
    ... koniec upravy pre zobrazenie druheho produktu...*/
    }
    /*...uprava pre zobrazenie druheho produktu...*/
    $display_limit2 = zen_get_new_date_range();
    $random_whats_new_sidebox_product_query2 = "select p.products_id, p.products_image, p.products_tax_class_id, p.products_price
    from " . TABLE_PRODUCTS . " p
    where p.products_status = 1 " . $display_limit . "
    limit " . MAX_RANDOM_SELECT_NEW;
    $random_whats_new_sidebox_product2 = zen_random_select($random_whats_new_sidebox_product_query2);
    if ($random_whats_new_sidebox_product2->RecordCount() > 0 ) {
    $whats_new_price2 = zen_get_products_display_price($random_whats_new_sidebox_product2->fields['products_id']);
    $random_whats_new_sidebox_product2->fields['products_name'] = zen_get_products_name($random_whats_new_sidebox_product2->fields['products_id']);
    $random_whats_new_sidebox_product2->fields['specials_new_products_price'] = zen_get_products_special_price($random_whats_new_sidebox_product2->fields['products_id']);
    require($template->get_template_dir('tpl_whats_new_2.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_whats_new_2.php');
    $title = BOX_HEADING_WHATS_NEW;
    $title_link = FILENAME_PRODUCTS_NEW;
    require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
    }
    /*...koniec upravy pre zobrazenie druheho produktu...*/
    ?>

  4. #4
    Join Date
    Jan 2005
    Location
    USA, St. Louis
    Posts
    3,710
    Plugin Contributions
    9

    Default Re: 2 products on a row in Whats new?

    Oh, sorry I've been misunderstanding. I didn't realize these were sideboxes. You want them side by side in the sideboxes? Can I see a link? It probably can be adjusted in the css.

  5. #5
    Join Date
    Jul 2007
    Posts
    110
    Plugin Contributions
    0

    Default Re: 2 products on a row in Whats new?

    Hi!
    Sorry, forgot the link.

    www.blingofsweden.se

    /Ola

  6. #6
    Join Date
    Jan 2005
    Location
    USA, St. Louis
    Posts
    3,710
    Plugin Contributions
    9

    Default Re: 2 products on a row in Whats new?

    Add this to your stylesheet:

    .whatsNew2 {float:left; padding:.5em}


    then update the first file you pasted to this:

    Code:
    <?php
    /**
    * Side Box Template
    *
    * @package templateSystem
    * @copyright Copyright 2003-2005 Zen Cart Development Team
    * @copyright Portions Copyright 2003 osCommerce
    * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
    * @version $Id: tpl_whats_new.php 2982 2006-02-07 07:56:41Z birdbrain $
    *
    * rebuild by PeterB
    * www.openhosting.sk
    * peter DOT bohus AT openhosting DOT sk
    *
    */
    
    $content = "";
    $content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent centeredContent">';
    if (($random_whats_new_sidebox_product->fields['products_id']) != ($random_whats_new_sidebox_product2->fields['products_id'])) {
    $content .= '<div class="whatsNew2"><a href="' . zen_href_link(zen_get_info_page($random_whats_new_ sidebox_product->fields['products_id']), 'products_id=' . $random_whats_new_sidebox_product->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $random_whats_new_sidebox_product->fields['products_image'], $random_whats_new_sidebox_product->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '<br />' . $random_whats_new_sidebox_product->fields['products_name'] . '</a><br />' . $whats_new_price;
    /*...uprava pre druhy produkt...*/
    $content .= '</div><div class="whatsNew2"><a href="' . zen_href_link(zen_get_info_page($random_whats_new_ sidebox_product2->fields['products_id']), 'products_id=' . $random_whats_new_sidebox_product2->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $random_whats_new_sidebox_product2->fields['products_image'], $random_whats_new_sidebox_product2->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '<br />' . $random_whats_new_sidebox_product2->fields['products_name'] . '</a><br />' . $whats_new_price2;
    /*...konec upravy...*/
    $content .= '</div></div>';
    } else {
    $content .= '<a href="' . zen_href_link(zen_get_info_page($random_whats_new_ sidebox_product->fields['products_id']), 'products_id=' . $random_whats_new_sidebox_product->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $random_whats_new_sidebox_product->fields['products_image'], $random_whats_new_sidebox_product->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '<br />' . $random_whats_new_sidebox_product->fields['products_name'] . '</a><br />' . $whats_new_price;
    $content .= '</div>';
    }
    
    ?>
    I think that should do it!

 

 

Similar Threads

  1. How to toggle between Whats New Box and Whats New on Main page?
    By Asdesign in forum Basic Configuration
    Replies: 0
    Last Post: 12 Aug 2009, 06:37 PM
  2. Less products in whats new
    By shotormorgh in forum Templates, Stylesheets, Page Layout
    Replies: 7
    Last Post: 17 Mar 2009, 05:11 AM
  3. whats new abd feature products boxes
    By veasnak in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 28 Apr 2008, 06:13 AM
  4. Categories DSP 1, 2 and 3 Per Row. Whats Wrong?
    By bumba000 in forum General Questions
    Replies: 0
    Last Post: 5 Mar 2008, 09:49 PM
  5. Removing the [more] from whats new / new products
    By jonhurlock in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 6 Jan 2008, 12:22 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