Page 1 of 5 123 ... LastLast
Results 1 to 10 of 42
  1. #1

    Default Displaying all products and new products listing in column/grid

    I was in search for displaying all products listing and new products listing in column/grid layout instead of the default row layout.. I searched in this forum a lot.. could not found any appropriate solution to this problem.. a suggestion was to change/modify the code.. Hence, I have done it.

    PS: Currently i am using 4 columns per row. If you want to change the column option per row then you have to modify the following line in the code above:

    PHP Code:
    if(($row_counter-1)%== 0
    change the number 4 to your desired row number. This is a bit hard coding, but i will definitely try to find a better solution.


    zen cart is not allowing me to post so long text/chars.. so i am posting the code in reply to this post

    "The text that you have entered is too long (23785 characters). Please shorten it to 23000 characters long."

  2. #2

    Default Re: Solution: Displaying all products and new products listing in column/grid

    For all products listing, you have to modify the following file:
    includes/templates/YOUR_TEMPLATE/templates/tpl_modules_products_all_listing.php

    if your template is using default folder then it would be:
    includes/templates/template_default/templates/tpl_modules_products_all_listing.php

    The modified code is as below: (I have copied the whole file code.. it's up to you to compare this modified one and the old one )

    PHP Code:
    <?php
    /**
     * Module Template
     *
     * Loaded automatically by index.php?main_page=products_all.<br />
     * Displays listing of All Products
     *
     * @package templateSystem
     * @copyright Copyright 2003-2006 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_modules_products_all_listing.php 4629 2006-09-28 15:29:18Z ajeh $
     */
    ?>
    <table border="0" width="100%" cellspacing="2" cellpadding="2">
              <tr>
                <td colspan="3"><hr /></td>
              </tr>
              <tr class="<?php echo ((int)($row_counter/2)==($row_counter/2)) ? 'productListing-even' 'productListing-odd'?>">
    <?php
      $group_id 
    zen_get_configuration_key_value('PRODUCT_ALL_LIST_GROUP_ID');

      if (
    $products_all_split->number_of_rows 0) {
        
    $products_all $db->Execute($products_all_split->sql_query);
        
    $row_counter 0;
        while (!
    $products_all->EOF) {
          
    $row_counter++;

          if (
    PRODUCT_ALL_LIST_IMAGE != '0') {
            if (
    $products_all->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) {
              
    $display_products_image str_repeat('<br clear="all" />'substr(PRODUCT_ALL_LIST_IMAGE31));
            } else {
              
    $display_products_image '<a href="' zen_href_link(zen_get_info_page($products_all->fields['products_id']), 'products_id=' $products_all->fields['products_id']) . '">' zen_image(DIR_WS_IMAGES $products_all->fields['products_image'], $products_all->fields['products_name'], IMAGE_PRODUCT_ALL_LISTING_WIDTHIMAGE_PRODUCT_ALL_LISTING_HEIGHT) . '</a>' str_repeat('<br clear="all" />'substr(PRODUCT_ALL_LIST_IMAGE31));
            }
          } else {
            
    $display_products_image '';
          }
          if (
    PRODUCT_ALL_LIST_NAME != '0') {
            
    $display_products_name '<a href="' zen_href_link(zen_get_info_page($products_all->fields['products_id']), 'products_id=' $products_all->fields['products_id']) . '"><strong>' $products_all->fields['products_name'] . '</strong></a>' str_repeat('<br clear="all" />'substr(PRODUCT_ALL_LIST_NAME31));
          } else {
            
    $display_products_name '';
          }

          if (
    PRODUCT_ALL_LIST_MODEL != '0' and zen_get_show_product_switch($products_all->fields['products_id'], 'model')) {
            
    $display_products_model TEXT_PRODUCTS_MODEL $products_all->fields['products_model'] . str_repeat('<br clear="all" />'substr(PRODUCT_ALL_LIST_MODEL31));
          } else {
            
    $display_products_model '';
          }

          if (
    PRODUCT_ALL_LIST_WEIGHT != '0' and zen_get_show_product_switch($products_all->fields['products_id'], 'weight')) {
            
    $display_products_weight TEXT_PRODUCTS_WEIGHT $products_all->fields['products_weight'] . TEXT_SHIPPING_WEIGHT str_repeat('<br clear="all" />'substr(PRODUCT_ALL_LIST_WEIGHT31));
          } else {
            
    $display_products_weight '';
          }

          if (
    PRODUCT_ALL_LIST_QUANTITY != '0' and zen_get_show_product_switch($products_all->fields['products_id'], 'quantity')) {
            if (
    $products_all->fields['products_quantity'] <= 0) {
              
    $display_products_quantity TEXT_OUT_OF_STOCK str_repeat('<br clear="all" />'substr(PRODUCT_ALL_LIST_QUANTITY31));
            } else {
              
    $display_products_quantity TEXT_PRODUCTS_QUANTITY $products_all->fields['products_quantity'] . str_repeat('<br clear="all" />'substr(PRODUCT_ALL_LIST_QUANTITY31));
            }
          } else {
            
    $display_products_quantity '';
          }

          if (
    PRODUCT_ALL_LIST_DATE_ADDED != '0' and zen_get_show_product_switch($products_all->fields['products_id'], 'date_added')) {
            
    $display_products_date_added TEXT_DATE_ADDED ' ' zen_date_long($products_all->fields['products_date_added']) . str_repeat('<br clear="all" />'substr(PRODUCT_ALL_LIST_DATE_ADDED31));
          } else {
            
    $display_products_date_added '';
          }

          if (
    PRODUCT_ALL_LIST_MANUFACTURER != '0' and zen_get_show_product_switch($products_all->fields['products_id'], 'manufacturer')) {
            
    $display_products_manufacturers_name = ($products_all->fields['manufacturers_name'] != '' TEXT_MANUFACTURER ' ' $products_all->fields['manufacturers_name'] . str_repeat('<br clear="all" />'substr(PRODUCT_ALL_LIST_MANUFACTURER31)) : '');
          } else {
            
    $display_products_manufacturers_name '';
          }

          if ((
    PRODUCT_ALL_LIST_PRICE != '0' and zen_get_products_allow_add_to_cart($products_all->fields['products_id']) == 'Y') and zen_check_show_prices() == true) {
            
    $products_price zen_get_products_display_price($products_all->fields['products_id']);
            
    $display_products_price TEXT_PRICE ' ' $products_price str_repeat('<br clear="all" />'substr(PRODUCT_ALL_LIST_PRICE31)) . (zen_get_show_product_switch($products_all->fields['products_id'], 'ALWAYS_FREE_SHIPPING_IMAGE_SWITCH') ? (zen_get_product_is_always_free_shipping($products_all->fields['products_id']) ? TEXT_PRODUCT_FREE_SHIPPING_ICON '<br />' '') : '');
          } else {
            
    $display_products_price '';
          }

    // more info in place of buy now
          
    if (PRODUCT_ALL_BUY_NOW != '0' and zen_get_products_allow_add_to_cart($products_all->fields['products_id']) == 'Y') {
            if (
    zen_has_product_attributes($products_all->fields['products_id'])) {
              
    $link '<a href="' zen_href_link(zen_get_info_page($products_all->fields['products_id']), 'products_id=' $products_all->fields['products_id']) . '">' MORE_INFO_TEXT '</a>';
            } else {
    //          $link= '<a href="' . zen_href_link(FILENAME_PRODUCTS_ALL, zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $products_all->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT) . '</a>';
              
    if (PRODUCT_ALL_LISTING_MULTIPLE_ADD_TO_CART && $products_all->fields['products_qty_box_status'] != 0) {
    //            $how_many++;
                
    $link TEXT_PRODUCT_ALL_LISTING_MULTIPLE_ADD_TO_CART "<input type=\"text\" name=\"products_id[" $products_all->fields['products_id'] . "]\" value=\"0\" size=\"4\" />";
              } else {
                
    $link '<a href="' zen_href_link(FILENAME_PRODUCTS_ALLzen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' $products_all->fields['products_id']) . '">' zen_image_button(BUTTON_IMAGE_BUY_NOWBUTTON_BUY_NOW_ALT) . '</a>&nbsp;';
              }
            }

            
    $the_button $link;
            
    $products_link '<a href="' zen_href_link(zen_get_info_page($products_all->fields['products_id']), 'products_id=' $products_all->fields['products_id']) . '">' MORE_INFO_TEXT '</a>';
            
    $display_products_button zen_get_buy_now_button($products_all->fields['products_id'], $the_button$products_link) . '<br />' zen_get_products_quantity_min_units_display($products_all->fields['products_id']) . str_repeat('<br clear="all" />'substr(PRODUCT_ALL_BUY_NOW31));
          } else {
            
    $link '<a href="' zen_href_link(zen_get_info_page($products_all->fields['products_id']), 'products_id=' $products_all->fields['products_id']) . '">' MORE_INFO_TEXT '</a>';
            
    $the_button $link;
            
    $products_link '<a href="' zen_href_link(zen_get_info_page($products_all->fields['products_id']), 'products_id=' $products_all->fields['products_id']) . '">' MORE_INFO_TEXT '</a>';
            
    $display_products_button zen_get_buy_now_button($products_all->fields['products_id'], $the_button$products_link) . '<br />' zen_get_products_quantity_min_units_display($products_all->fields['products_id']) . str_repeat('<br clear="all" />'substr(PRODUCT_ALL_BUY_NOW31));
          }

          if (
    PRODUCT_ALL_LIST_DESCRIPTION != '0') {
            
    $disp_text zen_get_products_description($products_all->fields['products_id']);
            
    $disp_text zen_clean_html($disp_text);

            
    $display_products_description stripslashes(zen_trunc_string($disp_text150'<a href="' zen_href_link(zen_get_info_page($products_all->fields['products_id']), 'products_id=' $products_all->fields['products_id']) . '"> ' MORE_INFO_TEXT '</a>'));
          } else {
            
    $display_products_description '';
          }

    ?>
              
                <?php 
                
    if(($row_counter-1)%== 0)
                {
                
    ?>
                <tr>
                <?php
                
    }
                
    ?>
                <td width="<?php echo IMAGE_PRODUCT_ALL_LISTING_WIDTH 10?>" valign="top" class="main" align="center">
                  <?php
                  
                    $disp_sort_order 
    $db->Execute("select configuration_key, configuration_value from " TABLE_CONFIGURATION " where configuration_group_id='" $group_id "' and (configuration_value >= 1000 and configuration_value <= 1999) order by LPAD(configuration_value,11,0)");
                    while (!
    $disp_sort_order->EOF) {
                      if (
    $disp_sort_order->fields['configuration_key'] == 'PRODUCT_ALL_LIST_IMAGE') {
                        echo 
    $display_products_image;
                      }
                      
                      if (
    $disp_sort_order->fields['configuration_key'] == 'PRODUCT_ALL_BUY_NOW') {
                        echo 
    $display_products_button;
                      }

                      if (
    $disp_sort_order->fields['configuration_key'] == 'PRODUCT_ALL_LIST_NAME') {
                        echo 
    $display_products_name;
                      }                  
                      
                      if (
    $disp_sort_order->fields['configuration_key'] == 'PRODUCT_ALL_LIST_PRICE') {
                        echo 
    $display_products_price;
                      }
                      
                      
    $disp_sort_order->MoveNext();
                    }
                    
                    
    $disp_sort_order $db->Execute("select configuration_key, configuration_value from " TABLE_CONFIGURATION " where configuration_group_id='" $group_id "' and (configuration_value >= 2000 and configuration_value <= 2999) order by LPAD(configuration_value,11,0)");
                    while (!
    $disp_sort_order->EOF) {
                      if (
    $disp_sort_order->fields['configuration_key'] == 'PRODUCT_ALL_LIST_IMAGE') {
                        echo 
    $display_products_image;
                      }
                     
                      if (
    $disp_sort_order->fields['configuration_key'] == 'PRODUCT_ALL_BUY_NOW') {
                        echo 
    $display_products_button;
                      }

                      if (
    $disp_sort_order->fields['configuration_key'] == 'PRODUCT_ALL_LIST_NAME') {
                        echo 
    $display_products_name;
                      }                  
                      
                      if (
    $disp_sort_order->fields['configuration_key'] == 'PRODUCT_ALL_LIST_PRICE') {
                        echo 
    $display_products_price;
                      }
                      
                      
    $disp_sort_order->MoveNext();
                    }
                  
    ?>
                </td>
                
              
             
    <?php
          $products_all
    ->MoveNext();
        }
      } else {
    ?>
              <tr>
                <td class="main" colspan="2"><?php echo TEXT_NO_ALL_PRODUCTS?></td>
              </tr>
    <?php
      
    }
    ?>
    </tr>
    </table>

  3. #3

    Default Re: Solution: Displaying all products and new products listing in column/grid

    For new products listing, you have to modify the following file:
    includes/templates/YOUR_TEMPLATE/templates/tpl_modules_products_new_listing.php

    if your template is using default folder then it would be:
    includes/templates/template_default/templates/tpl_modules_products_new_listing.php

    The modified code is as below: (I have copied the whole file code.. it's up to you to compare this modified one and the old one )

    PHP Code:
    <?php
    /**
     * Module Template
     *
     * Loaded automatically by index.php?main_page=products_new.<br />
     * Displays listing of New Products
     *
     * @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_modules_products_new_listing.php 4629 2006-09-28 15:29:18Z ajeh $
     */
    ?>
    <table border="0" width="100%" cellspacing="2" cellpadding="2">
              <tr>
                <td colspan="3"><hr /></td>
              </tr>
               <tr>
    <?php
      $group_id 
    zen_get_configuration_key_value('PRODUCT_NEW_LIST_GROUP_ID');

      if (
    $products_new_split->number_of_rows 0) {
        
    $products_new $db->Execute($products_new_split->sql_query);
        
    $row_counter 0;
        while (!
    $products_new->EOF) {
            
    $row_counter++;
          if (
    PRODUCT_NEW_LIST_IMAGE != '0') {
            if (
    $products_new->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) {
              
    $display_products_image str_repeat('<br clear="all" />'substr(PRODUCT_NEW_LIST_IMAGE31));
            } else {
              
    $display_products_image '<a href="' zen_href_link(zen_get_info_page($products_new->fields['products_id']), 'products_id=' $products_new->fields['products_id']) . '">' zen_image(DIR_WS_IMAGES $products_new->fields['products_image'], $products_new->fields['products_name'], IMAGE_PRODUCT_NEW_LISTING_WIDTHIMAGE_PRODUCT_NEW_LISTING_HEIGHT) . '</a>' str_repeat('<br clear="all" />'substr(PRODUCT_NEW_LIST_IMAGE31));
            }
          } else {
            
    $display_products_image '';
          }

          if (
    PRODUCT_NEW_LIST_NAME != '0') {
            
    $display_products_name '<a href="' zen_href_link(zen_get_info_page($products_new->fields['products_id']), 'products_id=' $products_new->fields['products_id']) . '"><strong>' $products_new->fields['products_name'] . '</strong></a>' str_repeat('<br clear="all" />'substr(PRODUCT_NEW_LIST_NAME31));
          } else {
            
    $display_products_name '';
          }

          if (
    PRODUCT_NEW_LIST_MODEL != '0' and zen_get_show_product_switch($products_new->fields['products_id'], 'model')) {
            
    $display_products_model TEXT_PRODUCTS_MODEL $products_new->fields['products_model'] . str_repeat('<br clear="all" />'substr(PRODUCT_NEW_LIST_MODEL31));
          } else {
            
    $display_products_model '';
          }

          if (
    PRODUCT_NEW_LIST_WEIGHT != '0' and zen_get_show_product_switch($products_new->fields['products_id'], 'weight')) {
            
    $display_products_weight '<br />' TEXT_PRODUCTS_WEIGHT $products_new->fields['products_weight'] . TEXT_SHIPPING_WEIGHT str_repeat('<br clear="all" />'substr(PRODUCT_NEW_LIST_WEIGHT31));
          } else {
            
    $display_products_weight '';
          }

          if (
    PRODUCT_NEW_LIST_QUANTITY != '0' and zen_get_show_product_switch($products_new->fields['products_id'], 'quantity')) {
            if (
    $products_new->fields['products_quantity'] <= 0) {
              
    $display_products_quantity TEXT_OUT_OF_STOCK str_repeat('<br clear="all" />'substr(PRODUCT_NEW_LIST_QUANTITY31));
            } else {
              
    $display_products_quantity TEXT_PRODUCTS_QUANTITY $products_new->fields['products_quantity'] . str_repeat('<br clear="all" />'substr(PRODUCT_NEW_LIST_QUANTITY31));
            }
          } else {
            
    $display_products_quantity '';
          }

          if (
    PRODUCT_NEW_LIST_DATE_ADDED != '0' and zen_get_show_product_switch($products_new->fields['products_id'], 'date_added')) {
            
    $display_products_date_added TEXT_DATE_ADDED ' ' zen_date_long($products_new->fields['products_date_added']) . str_repeat('<br clear="all" />'substr(PRODUCT_NEW_LIST_DATE_ADDED31));
          } else {
            
    $display_products_date_added '';
          }

          if (
    PRODUCT_NEW_LIST_MANUFACTURER != '0' and zen_get_show_product_switch($products_new->fields['products_id'], 'manufacturer')) {
            
    $display_products_manufacturers_name = ($products_new->fields['manufacturers_name'] != '' TEXT_MANUFACTURER ' ' $products_new->fields['manufacturers_name'] . str_repeat('<br clear="all" />'substr(PRODUCT_NEW_LIST_MANUFACTURER31)) : '');
          } else {
            
    $display_products_manufacturers_name '';
          }

          if ((
    PRODUCT_NEW_LIST_PRICE != '0' and zen_get_products_allow_add_to_cart($products_new->fields['products_id']) == 'Y') and zen_check_show_prices() == true) {
            
    $products_price zen_get_products_display_price($products_new->fields['products_id']);
            
    $display_products_price TEXT_PRICE ' ' $products_price str_repeat('<br clear="all" />'substr(PRODUCT_NEW_LIST_PRICE31)) . (zen_get_show_product_switch($products_new->fields['products_id'], 'ALWAYS_FREE_SHIPPING_IMAGE_SWITCH') ? (zen_get_product_is_always_free_shipping($products_new->fields['products_id']) ? TEXT_PRODUCT_FREE_SHIPPING_ICON '<br />' '') : '');
          } else {
            
    $display_products_price '';
          }

    // more info in place of buy now
          
    if (PRODUCT_NEW_BUY_NOW != '0' and zen_get_products_allow_add_to_cart($products_new->fields['products_id']) == 'Y') {
            if (
    zen_has_product_attributes($products_new->fields['products_id'])) {
              
    $link '<a href="' zen_href_link(zen_get_info_page($products_new->fields['products_id']), 'products_id=' $products_new->fields['products_id']) . '">' MORE_INFO_TEXT '</a>';
            } else {
    //          $link= '<a href="' . zen_href_link(FILENAME_PRODUCTS_NEW, zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $products_new->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT) . '</a>';
              
    if (PRODUCT_NEW_LISTING_MULTIPLE_ADD_TO_CART && $products_new->fields['products_qty_box_status'] != 0) {
    //            $how_many++;
                
    $link TEXT_PRODUCT_NEW_LISTING_MULTIPLE_ADD_TO_CART "<input type=\"text\" name=\"products_id[" $products_new->fields['products_id'] . "]\" value=\"0\" size=\"4\" />";
              } else {
                
    $link '<a href="' zen_href_link(FILENAME_PRODUCTS_NEWzen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' $products_new->fields['products_id']) . '">' zen_image_button(BUTTON_IMAGE_BUY_NOWBUTTON_BUY_NOW_ALT) . '</a>&nbsp;';
              }
            }

            
    $the_button $link;
            
    $products_link '<a href="' zen_href_link(zen_get_info_page($products_new->fields['products_id']), 'products_id=' $products_new->fields['products_id']) . '">' MORE_INFO_TEXT '</a>';
            
    $display_products_button zen_get_buy_now_button($products_new->fields['products_id'], $the_button$products_link) . '<br />' zen_get_products_quantity_min_units_display($products_new->fields['products_id']) . str_repeat('<br clear="all" />'substr(PRODUCT_NEW_BUY_NOW31));
          } else {
            
    $link '<a href="' zen_href_link(zen_get_info_page($products_new->fields['products_id']), 'products_id=' $products_new->fields['products_id']) . '">' MORE_INFO_TEXT '</a>';
            
    $the_button $link;
            
    $products_link '<a href="' zen_href_link(zen_get_info_page($products_new->fields['products_id']), 'products_id=' $products_new->fields['products_id']) . '">' MORE_INFO_TEXT '</a>';
            
    $display_products_button zen_get_buy_now_button($products_new->fields['products_id'], $the_button$products_link) . '<br />' zen_get_products_quantity_min_units_display($products_new->fields['products_id']) . str_repeat('<br clear="all" />'substr(PRODUCT_NEW_BUY_NOW31));
          }

          if (
    PRODUCT_NEW_LIST_DESCRIPTION != '0') {
            
    $disp_text zen_get_products_description($products_new->fields['products_id']);
            
    $disp_text zen_clean_html($disp_text);

            
    $display_products_description stripslashes(zen_trunc_string($disp_text150'<a href="' zen_href_link(zen_get_info_page($products_new->fields['products_id']), 'products_id=' $products_new->fields['products_id']) . '"> ' MORE_INFO_TEXT '</a>'));
          } else {
            
    $display_products_description '';
          }

    ?>
                <?php 
                
    if(($row_counter-1)%== 0)
                {
                
    ?>
                <tr>
                <?php
                
    }
                
    ?>
                <td width="<?php echo IMAGE_PRODUCT_NEW_LISTING_WIDTH 10?>" valign="top" class="main" align="center">
                  <?php
                    $disp_sort_order 
    $db->Execute("select configuration_key, configuration_value from " TABLE_CONFIGURATION " where configuration_group_id='" $group_id "' and (configuration_value >= 1000 and configuration_value <= 1999) order by LPAD(configuration_value,11,0)");
                    while (!
    $disp_sort_order->EOF) {
                      if (
    $disp_sort_order->fields['configuration_key'] == 'PRODUCT_NEW_LIST_IMAGE') {
                        echo 
    $display_products_image;
                      }
                      
                      if (
    $disp_sort_order->fields['configuration_key'] == 'PRODUCT_NEW_LIST_NAME') {
                        echo 
    $display_products_name;
                      }                  
                      
                      if (
    $disp_sort_order->fields['configuration_key'] == 'PRODUCT_NEW_LIST_PRICE') {
                        echo 
    $display_products_price;
                      }       
                      if (
    $disp_sort_order->fields['configuration_key'] == 'PRODUCT_NEW_BUY_NOW') {
                        echo 
    $display_products_button;
                      }
                      
    $disp_sort_order->MoveNext();
                    }
                    
                    
    $disp_sort_order $db->Execute("select configuration_key, configuration_value from " TABLE_CONFIGURATION " where configuration_group_id='" $group_id "' and (configuration_value >= 2000 and configuration_value <= 2999) order by LPAD(configuration_value,11,0)");
                    while (!
    $disp_sort_order->EOF) {
                      if (
    $disp_sort_order->fields['configuration_key'] == 'PRODUCT_NEW_LIST_IMAGE') {
                        echo 
    $display_products_image;
                      }            
                        
                      if (
    $disp_sort_order->fields['configuration_key'] == 'PRODUCT_NEW_LIST_NAME') {
                        echo 
    $display_products_name;
                      }                                   
                      if (
    $disp_sort_order->fields['configuration_key'] == 'PRODUCT_NEW_LIST_PRICE') {
                        echo 
    $display_products_price;
                      } 
                      if (
    $disp_sort_order->fields['configuration_key'] == 'PRODUCT_NEW_BUY_NOW') {
                        echo 
    $display_products_button;
                      }
                     
                      
    $disp_sort_order->MoveNext();
                    }
                  
    ?>
                </td>         

              
    <?php
          $products_new
    ->MoveNext();
        }
      } else {
    ?>
              <tr>
                <td class="main" colspan="2"><?php echo TEXT_NO_NEW_PRODUCTS?></td>
              </tr>
    <?php
      
    }
    ?>
    </tr>
    </table>

    PS: You can make a backup of your files and copy these files to your zen cart folder. Have a try. Implement it. Hope you will find the solution.

    Happy phping! Happy zening!

  4. #4

    Default Re: Solution: Displaying all products and new products listing in column/grid

    The logic implemented in the above code is as below:
    PHP Code:
    <html>
    <body>

    <table border=1>
        <tr>
        <?php
        $k
    =0;
        while (
    $k<9)
        {
            
    $k++;
            
    ?>
            <?php 
            
    if(($k-1)%== 0// starting a new row after 3 columns
            
    {
            
    ?>
                <tr>
            <?php
            
    // end of if
            
    ?>    
            <td>
            <?php 
                
    echo $k "// printing the number in each column cell
            
    ?>
            </td>
        <?php     
        
    // end of while
        
    ?>
    </tr>
    </table>

    </body>
    </html>
    Last edited by chapagain; 30 Nov 2007 at 09:05 AM.

  5. #5
    Join Date
    Aug 2006
    Location
    Singapore
    Posts
    166
    Plugin Contributions
    1

    Default Re: Solution: Displaying all products and new products listing in column/grid

    Wonderful!! A great contibution, surely will help many folks including me.
    Responsive ZenCart Templates that automatically adapt itself with iPad, iPhone, BlackBerry, Androids and any monitor screen size
    Buy a coffee for Zen-Cart devs. http://www.zen-cart.com/donate

  6. #6
    Join Date
    Nov 2008
    Posts
    14
    Plugin Contributions
    0

    Default Re: Solution: Displaying all products and new products listing in column/grid

    AWESOME AWESOME AWESOME!!!!

    You du man

  7. #7
    Join Date
    Oct 2006
    Posts
    5,486
    Plugin Contributions
    12

    Default Re: Solution: Displaying all products and new products listing in column/grid

    I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

  8. #8
    Join Date
    May 2006
    Location
    UK
    Posts
    32
    Plugin Contributions
    0

    Default Re: Solution: Displaying all products and new products listing in column/grid

    It's a perfect solution!
    To be simple and genuine - we are naturally the same.
    Review My Zen Cart Shop - Clothing & Accessories Wholesale , Silk Store , Studio Flash Lights

  9. #9
    Join Date
    Oct 2009
    Posts
    6
    Plugin Contributions
    0

    Default Re: Solution: Displaying all products and new products listing in column/grid

    I like this solution because you don't have to modifiy the database and it's just modifying the override files.

    I'm wondering if this code is still good for version 1.3.8a ?

  10. #10
    Join Date
    Nov 2009
    Location
    Aurora, IN
    Posts
    37
    Plugin Contributions
    0

    Default Re: Solution: Displaying all products and new products listing in column/grid

    I am not good with php, but your coding worked great on those two pages. Can you post the proper coding for the featured products page as well? And how do I get the category pages to show up in columnar format?

 

 
Page 1 of 5 123 ... LastLast

Similar Threads

  1. Column Layout Grid 2 products in 4 column display
    By Develop&Promote in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 8 Feb 2011, 04:26 AM
  2. Product Listing - Column Grid - Padding btwn Products
    By TurtleDove in forum Setting Up Categories, Products, Attributes
    Replies: 7
    Last Post: 19 Oct 2010, 02:23 AM
  3. Subcategory of Products Not Displaying In A Grid
    By nvcrossroads in forum Templates, Stylesheets, Page Layout
    Replies: 8
    Last Post: 1 May 2010, 03:26 PM
  4. Home Page Products Displaying in a Single Column and not in a Grid Display
    By probbins in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 23 Feb 2009, 01:42 AM
  5. Major issues with Column Layout / Grid Layout for Products Listing
    By kinget in forum All Other Contributions/Addons
    Replies: 5
    Last Post: 27 Jul 2007, 10:11 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
  •