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

Hybrid View

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

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

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

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

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

    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

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

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

    @gjh42:
    Thank you for your reply, I didn't see it before.

    So this code goes in the products_listing.php file in the module directory.

    Then you create a file named products_listing_c_'category_id'.php for each category.

    Am I correct?

  8. #8
    Join Date
    Jul 2011
    Posts
    138
    Plugin Contributions
    0

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

    Hopefully I can revive this thread. Bunyip's solution seems straight forward and may be the quick fix, but I would prefer to implement the long term solution. Can anyone offer help regarding yellow1912 solution.

    1) will this work for ZC 1.3.9h or is there a better solution
    2) where does the code go
    3) once I implement the code do I just add a layout column in my categories table and populate with "row", "grid", "xx", "xy", and so on or would the assignment need to be the actual .php file name for each layout.

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

 

 
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

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