Results 1 to 7 of 7
  1. #1
    Join Date
    Oct 2006
    Posts
    149
    Plugin Contributions
    0

    Adding Artist sidebox

    Hi

    I hope zen gurus can point me to a right direction.

    I am adding a Recording Artist sidebox (similar to Record Companies). I have done everything similar to

    http://www.zen-cart.com/forum/showth...=record+artist

    (with some small modifications)

    A good thing is that I have got an artists dropdown menu in place and am not getting any warnings. A bad thing is that I cannot get the search results listed - wheh I click on Artist in the dropdown menu of the sidebox, I am getting to the main page with no product list selection (no "Filter results by..." also).

    Where can I track the search results from the database - how it is desplayed on the result page? Also, if there are no matching results, I should get "no results" message, but I cannot get it.

    Could you please, give me a hint what and where to check?

    Thanks

    Andy

  2. #2
    Join Date
    Oct 2006
    Posts
    149
    Plugin Contributions
    0

    Default Re: Adding Artist sidebox

    I have almost found the reason - there should be some page displaying the search resilts - prod list for the Record artist search, but I caannot find where to add this. My source code shows

    <div class="centerColumn" id="indexDefault">

    instead of

    <div class="centerColumn" id="indexProductList">

    Please, help

    Thanks

    Andy

  3. #3
    Join Date
    Aug 2006
    Posts
    14
    Plugin Contributions
    0

    Default Re: Adding Artist sidebox

    I'm not entirely sure what your problem might be, but you might want to go back and check to see that you did indeed insert an entry for artists_id in the get_terms_to_filter table--that may cause the symptoms you are describing. I have this feature working, so I can help you out if need be.

    Here's the code for the artists_id_filter.php file that goes in includes/index_filters/

    PHP Code:
    <?php
    /**
     * artists_filter.php  for index filters
     *
     * index filter for recording artists
     * shows the recording artist using zen cart's built-in support
     *
     * @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: artists_id_filter.php Wed Nov  1 10:14:26 GMT 2006 allolex $
     */
    if (!defined('IS_ADMIN_FLAG')) {
      die(
    'Illegal Access');
    }
      if (!isset(
    $select_column_list)) $select_column_list "";
     
    // show the products of a specified record-company
      
    if (isset($_GET['artists_id']))
      {
        if (isset(
    $_GET['filter_id']) && zen_not_null($_GET['filter_id']))
        {
          
    // We are asked to show only a specific category
          
    $listing_sql "select " $select_column_list " p.products_id, p.products_type, p.products_price, p.products_tax_class_id, pd.products_description, if(s.status = 1, s.specials_new_products_price, NULL) AS specials_new_products_price, IF(s.status = 1, s.specials_new_products_price, p.products_price) as final_price, p.products_sort_order, p.product_is_call, p.product_is_always_free_shipping
            from " 
    TABLE_PRODUCTS " p, " .
            
    TABLE_PRODUCTS_DESCRIPTION " pd, " .
            
    TABLE_PRODUCT_MUSIC_EXTRA " pme left join " TABLE_SPECIALS " s on pme.products_id = s.products_id, " .
            
    TABLE_PRODUCTS_TO_CATEGORIES " p2c, " .
            
    TABLE_RECORD_ARTISTS " m
            where m.artists_id = '" 
    . (int)$_GET['artists_id'] . "'
              and p.products_id = pme.products_id
              and p.products_status = 1
              and pme.artists_id = '" 
    . (int)$_GET['artists_id'] . "'
              and pme.products_id = p2c.products_id
              and pd.products_id = p2c.products_id
              and pd.language_id = '" 
    . (int)$_SESSION['languages_id'] . "'
              and p2c.categories_id = '" 
    . (int)$_GET['filter_id'] . "'";
        } else {
          
    // We show them all
          
    $listing_sql "select " $select_column_list " pme.products_id, p.products_type, p.products_price, p.products_tax_class_id, pd.products_description, IF(s.status = 1, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status = 1, s.specials_new_products_price, p.products_price) as final_price, p.products_sort_order, p.product_is_call, p.product_is_always_free_shipping
            from " 
    TABLE_PRODUCTS " p, " .
            
    TABLE_PRODUCTS_DESCRIPTION " pd, " .
            
    TABLE_PRODUCT_MUSIC_EXTRA " pme left join " TABLE_SPECIALS " s on pme.products_id = s.products_id, " .
            
    TABLE_RECORD_ARTISTS " m
            where m.artists_id = '" 
    . (int)$_GET['artists_id'] . "'
              and p.products_id = pme.products_id
              and p.products_status = 1
              and pd.products_id = pme.products_id
              and pd.language_id = '" 
    . (int)$_SESSION['languages_id'] . "'
              and pme.artists_id = '" 
    . (int)$_GET['artists_id'] . "'";
        }
      } else {
        
    // show the products in a given category
        
    if (isset($_GET['filter_id']) && zen_not_null($_GET['filter_id']))
        {
          
    // We are asked to show only specific category
          
    $listing_sql "select " $select_column_list " p.products_id, p.products_type, m.music_genre_id, p.products_price, p.products_tax_class_id, pd.products_description, IF(s.status = 1, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status = 1, s.specials_new_products_price, p.products_price) as final_price, p.products_sort_order, p.product_is_call, p.product_is_always_free_shipping
            from " 
    TABLE_PRODUCTS " p left join " TABLE_SPECIALS " s on p.products_id = s.products_id, " .
            
    TABLE_PRODUCTS_DESCRIPTION " pd, " .
            
    TABLE_RECORD_ARTISTS " m, " .
            
    TABLE_PRODUCTS_MUSIC_EXTRA " pme, " .
            
    TABLE_PRODUCTS_TO_CATEGORIES " p2c
            where p.products_status = 1
              and pme.artists_id = m.artists_id
              and m.artists_id = '" 
    . (int)$_GET['filter_id'] . "'
              and p.products_id = p2c.products_id
              and pd.products_id = p2c.products_id
              and pd.language_id = '" 
    . (int)$_SESSION['languages_id'] . "'
              and p2c.categories_id = '" 
    . (int)$current_category_id "'";
        } else {
          
    // We show them all
          
    if ($current_categories_id) {
            
    $listing_sql "select " $select_column_list " p.products_id, p.products_type, m.music_genre_id, p.products_price, p.products_tax_class_id, pd.products_description, IF(s.status = 1, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status = 1, s.specials_new_products_price, p.products_price) as final_price, p.products_sort_order, p.product_is_call, p.product_is_always_free_shipping
              from " 
    TABLE_PRODUCTS_DESCRIPTION " pd, " .
              
    TABLE_PRODUCTS " p left join " TABLE_RECORD_ARTISTS " m, " TABLE_PRODUCT_MUSIC_EXTRA " pme on pme.artists_id = m.artists_id, " .
              
    TABLE_PRODUCTS_TO_CATEGORIES " p2c left join " TABLE_SPECIALS " s on p2c.products_id = s.products_id
              where p.products_status = 1
                and p.products_id = p2c.products_id
                and pd.products_id = p2c.products_id
                and pd.language_id = '" 
    . (int)$_SESSION['languages_id'] . "'
                and p2c.categories_id = '" 
    . (int)$current_category_id "'";
          } else {
            
    $listing_sql "select " $select_column_list " p.products_id, p.products_type, m.music_genre_id, p.products_price, p.products_tax_class_id, pd.products_description, IF(s.status = 1, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status = 1, s.specials_new_products_price, p.products_price) as final_price, p.products_sort_order, p.product_is_call, p.product_is_always_free_shipping
              from " 
    TABLE_PRODUCTS_DESCRIPTION " pd, " .
              
    TABLE_PRODUCTS " p left join " TABLE_RECORD_ARTISTS " m, " TABLE_PRODUCT_MUSIC_EXTRA " pme on pme.artists_id = m.artists_id, " .
              
    TABLE_PRODUCTS_TO_CATEGORIES " p2c left join " TABLE_SPECIALS " s on p2c.products_id = s.products_id
              where p.products_status = 1
                and p.products_id = p2c.products_id
                and pd.products_id = p2c.products_id
                and pd.language_id = '" 
    . (int)$_SESSION['languages_id'] . "'";
          }
        }
      }
      
    // set the default sort order setting from the Admin when not defined by customer
      
    if (!isset($_GET['sort']) and PRODUCT_LISTING_DEFAULT_SORT_ORDER != '') {
        
    $_GET['sort'] = PRODUCT_LISTING_DEFAULT_SORT_ORDER;
      }

      
    $listing_sql str_replace('m.manufacturers_name''m.artists_name as manufacturers_name'$listing_sql);

      if (isset(
    $column_list)) {
        if ( (!isset(
    $_GET['sort'])) || (!ereg('[1-8][ad]'$_GET['sort'])) || (substr($_GET['sort'], 01) > sizeof($column_list)) )
        {
          for (
    $i=0$n=sizeof($column_list); $i<$n$i++)
          {
            if (
    $column_list[$i] == 'PRODUCT_LIST_NAME')
            {
              
    $_GET['sort'] = $i+'a';
              
    $listing_sql .= " order by p.products_sort_order, pd.products_name";
              break;
            }
          }
          
    // if set to nothing use products_sort_order and PRODUCTS_LIST_NAME is off
          
    if (PRODUCT_LISTING_DEFAULT_SORT_ORDER == '') {
            
    $_GET['sort'] = '20a';
          }
        } else {
          
    $sort_col substr($_GET['sort'], 1);
          
    $sort_order substr($_GET['sort'], 1);
          
    $listing_sql .= ' order by ';
          switch (
    $column_list[$sort_col-1])
          {
            case 
    'PRODUCT_LIST_MODEL':
            
    $listing_sql .= "p.products_model " . ($sort_order == 'd' 'desc' '') . ", pd.products_name";
            break;
            case 
    'PRODUCT_LIST_NAME':
            
    $listing_sql .= "pd.products_name " . ($sort_order == 'd' 'desc' '');
            break;
            case 
    'PRODUCT_LIST_MANUFACTURER':
            
    $listing_sql .= "m.artists_name " . ($sort_order == 'd' 'desc' '') . ", pd.products_name";
            break;
            case 
    'PRODUCT_LIST_QUANTITY':
            
    $listing_sql .= "p.products_quantity " . ($sort_order == 'd' 'desc' '') . ", pd.products_name";
            break;
            case 
    'PRODUCT_LIST_IMAGE':
            
    $listing_sql .= "pd.products_name";
            break;
            case 
    'PRODUCT_LIST_WEIGHT':
            
    $listing_sql .= "p.products_weight " . ($sort_order == 'd' 'desc' '') . ", pd.products_name";
            break;
            case 
    'PRODUCT_LIST_PRICE':
            
    //          $listing_sql .= "final_price " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
            
    $listing_sql .= "p.products_price_sorter " . ($sort_order == 'd' 'desc' '') . ", pd.products_name";
            break;
          }
        }
      }
      
    // optional Product List Filter
      
    if (PRODUCT_LIST_FILTER 0)
      {
        if (isset(
    $_GET['artists_id']))
        {
          
    $filterlist_sql "select distinct c.categories_id as id, cd.categories_name as name
            from " 
    TABLE_PRODUCTS " p, " .
            
    TABLE_PRODUCTS_TO_CATEGORIES " p2c, " .
            
    TABLE_CATEGORIES " c, " .
            
    TABLE_CATEGORIES_DESCRIPTION " cd, " .
            
    TABLE_PRODUCT_MUSIC_EXTRA " pme
            where p.products_status = 1
              and pme.products_id = p2c.products_id
              and p2c.categories_id = c.categories_id
              and p2c.categories_id = cd.categories_id
              and cd.language_id = '" 
    . (int)$_SESSION['languages_id'] . "'
              and pme.artists_id = '" 
    . (int)$_GET['artists_id'] . "'
            order by cd.categories_name"
    ;
        } else {
          
    $filterlist_sql"select distinct m.music_genre_id as id, m.music_genre_name as name
            from " 
    TABLE_PRODUCTS " p, " .
            
    TABLE_PRODUCTS_TO_CATEGORIES " p2c, " .
            
    TABLE_PRODUCT_MUSIC_EXTRA " pme, " .
            
    TABLE_RECORD_ARTISTS " m
            where p.products_status = 1
              and pme.artists_id = m.artists_id
              and p.products_id = p2c.products_id
              and p2c.categories_id = '" 
    . (int)$current_category_id "'
            order by m.artists_name"
    ;
        }
        
    $getoption_set =  false;
        
    $do_filter_list false;
        
    $filterlist $db->Execute($filterlist_sql);
        if (
    $filterlist->RecordCount() > 1)
        {
          
    $do_filter_list true;
          if (isset(
    $_GET['artists_id']))
          {
            
    $getoption_set =  true;
            
    $get_option_variable 'artists_id';
            
    $options = array(array('id' => '''text' => TEXT_ALL_CATEGORIES));
          } else {
            
    $options = array(array('id' => '''text' => TEXT_ALL_MUSIC_GENRE));
          }
          while (!
    $filterlist->EOF) {
            
    $options[] = array('id' => $filterlist->fields['id'], 'text' => $filterlist->fields['name']);
            
    $filterlist->MoveNext();
          }
        }
      }

      
    // Get the right image for the top-right
      
    $image DIR_WS_TEMPLATE_IMAGES 'table_background_list.gif';
      if (
    $current_category_id) {

        
    $sql "select categories_image from " TABLE_CATEGORIES "
                    where  categories_id = '" 
    . (int)$current_category_id "'";

        
    $image_name $db->Execute($sql);
        
    $image $image_name->fields['categories_image'];
      }
    ?>

  4. #4
    Join Date
    Nov 2006
    Location
    Quebec, Canada
    Posts
    32
    Plugin Contributions
    0

    Default Re: Adding Artist sidebox

    Can someone tell me if this mod is supposed to work on versoin 1.3.6 as I can't get it working and would love to use this feature!

    Thanks!

  5. #5
    Join Date
    Oct 2006
    Posts
    149
    Plugin Contributions
    0

    Default Re: Adding Artist sidebox

    Yes, it works fine, but you will have to do some tweaking. The example is
    www.lyricsurge.com

    all the best

    Andy

  6. #6
    Join Date
    Nov 2006
    Location
    Quebec, Canada
    Posts
    32
    Plugin Contributions
    0

    Default Re: Adding Artist sidebox

    Wow, your site looks really great and the mod works just fine!

    I'm really new to Zen-Cart though so could anyone tell me what file to tweak and how to do it? That would be much appreciated!

  7. #7
    Join Date
    Mar 2007
    Posts
    31
    Plugin Contributions
    0

    Default Re: Adding Artist sidebox

    This looks like what I am after as well, except that I would like to go one step further and make the artist list searchable from an A to Z horizontal navigation bar.

    If anyone knows how to do this and would like to share, it would be much appreciated.

 

 

Similar Threads

  1. Artist Sidebox
    By Silver Kamel in forum Basic Configuration
    Replies: 19
    Last Post: 22 Nov 2010, 10:45 AM
  2. Record Artist Select sidebox?
    By swortis in forum Basic Configuration
    Replies: 4
    Last Post: 10 Sep 2010, 06:25 PM
  3. Problem adding artist sidebox
    By Ishtar in forum Basic Configuration
    Replies: 0
    Last Post: 23 Jan 2010, 04:38 PM
  4. Recording Artist sidebox?
    By radiof in forum Customization from the Admin
    Replies: 4
    Last Post: 1 Jul 2008, 08:48 PM

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