Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2011
    Posts
    52
    Plugin Contributions
    0

    Default $productsInCategory

    $productsInCategory Could anyone tell me what this function does? I have done a few searches and come up with nothing.

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: $productsInCategory

    That gets the products in a category
    Zen-Venom Get Bitten

  3. #3
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: $productsInCategory

    This is a variable ...

    One use of it is obtaining all of the Products in a Category or based on the manufacturers_id such as in the listing:

    If you were to add this code to the tpl_main_page.php just below the <body> tag, you can see the results as you navigate the Categories -- OR -- Manufacturers and select a Category from the drop down ...
    Code:
    <?php
    //$productsInCategory = zen_get_categories_products_list( (($manufacturers_id > 0 && $_GET['filter_id'] > 0) ? zen_get_generated_category_path_rev($_GET['filter_id']) : $cPath), false, true, 0, $display_limit);
      $productsInCategory = zen_get_categories_products_list( (($manufacturers_id > 0 && $_GET['filter_id'] > 0) ? zen_get_generated_category_path_rev($_GET['filter_id']) : $cPath), false, true, 0);
      if (is_array($productsInCategory) && sizeof($productsInCategory) > 0) {
        // build products-list string to insert into SQL query
        foreach($productsInCategory as $key => $value) {
          $list_of_products .= $key . ', ';
        }
        $list_of_products = substr($list_of_products, 0, -2); // remove trailing comma
      }
    echo 'Products In Category: ' . $list_of_products . '<br>';
    ?>
    It will get all of the products_id from that current categories level and all of the subcategories ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

 

 

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