Page 2 of 4 FirstFirst 1234 LastLast
Results 11 to 20 of 37
  1. #11
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Product Position - grid layout

    Unfortunately some of the centerbox displays don't have any divs, spans, or other tags to work with. You will have to go into the relevant file and insert what tags you need.

  2. #12
    Join Date
    Jul 2008
    Posts
    362
    Plugin Contributions
    0

    Default Re: Product Position - grid layout

    Quote Originally Posted by gjh42 View Post
    Unfortunately some of the centerbox displays don't have any divs, spans, or other tags to work with. You will have to go into the relevant file and insert what tags you need.
    Hey Glenn,

    Do you know what file i need to edit to add divs for new products for "month"?

    Thanks

  3. #13
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Product Position - grid layout

    /includes/modules/youe_template/new_products.php.

    This is the line to add tags to:
    PHP Code:
        $list_box_contents[$row][$col] = array('params' => 'class="centerBoxContentsNew centeredContent back"' ' ' 'style="width:' $col_width '%;"',
        
    'text' => (($new_products->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) ? '' '<a href="' zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'cPath=' $productsInCategory[$new_products->fields['products_id']] . '&products_id=' $new_products->fields['products_id']) . '">' zen_image(DIR_WS_IMAGES $new_products->fields['products_image'], $new_products->fields['products_name'], IMAGE_PRODUCT_NEW_WIDTHIMAGE_PRODUCT_NEW_HEIGHT) . '</a><br />') . '<a href="' zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'cPath=' $productsInCategory[$new_products->fields['products_id']] . '&products_id=' $new_products->fields['products_id']) . '">' $new_products->fields['products_name'] . '</a><br />' $products_price); 

  4. #14
    Join Date
    Jul 2008
    Posts
    362
    Plugin Contributions
    0

    Default Re: Product Position - grid layout

    Quote Originally Posted by gjh42 View Post
    /includes/modules/youe_template/new_products.php.

    This is the line to add tags to:
    PHP Code:
        $list_box_contents[$row][$col] = array('params' => 'class="centerBoxContentsNew centeredContent back"' ' ' 'style="width:' $col_width '%;"',
        
    'text' => (($new_products->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) ? '' '<a href="' zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'cPath=' $productsInCategory[$new_products->fields['products_id']] . '&products_id=' $new_products->fields['products_id']) . '">' zen_image(DIR_WS_IMAGES $new_products->fields['products_image'], $new_products->fields['products_name'], IMAGE_PRODUCT_NEW_WIDTHIMAGE_PRODUCT_NEW_HEIGHT) . '</a><br />') . '<a href="' zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'cPath=' $productsInCategory[$new_products->fields['products_id']] . '&products_id=' $new_products->fields['products_id']) . '">' $new_products->fields['products_name'] . '</a><br />' $products_price); 
    Sorry glenn, how do i add the tags?

  5. #15
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Product Position - grid layout

    I kinda thought you'd be asking that :)
    To move the price around, concentrate on the very end of that line:
    PHP Code:
    '</a><br />' $products_price); 
    PHP Code:
    '</a><br /><span class="centerBoxPrice">' $products_price) . '</span>'
    Then style
    .centerBoxPrice {} in your stylesheet.

  6. #16
    Join Date
    Jul 2008
    Posts
    362
    Plugin Contributions
    0

    Default Re: Product Position - grid layout

    Quote Originally Posted by gjh42 View Post
    I kinda thought you'd be asking that :)
    To move the price around, concentrate on the very end of that line:
    PHP Code:
    '</a><br />' $products_price); 
    PHP Code:
    '</a><br /><span class="centerBoxPrice">' $products_price) . '</span>'
    Then style
    .centerBoxPrice {} in your stylesheet.
    OK i changed the new_products fine to what u mentioned above but now no produstcs show on the homepage... see pic
    Attached Images Attached Images  

  7. #17
    Join Date
    Jul 2008
    Posts
    362
    Plugin Contributions
    0

    Default Re: Product Position - grid layout

    Here is my code with the modification above....

    PHP Code:
    <?php
    /**
     * new_products.php module
     *
     * @package modules
     * @copyright Copyright 2003-2007 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: new_products.php 6424 2007-05-31 05:59:21Z ajeh $
     */
    if (!defined('IS_ADMIN_FLAG')) {
      die(
    'Illegal Access');
    }

    //get function index_listing
    include_once(DIR_WS_FUNCTIONS.'extra_functions/index_listing.php');

    // initialize vars
    $categories_products_id_list '';
    $list_of_products '';
    $new_products_query '';

    $display_limit zen_get_new_date_range();

    if ( ((
    $manufacturers_id && $_GET['filter_id'] == 0) || $_GET['music_genre_id'] > || $_GET['record_company_id'] > 0) || (!isset($new_products_category_id) || $new_products_category_id == '0') ) {
      
    $new_products_query "select distinct p.products_id, p.products_image, p.products_tax_class_id, pd.products_name,
                                    p.products_date_added, p.products_price, p.products_type, p.master_categories_id
                               from " 
    TABLE_PRODUCTS " p, " TABLE_PRODUCTS_DESCRIPTION " pd
                               where p.products_id = pd.products_id
                               and pd.language_id = '" 
    . (int)$_SESSION['languages_id'] . "'
                               and   p.products_status = 1 " 
    $display_limit;
    } else {
      
    // get all products and cPaths in this subcat tree
      
    $productsInCategory zen_get_categories_products_list( (($manufacturers_id && $_GET['filter_id'] > 0) ? zen_get_generated_category_path_rev($_GET['filter_id']) : $cPath), falsetrue0$display_limit);

      if (
    is_array($productsInCategory) && sizeof($productsInCategory) > 0) {
        
    // build products-list string to insert into SQL query
        
    foreach($productsInCategory as $key => $value) {
          
    $list_of_products .= $key ', ';
        }
        
    $list_of_products substr($list_of_products0, -2); // remove trailing comma

        
    $new_products_query "select distinct p.products_id, p.products_image, p.products_tax_class_id, pd.products_name,
                                      p.products_date_added, p.products_price, p.products_type, p.master_categories_id
                               from " 
    TABLE_PRODUCTS " p, " TABLE_PRODUCTS_DESCRIPTION " pd
                               where p.products_id = pd.products_id
                               and pd.language_id = '" 
    . (int)$_SESSION['languages_id'] . "'
                               and p.products_status = 1
                               and p.products_id in (" 
    $list_of_products ")";  
      }
    }

    if (isset(
    $new_products_category_id) && $new_products_category_id != 0) {
      
    $category_title zen_get_categories_name((int)$new_products_category_id);
      
    $title '<h2 class="centerBoxHeading">' sprintf(TABLE_HEADING_NEW_PRODUCTSstrftime('%B')) . ($category_title != '' ' - ' $category_title '' ) . '</h2>';
    } else {
      
    $title '<h2 class="centerBoxHeading">' sprintf(TABLE_HEADING_NEW_PRODUCTSstrftime('%B')) . '</h2>';
    }
            
    if(
    INDEX_NEW_USE_PRODUCT_LISTING == '2')
        
    extract(index_listing($new_products_queryMAX_DISPLAY_NEW_PRODUCTSSHOW_PRODUCT_INFO_COLUMNS_NEW_PRODUCTSIMAGE_PRODUCT_NEW_WIDTHIMAGE_PRODUCT_NEW_HEIGHT$new_products_category_idTABLE_HEADING_NEW_PRODUCTS,'zc_show_new_products'));
    elseif(
    INDEX_NEW_USE_PRODUCT_LISTING == '3'){
        
    $listing_sql $new_products_query;
        
    $show_submit zen_run_normal();

        
    $define_list = array('PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL,
        
    'PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME,
        
    'PRODUCT_LIST_MANUFACTURER' => PRODUCT_LIST_MANUFACTURER,
        
    'PRODUCT_LIST_PRICE' => PRODUCT_LIST_PRICE,
        
    'PRODUCT_LIST_QUANTITY' => PRODUCT_LIST_QUANTITY,
        
    'PRODUCT_LIST_WEIGHT' => PRODUCT_LIST_WEIGHT,
        
    'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE);
        
        
    /*                         ,
        'PRODUCT_LIST_BUY_NOW' => PRODUCT_LIST_BUY_NOW);
        */
        
    asort($define_list);
        
    reset($define_list);
        
    $column_list = array();
        foreach (
    $define_list as $key => $value)
        {
        if (
    $value 0$column_list[] = $key;
        }
        
    $productListingId 'newProducts';
        
    $is_index_listing true;
        require(
    $template->get_template_dir('tpl_modules_product_listing.php',DIR_WS_TEMPLATE$current_page_base,'templates'). '/tpl_modules_product_listing.php');
        
    $is_index_listing false;
    }
    elseif(
    INDEX_NEW_USE_PRODUCT_LISTING == '1'){
        if (
    $new_products_query != ''$new_products $db->ExecuteRandomMulti($new_products_queryMAX_DISPLAY_NEW_PRODUCTS);
        
        
    $row 0;
        
    $col 0;
        
    $list_box_contents = array();
        
        
    $num_products_count = ($new_products_query == '') ? $new_products->RecordCount();
        
        
    // show only when 1 or more
        
    if ($num_products_count 0) {
          if (
    $num_products_count SHOW_PRODUCT_INFO_COLUMNS_NEW_PRODUCTS || SHOW_PRODUCT_INFO_COLUMNS_NEW_PRODUCTS == ) {
            
    $col_width floor(100/$num_products_count) - 1.5;
          } else {
            
    $col_width floor(100/SHOW_PRODUCT_INFO_COLUMNS_NEW_PRODUCTS) - 1.5;
          }
        
          while (!
    $new_products->EOF) {
            
    $products_price zen_get_products_display_price($new_products->fields['products_id']);
    if (!isset(
    $productsInCategory[$new_products->fields['products_id']])) $productsInCategory[$new_products->fields['products_id']] = zen_get_generated_category_path_rev($new_products->fields['master_categories_id']);

      
    $my_more_info '';
      
    $my_more_info '<br />' '<a href="' zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'cPath=' zen_get_generated_category_path_rev($new_products->fields['master_categories_id']) . '&products_id=' $new_products->fields['products_id']) . '">' MORE_INFO_TEXT '</a>';
      
    $products_price $products_price $my_more_info;
            
            
    $list_box_contents[$row][$col] = array('params' => 'class="centerBoxContentsNew centeredContent back"' ' ' 'style="width:' $col_width '%;"',
    'text' => (($new_products->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) ? '' '<a href="' zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'cPath=' $productsInCategory[$new_products->fields['products_id']] . '&products_id=' $new_products->fields['products_id']) . '">' zen_image(DIR_WS_IMAGES $new_products->fields['products_image'], $new_products->fields['products_name'], IMAGE_PRODUCT_NEW_WIDTHIMAGE_PRODUCT_NEW_HEIGHT) . '</a><br />') . '<a href="' zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'cPath=' $productsInCategory[$new_products->fields['products_id']] . '&products_id=' $new_products->fields['products_id']) . '">' $new_products->fields['products_name'] . '</a><br /><span class="centerBoxPrice">' $products_price) . '</span>';
        
            
    $col ++;
            if (
    $col > (SHOW_PRODUCT_INFO_COLUMNS_NEW_PRODUCTS 1)) {
              
    $col 0;
              
    $row ++;
            }
            
    $new_products->MoveNextRandom();
          }
        
          if (
    $new_products->RecordCount() > 0) {
            
    $zc_show_new_products true;
          }
        }
    }

  8. #18
    Join Date
    Jul 2008
    Posts
    362
    Plugin Contributions
    0

    Default Re: Product Position - grid layout

    Also Glenn, to get my pricing and buy now/details buttons to always align for the products in the category lisitng i used this in my stylesheet:

    .itemTitle {
    display:block;
    height: 50px;
    }

    I assume by the name of the div that this is styling the product tite because this is what causes it to be on differnet lines the title can range from 1,2, 3 oor 4 lines.

  9. #19
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Product Position - grid layout

    Sorry, I overlooked the ) in that soup of code... the </span> needs to be inside that. So
    PHP Code:
    '</a><br /><span class="centerBoxPrice">' $products_price '</span>'); 

  10. #20
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Product Position - grid layout

    If you want to give the name a defined height to keep the price in the same place, add a class to the <a here:
    PHP Code:
    IMAGE_PRODUCT_NEW_HEIGHT) . '</a><br />') . '<a href="' zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'cPath=' $productsInCategory[$new_products->fields['products_id']] . '&products_id=' $new_products->fields['products_id']) . '">' $new_products->fields['products_name'] . '</a><br /><span class="centerBoxPrice">' $products_price '</span>'); 
    PHP Code:
     '<a class="centerBoxName" href="' 
    Style as:

    a.centerBoxName {display: block; height: 50px;}

 

 
Page 2 of 4 FirstFirst 1234 LastLast

Similar Threads

  1. Change Position Of Product Name With Grid View
    By hcd888 in forum Addon Templates
    Replies: 6
    Last Post: 16 Feb 2012, 04:13 PM
  2. Grid layout to product listing
    By successfi in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 15 Jan 2012, 03:50 PM
  3. Grid Product Layout borders
    By adnimas5 in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 13 Nov 2008, 07:57 PM
  4. Column Grid Product Layout
    By charmedbytina2 in forum All Other Contributions/Addons
    Replies: 3
    Last Post: 2 May 2008, 03:59 PM
  5. Column Grid Layout - trouble with product listing/layout
    By mellonade in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 4 May 2007, 11:18 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