Page 1 of 6 123 ... LastLast
Results 1 to 10 of 52
  1. #1
    Join Date
    Jul 2008
    Posts
    18
    Plugin Contributions
    0

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

    I installed the excellent mod -column_layout_grid_v_1_3_8- and this work very good for me. Thanks fo the awesome job.

    Now i have a question. I have a new category, and for that category i want to use a different layout style for the product listing.
    For the whole shop >> the colums option (products in 3 columns per row) and for my new category i want each product in its own row. How can i achieve this ?

    I noticed that the mod overrides just two files in zencart's system.
    Is there a way to use a specific tpl_modules_product_listing.php for my new category ?

    Anybody has any idea?

    Apologies if this is answered in a previous thread. I've been searching for a while and can't find it.

  2. #2
    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)?

    It would take some customizing of product_listing.php, and probably tpl_modules_product_listing.php, but it would not be difficult.

    There are a number of tests like
    if (PRODUCT_LISTING_LAYOUT_STYLE == 'rows') {
    and
    if (PRODUCT_LISTING_LAYOUT_STYLE == 'columns') {
    and you could add a test for $_GET['cPath'] equaling the category you want different, to use the rows instead of columns code.

  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)?

    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.

  4. #4
    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...

  5. #5
    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.

  6. #6
    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

  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)?

    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

  8. #8
    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

  9. #9
    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.

  10. #10
    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

 

 
Page 1 of 6 123 ... 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

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