Results 1 to 7 of 7
  1. #1
    Join Date
    Oct 2006
    Posts
    7
    Plugin Contributions
    0

    Default List of products in category

    Hi, I'm wondering if there was a way (function maybe?) that would allow me to provide a list of products in a specific category to include on the product information page.

    I guess it would be sort of like the category lists already available, but one which could be included potentially anywhere in the site.

    Thanks.

  2. #2
    Join Date
    Oct 2006
    Posts
    7
    Plugin Contributions
    0

    Default Re: List of products in category

    bump.......

  3. #3
    Join Date
    Oct 2006
    Posts
    7
    Plugin Contributions
    0

    Default Re: List of products in category (on product info page)

    Ok, so I've come up with a solution, that if you place this code within the [FONT=Courier New]tpl_product_info_display.php [/FONT]page it will display a list of products within the product category that the product being displayed is a member of.

    [FONT=Courier New]$category_id = zen_get_products_category_id($_GET['products_id']);

    $cat_prod_array = zen_get_categories_products_list($category_id, '', '');

    $num_in_array = count($cat_prod_array);

    for ($t=0; $t<$num_in_array; $t++) {
    $tmp_prodid = $cat_prod_array[$t];
    $tmp_prodname = zen_get_products_name($tmp_prodid);
    echo '<br />';
    echo '<a href="index.php?main_page=product_info&cPath=' . $category_id . '&products_id=' . $tmp_prodid . '">' . $tmp_prodname . '</a>';
    }
    [FONT=Verdana]
    Hope you enjoy!
    [/FONT][/FONT]

  4. #4
    Join Date
    Jul 2005
    Posts
    97
    Plugin Contributions
    0

    help question Re: List of products in category (on product info page)

    Quote Originally Posted by nateveronica View Post

    $category_id = zen_get_products_category_id($_GET['products_id']);
    I'm assuming $category_id would give me the (sub) category id of the product. What about the master category? What is the code to get the master category id?


    Thanks,

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

    Default Re: List of products in category

    Understand that the master_categories_id is used to determin what Category "owns" the Product when it comes to Pricing for things like SaleMaker ...

    This is not always the "immediate" Category that you are in ...

    This is not the Parent Category when the Product is in SubCategories ...

    NOTE: If you never use Linked Products, then it doesn't matter if you use the master_categories_id or look up the Product categories_id in the products_to_categories table as it will always be the same ...
    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!

  6. #6
    Join Date
    Sep 2004
    Location
    Australia
    Posts
    347
    Plugin Contributions
    0

    Default Re: List of products in category

    Is there a way to place a thin horizontal line between products in the product list? I've looked all over admin section and seen nothing. Or a way to make the background on the product list alternate between white and grey? I'd prefer the horizontal line but which ever is posible would be good, if any.

    Thanks. I may try playing around with a php file. No idea which one though.

  7. #7
    Join Date
    Sep 2004
    Location
    Australia
    Posts
    347
    Plugin Contributions
    0

    Default Re: List of products in category

    NVM I've done it. The gloss_black template has it so I copied the itty bit of code from that stylesheet to mine and well, it worked!!

    For anyone who may want to do this, just add this:

    /*Product Listing*/
    .productListing-data {
    border-top: 1px solid #000000;
    padding: 0.50em 0em 0.50em 0em;
    }

    In between these 2:

    .smallText, #siteinfoLegal, #siteinfoCredits, #siteinfoStatus, #siteinfoIP {
    font-size: 0.9em;
    padding: .25em;
    }

    /*Shopping Cart Display*/
    #cartAdd {
    float: right;
    text-align: center;
    margin: 1em;
    border: 1px solid #000000;
    padding: 1em;
    }

    Have fun.
    www.easybeading.com.au

 

 

Similar Threads

  1. v154 How do I list products in sub category with in the parent category?
    By JoeToys in forum Setting Up Categories, Products, Attributes
    Replies: 38
    Last Post: 2 Dec 2018, 08:54 PM
  2. Disabling New Products & Enabling All Products in Category List
    By JRayfield in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 31 Jan 2010, 04:49 PM
  3. Category list to show products when in category
    By scottbrown_14 in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 4 Mar 2009, 12:27 PM
  4. Category with no products dont display"There are no products to list in this category
    By atracksler in forum Setting Up Categories, Products, Attributes
    Replies: 6
    Last Post: 3 Apr 2008, 05:47 AM
  5. Replies: 1
    Last Post: 17 Jan 2008, 08:52 PM

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