Results 1 to 10 of 11

Hybrid View

  1. #1
    Join Date
    Aug 2007
    Posts
    91
    Plugin Contributions
    0

    Default Re: Separate Product Listing by Category

    Glenn,

    I'm not sure I totally understand. Do I need to list out every single product ID? This site will have over 300 products. Each "gemstone" page would have a different set of product ids, will this script work for that?

    Sorry, if these are dumb questions, but I'm new to all of this.

    Thanks,
    Cindy

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

    Default Re: Separate Product Listing by Category

    You will need to list each product id that will be the first one in a section. You won't need to list the rest of them.

    You do need to assign sort orders to all the products so they display in the correct sequence. Do this in the product editing page.

    Another tweak is that some or all of these products will also appear in other categories where you don't want the subheadings. You will need to wrap another test around the code so it only checks for subheadings in the desired categories.
    PHP Code:
        // Following code will be executed only if Column Layout (Grid Layout) option is chosen
        
    if (PRODUCT_LISTING_LAYOUT_STYLE == 'columns') {
        if (
    in_array($_GET[cPath],explode(",",'category_paths_to_have_subheadings'))) { // check for subheading cats
          
    $section_check $listing->fields['products_id']; // subheadings - gjh42 20080913 
          
    $section_header '';
          if (
    in_array($section_check,explode(",",'list_ids_to_start_new_lines_here,separated_by_commas,and_no_spaces'))) { 
            
    $column != 0?$rows ++:''
            
    $column = -1;
            switch (
    $section_check) {
            case 
    "first id":
              
    $section_header 'First Section';
            break;
            case 
    "second id"//repeat case/$section/break for other ids to start headings
              
    $section_header 'Second Section';
            break;
            } 
    //switch
            
    $section_header '<div class="sectionHeader">' $section_header '</div>';
          } 
    //if
          
    $lc_text $section_header implode('<br />'$product_contents);  // /subheadings
          
    $list_box_contents[$rows][$column] = array('params' => 'class="centerBoxContentsProducts centeredContent back"' ' ' 'style="width:' $col_width '%;"',
                                                     
    'text'  => $lc_text);
          
    $column ++;
          if (
    $column >= PRODUCT_LISTING_COLUMNS_PER_ROW) {
            
    $column 0;
            
    $rows ++;
          }
        } 
    // subheading cats
        
    }
        
    // End of Code fragment for Column Layout (Grid Layout) option in add on module 
    Replace
    category_paths_to_have_subheadings
    with a comma-separated list of the categories to get subheadings.

 

 

Similar Threads

  1. v151 View a product/category in the catalog from a link in admin product/category listing
    By torvista in forum Customization from the Admin
    Replies: 4
    Last Post: 25 Jan 2013, 06:13 PM
  2. Change Category Product Listing Layout To Match All Product Listing
    By Alfonzo in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 21 Sep 2010, 11:49 AM
  3. Product listing different in separate categories
    By chingy in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 9 Nov 2009, 05:27 PM
  4. Category Listing - Separate sections by Sort Order
    By JJDoench in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 5 Aug 2009, 06:55 PM
  5. IE(Problem) Product Category Listing Bleeds Into Category Header?
    By allen875 in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 17 Dec 2007, 05:09 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