Page 1 of 2 12 LastLast
Results 1 to 10 of 52

Hybrid View

  1. #1
    Join Date
    Jul 2008
    Posts
    18
    Plugin Contributions
    0

    Default Re: Is this possible ? Two or more product listing layouts (one per category)?

    thank you gjh42 for your reply and help.
    i will try this tomorrow.

    i found also another thread with the same problem :
    http://www.zen-cart.com/forum/showthread.php?t=48433.
    Unfortunately the answer is not complete, but the thread is informative and helpfull.

  2. #2
    Join Date
    Sep 2004
    Location
    Western Massachusetts
    Posts
    2,945
    Plugin Contributions
    5

    Default Re: Is this possible ? Two or more product listing layouts (one per category)?

    There are a number of places in the product_listing.php module for the column mod where the code tests for whether the layout should be in rows or columns.
    Assuming you have the overall cart set to display columns, and the product category that you want to use rows for has a category_id of XXX, you could change each of the
    Code:
    if (PRODUCT_LISTING_LAYOUT_STYLE == 'rows')
    tests to be
    Code:
    if (PRODUCT_LISTING_LAYOUT_STYLE == 'rows' OR (int)$current_category_id == XXX)
    and each of the
    Code:
    if (PRODUCT_LISTING_LAYOUT_STYLE == 'columns')
    tests to be
    Code:
    if (PRODUCT_LISTING_LAYOUT_STYLE == 'columns' AND (int)$current_category_id != XXX)
    Neville
    An assumption is what you arrive at when you get tired of thinking...

  3. #3
    Join Date
    Jul 2008
    Posts
    18
    Plugin Contributions
    0

    Default Re: Is this possible ? Two or more product listing layouts (one per category)?

    Yeah, it's possibe and it's easy. Thanks for your help gih42 and bunyip.
    For the really dummies like me, follow the advices given by bunyip precisely, it's all you have to do.
    You have just to make these changes in two files, tpl_modules_product_listing (your template folder) and product_listing (module folder).
    In tpl_modules_product_listing you will find

    else {// (PRODUCT_LISTING_LAYOUT_STYLE == 'rows')

    Since this is commented, don't care about them and leave this untouched.
    And of course, you must have the mod -column_layout_grid_v_1_3_8- installded.

  4. #4
    Join Date
    Oct 2006
    Posts
    5,477
    Plugin Contributions
    11

    Default Re: Is this possible ? Two or more product listing layouts (one per category)?

    This is what I did, worked like a charm if you want to select the product listing module you want to use:

    PHP Code:
    $listing_module_loaded false;
     if(!
    $is_index_listing && $_GET['main_page'] == 'index' && !empty($cPath)){
         
    $category_array explode('_'$cPath);
         
    $category_array array_reverse($category_array);
         foreach (
    $category_array as $c){
             
    $listing_module_file DIR_WS_MODULES zen_get_module_directory("product_listing_c_$c.php");
             if(
    file_exists($listing_module_file)){
                 include(
    $listing_module_file);
                 
    $listing_module_loaded true;
                 break;
             }
        }
     }
     if(!
    $listing_module_loaded)
         include(
    DIR_WS_MODULES zen_get_module_directory(FILENAME_PRODUCT_LISTING)); 
    I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

  5. #5
    Join Date
    Feb 2009
    Posts
    31
    Plugin Contributions
    0

    Default Re: Is this possible ? Two or more product listing layouts (one per category)?

    It doesn't work for me I installed the contrib to have it in tabular/grid display, made the changes to products_listing.php and tpl_module_products_listing.php but :

    1- now in the category that should be displayed by row, I have only on product showing up instead of 542.

    2- My table header with the description of the fields disappeared...

    You can check at practitioners.springwind.com

    Please, help?

    yellow1912: how and where do you implement your code?



    Thanks a bunch
    Last edited by yakbuttertea; 20 Mar 2009 at 06:10 PM. Reason: missing info

  6. #6
    Join Date
    Feb 2009
    Posts
    31
    Plugin Contributions
    0

    Default Re: Is this possible ? Two or more product listing layouts (one per category)?

    Quote Originally Posted by yakbuttertea View Post
    It doesn't work for me I installed the contrib to have it in tabular/grid display, made the changes to products_listing.php and tpl_module_products_listing.php but :

    1- now in the category that should be displayed by row, I have only on product showing up instead of 542.

    2- My table header with the description of the fields disappeared...

    You can check at practitioners.springwind.com

    Please, help?

    yellow1912: how and where do you implement your code?



    Thanks a bunch
    Fixed the 1- point, I forgot to modify an if()

    2- still not showing

    and still interested in yellow1912 solution

    Thanks

  7. #7
    Join Date
    Feb 2009
    Posts
    31
    Plugin Contributions
    0

    Default Re: Is this possible ? Two or more product listing layouts (one per category)?

    Quote Originally Posted by yakbuttertea View Post
    Fixed the 1- point, I forgot to modify an if()

    2- still not showing

    and still interested in yellow1912 solution

    Thanks
    Sorry for all this messages,
    Fixed 2- as well
    Thanks

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

    Default Re: Is this possible ? Two or more product listing layouts (one per category)?

    Yellow1912's code would work to select among a number of different product_listing files depending on the category. It requires making a new file with the layout code you want for each different case. It is the ultimate in flexibility, but overkill for switching between rows and columns in the Column Grid mod.

  9. #9
    Join Date
    Oct 2004
    Posts
    1,045
    Plugin Contributions
    0

    Default Re: Is this possible ? Two or more product listing layouts (one per category)?

    Quote Originally Posted by yellow1912 View Post
    This is what I did, worked like a charm if you want to select the product listing module you want to use:

    PHP Code:
    $listing_module_loaded false;
     if(!
    $is_index_listing && $_GET['main_page'] == 'index' && !empty($cPath)){
         
    $category_array explode('_'$cPath);
         
    $category_array array_reverse($category_array);
         foreach (
    $category_array as $c){
             
    $listing_module_file DIR_WS_MODULES zen_get_module_directory("product_listing_c_$c.php");
             if(
    file_exists($listing_module_file)){
                 include(
    $listing_module_file);
                 
    $listing_module_loaded true;
                 break;
             }
        }
     }
     if(!
    $listing_module_loaded)
         include(
    DIR_WS_MODULES zen_get_module_directory(FILENAME_PRODUCT_LISTING)); 
    What file would you put this code in?

    Thanks!
    Danielle

  10. #10
    Join Date
    Dec 2011
    Posts
    15
    Plugin Contributions
    0

    Default Re: Is this possible ? Two or more product listing layouts (one per category)?

    Quote Originally Posted by yellow1912 View Post
    This is what I did, worked like a charm if you want to select the product listing module you want to use:

    PHP Code:
    $listing_module_loaded false;
     if(!
    $is_index_listing && $_GET['main_page'] == 'index' && !empty($cPath)){
         
    $category_array explode('_'$cPath);
         
    $category_array array_reverse($category_array);
         foreach (
    $category_array as $c){
             
    $listing_module_file DIR_WS_MODULES zen_get_module_directory("product_listing_c_$c.php");
             if(
    file_exists($listing_module_file)){
                 include(
    $listing_module_file);
                 
    $listing_module_loaded true;
                 break;
             }
        }
     }
     if(!
    $listing_module_loaded)
         include(
    DIR_WS_MODULES zen_get_module_directory(FILENAME_PRODUCT_LISTING)); 

    Dear yellow1912,


    I have a zen-cart website with a modification to make it work with two
    or more different product listing layouts, one per category (instead
    of the standard single product listing layout). Depending on the
    selected category, a different product_listing.php file is loaded.
    The problem is that each specific product_listing.php files need to be made manually
    for each new category.

    What I really need for my zen-cart website is:

    - I need 10 additional product listing layouts, next to the existing standard
    'product listing' layout' (like "product2 listing", "product3 listing" etc.) integrated in my shop.
    - Each additional product listing layouts needs to be adjustable from
    the admin (just like the standard 'product listing'), each with it's own
    specific configuration:
    - the number of columns
    - choose between 4, 3, 2 columns (grid view) or single column view,
    - number of products per page.
    - I need an option in the admin, that when creating a new category or
    editing a category, you need to choose from a popdown which 1 of the 10 product
    listing layouts it has to use for that specific category (i think that's got to be added in the database?)
    - each product listing needs to be styled with it's own stylesheets.

    Can someone help me?

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. How can I implement multiple product listing layouts based on category
    By idc1 in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 15 Jul 2011, 07:44 PM
  2. Two Site with One Paypal account...is this possible?
    By PinkLeopard in forum PayPal Website Payments Pro support
    Replies: 7
    Last Post: 12 Jan 2010, 04:04 AM
  3. Newbie - Possible to create more than one category filter?
    By henrytan in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 11 Oct 2008, 09:22 AM
  4. One product database + two kinds of handling possible?
    By pe7er in forum General Questions
    Replies: 2
    Last Post: 21 Mar 2008, 05:32 PM
  5. Is it possible to have two different Prod Listing Layouts?
    By rwoody in forum Setting Up Categories, Products, Attributes
    Replies: 16
    Last Post: 14 Oct 2006, 05:24 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