Page 5 of 6 FirstFirst ... 3456 LastLast
Results 41 to 50 of 52
  1. #41
    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)?

    Assuming you will have style set to "columns", you would just add more if() or }elseif(){ lines:
    PHP Code:
    if (PRODUCT_LISTING_LAYOUT_STYLE == 'columns') {
      if (
    $current_category_id == 544) {
        require(
    $template->get_template_dir('tpl_columnar_display2.php',DIR_WS_TEMPLATE$current_page_base,'common'). '/tpl_columnar_display2.php');
      } elseif (
    $current_category_id == 567) {
        require(
    $template->get_template_dir('tpl_columnar_display3.php',DIR_WS_TEMPLATE$current_page_base,'common'). '/tpl_columnar_display3.php');
      } elseif (
    $current_category_id == 246 or $current_category_id == 321) {
        require(
    $template->get_template_dir('tpl_columnar_display4.php',DIR_WS_TEMPLATE$current_page_base,'common'). '/tpl_columnar_display4.php');
      } elseif (
    in_array($current_category_idexplode(',''12,24,56,69')) {
        require(
    $template->get_template_dir('tpl_columnar_display5.php',DIR_WS_TEMPLATE$current_page_base,'common'). '/tpl_columnar_display5.php');
      } else {
        require(
    $template->get_template_dir('tpl_columnar_display.php',DIR_WS_TEMPLATE$current_page_base,'common'). '/tpl_columnar_display.php');
      }
    } else {
    // (PRODUCT_LISTING_LAYOUT_STYLE == 'rows') 

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

    If you plan to have a lot of variations on tpl_columnar_display#.php, you might find it clearer to set a variable to '1', '2', '3', etc. and have one require at the end of the set:
    PHP Code:
    if (PRODUCT_LISTING_LAYOUT_STYLE == 'columns') {
      
    $style_no '';//reset to base condition
      
    if ($current_category_id == 544) {
        
    $style_no '2';//set custom style no
      
    } elseif ($current_category_id == 567) {
        
    $style_no '3';//set custom style no
      
    } elseif ($current_category_id == 246 or $current_category_id == 321) {
        
    $style_no '4';//set custom style no
      
    } elseif (in_array($current_category_idexplode(',''12,24,56,69')) {
        
    $style_no '5';//set custom style no
      
    }
      
    //call appropriate style
      
    require($template->get_template_dir('tpl_columnar_display' $style_no '.php',DIR_WS_TEMPLATE$current_page_base,'common'). '/tpl_columnar_display' $style_no '.php');
    } else {
    // (PRODUCT_LISTING_LAYOUT_STYLE == 'rows') 

  3. #43
    Join Date
    Nov 2009
    Location
    UK
    Posts
    1,090
    Plugin Contributions
    0

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

    This is excellent Glen many thanks. What Im planning to do with this is my str_replace trick, so I can make new categories with existing linked products, but modify the product titles for better SEO.

  4. #44
    Join Date
    Dec 2008
    Location
    Hanover Township PA, USA
    Posts
    122
    Plugin Contributions
    0

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

    Hello All,
    Has anyone been able to make Bunyip's code work with Zencart 1.50 using Flexible Product Listing Version 1.0?
    If so, is the product_listing.php the only file that needs to be modified?

    My includes/modules/classic/product_listing.php has the following code
    if ($product_listing_layout_style == 'rows' in FOUR places as follows:

    Location 1)
    // Begin Row Layout Header
    if ($product_listing_layout_style == 'rows' or PRODUCT_LISTING_GRID_SORT) { // For Column Layout (Grid Layout) add on module

    Location 2)
    case 'PRODUCT_LIST_IMAGE':
    if ($product_listing_layout_style == 'rows') { //skip if grid

    Location 3)
    if ($product_listing_layout_style == 'rows') { // Used in Column Layout (Grid Layout) Add on module

    Location 4)
    $product_contents[] = $lc_text; // Used For Column Layout (Grid Layout) Option
    if ($product_listing_layout_style == 'rows') {

    My includes/modules/classic/product_listing.php has the following code
    if ($product_listing_layout_style == 'columns' in THREE places as follows:

    Location 1)
    if ($product_listing_layout_style == 'columns') { //grid sort option

    Location 2)
    // Used for Column Layout (Grid Layout) add on module
    $column = 0;
    if ($product_listing_layout_style == 'columns') {

    Location 3)
    // Following code will be executed only if Column Layout (Grid Layout) option is chosen
    if ($product_listing_layout_style == 'columns') {


    I have REPLACED
    if ($product_listing_layout_style == 'rows'
    WITH
    if ($product_listing_layout_style == 'rows' OR (int)$cPath == 101000

    and I have REPLACED
    if ($product_listing_layout_style == 'columns'
    WITH
    if ($product_listing_layout_style == 'columns' AND (int)$cPath == 101000

    RESULT: ALL Product Listing Pages are "Blank".
    (101000 is a top category which has multiple categories under it)

    Any thoughts or ideas? This would be a fantastic addition!
    Thanks all,
    Danny
    Daniel Osko

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

    You really have over 100,000 categories? That's an exceptional category id, 101000.
    What do you have $product_listing_layout_style set to? Does it make a difference in the result?

  6. #46
    Join Date
    Dec 2008
    Location
    Hanover Township PA, USA
    Posts
    122
    Plugin Contributions
    0

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

    Hi Glen,
    I actually have over 650 categories and sub-categories. Each category ID is separated by a numeric factor of 100 so that future categories can be added without effecting the presently used category ID’s.

    My $product_listing_layout_style is set as follows:
    if (!defined('PRODUCT_LISTING_LAYOUT_STYLE')) define('PRODUCT_LISTING_LAYOUT_STYLE',(isset($_GET['view']) ? $_GET['view'] : 'rows'));
    if (!defined('PRODUCT_LISTING_COLUMNS_PER_ROW')) define('PRODUCT_LISTING_COLUMNS_PER_ROW',3);
    if (!defined('PRODUCT_LISTING_GRID_SORT')) define('PRODUCT_LISTING_GRID_SORT',0);
    $product_listing_layout_style = isset($_GET['view'])? $_GET['view']: PRODUCT_LISTING_LAYOUT_STYLE;
    $row = 0;
    $col = 0;
    $list_box_contents = array();
    $title = '';

    Changing the $row or $col has no effect.

    My product listing pages are not actually “blank”. The main category ID “101000” product listing pages all have a jumbled up combination of both rows and columns for every product. (so each product is listed twice). All other product listing pages only show the first product in the “row” format. (additional products are missing).

    Thanks,
    Danny
    Last edited by danielosko; 11 Nov 2013 at 01:14 PM.
    Daniel Osko

  7. #47
    Join Date
    Dec 2008
    Location
    Hanover Township PA, USA
    Posts
    122
    Plugin Contributions
    0

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

    Hello Everyone,
    Since no one seems to have gotten “bunyip’s” code working with Zencart 1.5.0 and the Flexible Product Listing plugin…, Does ANYONE know how to implement “yellow1912’s” 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));

    Specifically:
    1) Which file is the code inserted into? (includes/templates/classic/tpl_modules_product_listing.php)???
    2) Where is the Category ID placed within the code?
    3) Can multiple Category ID’s be utilized?
    4) Should the NEW file be "product_listing_c_$c.php" or “product_listing_c.php”
    5) ANY other info required.

    Thanks All,
    Danny
    Daniel Osko

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

    1) Yes, yellow1912's code goes at the very top of tpl_modules_product_listing.php:
    PHP Code:
     * @version $Idtpl_modules_product_listing.php 3241 2006-03-22 04:27:27Z ajeh $
     */
     include(
    DIR_WS_MODULES zen_get_module_directory(FILENAME_PRODUCT_LISTING)); 
    2) You don't specify the categories to get special templates in this code; that is handled dynamically.

    3) Yes, you can have unlimited special product_listing files. The code is really elegant, and will use whatever is the most specific listing file available. You can have a generic special file for widgets, and an extra-special file for blue widgets, while red and green widgets get the generic special file. Most thingamabobs will get the stock listing file, but you can use a special file for purple thingamabobs.

    4) Make a "product_listing_c_##.php" file for each variant, where ## is the broadest category id you want to use the file for.

    5) The code will automatically use an applicable listing file if it exists, or else use the stock one. No other action is required.

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

    Each category ID is separated by a numeric factor of 100 so that future categories can be added without effecting the presently used category ID’s.
    Odd... the category id is supposed to be an auto-incrementing field, and the id is not needed for any kind of sorting anyway, not to mention that you should not be able to "affect the presently used category ID's". You can set the category sort orders independently. How do you get the ids spaced out, and how will you later insert new ids into the sequence? Sounds risky to me...
    Last edited by gjh42; 13 Nov 2013 at 05:33 PM.

  10. #50
    Join Date
    Dec 2008
    Location
    Hanover Township PA, USA
    Posts
    122
    Plugin Contributions
    0

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

    AWSOME! FANTASTIC! I LOVE IT!

    I cannot tell you how frickin happy I am! I have wanted to implement this since 2009. YOU are the MAN!

    I, on the other hand, am an idiot. I had the product_listing.php and the tpl_modules_product_listing.php files both listed in two different places and causing conflicts..., (probably from all of the plugins over the years) and I had a "space" in the product_listing _##.php file I was testing. DUH!

    So, the product_listing.php and the product_listing_##.php files go under:
    "includes/modules/"

    and the tpl_modules_product_listing.php file goes under:
    "includes/templates/YOUR_TEMPLATE/templates/"

    I can hardly wait to launch this new site.

    Again, THANK YOU! THANK YOU! THANK YOU!
    Danny
    Daniel Osko

 

 
Page 5 of 6 FirstFirst ... 3456 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