Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2008
    Posts
    60
    Plugin Contributions
    2

    Default Make Your Music Side Boxes Smarter - Verify Products Exist

    This change will make it so your music side boxes only display names associated with active products.

    First run these SQL statements....
    Code:
    INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('', 'Artists List - Verify Product Exist', 'PRODUCTS_ARTISTS_STATUS', '1', 'Verify that at least 1 product exists and is active for the artist name to show<br /><br />Note: When this feature is ON it can produce slower results on sites with a large number of products and/or artists<br />0= off 1= on', 3, 7, NULL, now(), NULL, 'cfg_select_option(array(\'0\', \'1\'), ');
    INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('', 'Record Company List - Verify Product Exist', 'PRODUCTS_RECORD_COMPANY_STATUS', '1', 'Verify that at least 1 product exists and is active for the artist name to show<br /><br />Note: When this feature is ON it can produce slower results on sites with a large number of products and/or record companies.<br />0= off 1= on', 3, 7, NULL, now(), NULL, 'cfg_select_option(array(\'0\', \'1\'), ');
    in includes\modules\sideboxes\artists.php find
    Code:
    $artists_query = "select m.artists_id, m.artists_name
                                from " . TABLE_RECORD_ARTISTS . " m
                                order by artists_name";
    replace with
    Code:
    if (PRODUCTS_ARTISTS_STATUS == '1') {
        $artists_query = "select distinct a.artists_id, a.artists_name from (" . TABLE_RECORD_ARTISTS . " a left join " . TABLE_PRODUCT_MUSIC_EXTRA . " pme on a.artists_id = pme.artists_id left join " . TABLE_PRODUCTS . " p on pme.products_id = p.products_id ) where p.products_status = 1 order by artists_name"; 
    							
      } else {
        $artists_query = "select m.artists_id, m.artists_name
                                from " . TABLE_RECORD_ARTISTS . " m
                                order by artists_name";
      }
    in includes\modules\sideboxes\record_companies.php find
    Code:
    $record_company_query = "select m.record_company_id, m.record_company_name
                                from " . TABLE_RECORD_COMPANY . " m
                                order by record_company_name";
    replace with
    Code:
    if (PRODUCTS_RECORD_COMPANY_STATUS == '1') {
        $record_company_query = "select distinct r.record_company_id, r.record_company_name from (" . TABLE_RECORD_COMPANY . " r left join " . TABLE_PRODUCT_MUSIC_EXTRA . " pme on r.record_company_id = pme.record_company_id left join " . TABLE_PRODUCTS . " p on pme.products_id = p.products_id ) where p.products_status = 1 order by record_company_name"; 
    							
      } else {
        $record_company_query = "select m.record_company_id, m.record_company_name
                                from " . TABLE_RECORD_COMPANY . " m
                                order by record_company_name";
      }

    You could do the same thing for genres if you like as well. Dont have that handy because I dont currently use genres.

  2. #2
    Join Date
    Jun 2009
    Posts
    275
    Plugin Contributions
    0

    Default Re: Make Your Music Side Boxes Smarter - Verify Products Exist

    Thanks for this...works great!

 

 

Similar Threads

  1. v150 Make products in a catagory show up side by side
    By mattkosterweb in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 9 Mar 2012, 07:00 AM
  2. Verify Your Age field
    By rfresh in forum Managing Customers and Orders
    Replies: 1
    Last Post: 8 Jan 2009, 07:43 AM
  3. Make categories side box different from other side boxes
    By Jeff G in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 20 Nov 2007, 10:16 PM
  4. Can paypal express make your store's admin side run slooooow/time out?
    By tj1 in forum PayPal Express Checkout support
    Replies: 3
    Last Post: 18 Nov 2007, 05:38 AM
  5. Make Side boxes look like this?
    By Stuff4Toys in forum Addon Sideboxes
    Replies: 7
    Last Post: 16 May 2007, 11:26 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
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR