Results 1 to 10 of 16

Hybrid View

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

    Idea or Suggestion Product list replacing dropdown manufacturer filter with images

    Hi zenners,

    i need to replace the dropdown manufacturer sorter in the product list with the manufacturer images. so, instead of having the dropdown the user will sort per manufacturer products by clicking the appropriate manufacturer image. all the images should be listed in a columnar format.


    this would be also a big style improvement in my opinion.

    Any ideas on how to do this?

  2. #2
    Join Date
    Apr 2007
    Posts
    36
    Plugin Contributions
    0

    Default Re: Product list replacing dropdown manufacturer filter with images


  3. #3
    Join Date
    Sep 2007
    Posts
    2
    Plugin Contributions
    0

    Default Re: Product list replacing dropdown manufacturer filter with images

    pls show me how you can do that

  4. #4
    Join Date
    Apr 2007
    Posts
    36
    Plugin Contributions
    0

    Default Re: Product list replacing dropdown manufacturer filter with images

    Quote Originally Posted by itmanvn View Post
    pls show me how you can do that
    Actually I think what i've done is not the right way to do it but it works and i coded everything without any help from this forum as usual. In my posts nobody mind to answer.

    so, in tpl_index_product_list.php put the following code somewhere you want the logo to appear.

    PHP Code:
    <?php
      
    if (!isset($_GET['manufacturers_id'])){
                                 
    ?>
    <table width="100%" border="0" cellspacing="1">
      <tr>
    <?php 
            
    for ($i=1$n=sizeof($options); $i<$n$i++) {

         
    $manufacturer_image_sort_query "select m.manufacturers_id, m.manufacturers_name, m.manufacturers_image,
                                      mi.manufacturers_url
                               from " 
    TABLE_MANUFACTURERS " m
                               left join " 
    TABLE_MANUFACTURERS_INFO " mi
                               on (m.manufacturers_id = mi.manufacturers_id
                               and mi.languages_id = '" 
    . (int)$_SESSION['languages_id'] . "'), " TABLE_PRODUCTS " p
                               where  p.manufacturers_id  = '" 
    . (int)$options[$i]['id'] . "'
                               and p.manufacturers_id = m.manufacturers_id"
    ;
                                                      
                    
    $manufacturer_image_sort $db->Execute($manufacturer_image_sort_query);
                    if (
    $manufacturer_image_sort->RecordCount() > 0) {
                    
           echo 
    '<td><a href="/index.php?main_page=index&cPath=' $cPath '&filter_id=' $options[$i]['id'] . '">' zen_image(DIR_WS_IMAGES $manufacturer_image_sort->fields['manufacturers_image'], $manufacturer_image_sort->fields['manufacturers_name']) . '</a></td>'."\r\n";
          }
        }
    ?>
      </tr>
    </table>    
    <?php
         
    }
    ?>

    The code does work but with limitations for now. if you have too many logos they will be costrained into one single line. i will fix it soon if i need that.

    The ugly thing of this is that the code execute a MySQL query for every single logo displayed... very bad but for few logos is ok. I'm not that good with SQL query, i don't know how to select more than one record and put the risults in an array. i tried some solutions with no result.
    Last edited by roboto; 27 Sep 2007 at 06:16 PM.

  5. #5
    Join Date
    May 2005
    Location
    Sweden
    Posts
    151
    Plugin Contributions
    0

    Default Re: Product list replacing dropdown manufacturer filter with images

    Thank you, wonderful!

    Also I have to your wicked design!

  6. #6
    Join Date
    Apr 2007
    Posts
    36
    Plugin Contributions
    0

    Default Re: Product list replacing dropdown manufacturer filter with images

    This an improved version with rows

    PHP Code:
    <?php
     
    ($options[$i]['id']);
      if (!isset(
    $_GET['manufacturers_id'])){
                                 
    ?>
    <table width="100%" border="0" cellspacing="0">
      <tr>
    <?php 
            
    for ($i=1$n=sizeof($options); $i<$n$i++) {

         
    $manufacturer_image_sort_query "select m.manufacturers_id, m.manufacturers_name, m.manufacturers_image,
                                      mi.manufacturers_url
                               from " 
    TABLE_MANUFACTURERS " m
                               left join " 
    TABLE_MANUFACTURERS_INFO " mi
                               on (m.manufacturers_id = mi.manufacturers_id
                               and mi.languages_id = '" 
    . (int)$_SESSION['languages_id'] . "'), " TABLE_PRODUCTS " p
                               where  p.manufacturers_id  = '" 
    . (int)$options[$i]['id'] . "'
                               and p.manufacturers_id = m.manufacturers_id"
    ;
                                                      
                    
    $manufacturer_image_sort $db->Execute($manufacturer_image_sort_query);
                    if (
    $manufacturer_image_sort->RecordCount() > 0) {
                    
           echo 
    '<td width="100" align="center"><span class="transparent"><a href="/index.php?main_page=index&cPath=' $cPath '&filter_id=' $options[$i]['id'] . '">' zen_image(DIR_WS_IMAGES $manufacturer_image_sort->fields['manufacturers_image'], $manufacturer_image_sort->fields['manufacturers_name']) . '</a></span></td>'."\r\n";
          }
            if ( ((
    $i+1) % 8) == ) echo $newrow="</tr><tr>"// change 6 to 8 and see
        
    }
    ?>
      </tr>
    </table>    
    <?php
         
    }
    ?>
    Thanx for the compliments ;)

 

 

Similar Threads

  1. How to select existing product images on server?
    By ronlee67 in forum Setting Up Categories, Products, Attributes
    Replies: 12
    Last Post: 15 Mar 2010, 05:58 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
  •