Results 1 to 3 of 3

Hybrid View

  1. #1
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Shopping Cart Sidebox Grouping

    I'm not sure if the sidebox code has the product's cPath info available, but there is a zen_ function to look up a product id's master category id. You could add that as a new field to the output array, then sort the array contents by the value of that field.

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

    Default Re: Shopping Cart Sidebox Grouping

    If you can sort by categories_id, products_name for this ... you could customize the file:
    /includes/templates/your_template_dir/sideboxes/tpl_shopping_cart.php

    and add the code in RED to do this:
    Code:
        $products = $_SESSION['cart']->get_products();
    
    // bof: sort by master_categories_id and products_name
        function sort_products_category_name($a, $b) {
          $retval = strnatcmp($a['category'], $b['category']);
          if(!$retval) return strnatcmp($a['name'], $b['name']);
            return $retval;
          }
    
          usort($products, 'sort_products_category_name');
    // eof: sort by master_categories_id and products_name
    
        for ($i=0, $n=sizeof($products); $i<$n; $i++) {
    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!

 

 

Similar Threads

  1. adding shopping cart image to shopping cart sidebox?
    By RobertG in forum Addon Sideboxes
    Replies: 13
    Last Post: 26 Oct 2011, 06:24 AM
  2. Shopping Cart menu as a sidebox outside Zen-Cart -security
    By fl33140 in forum Templates, Stylesheets, Page Layout
    Replies: 11
    Last Post: 18 Feb 2011, 09:03 PM
  3. Remove right sidebox shopping cart from when on shopping cart page
    By alterego55 in forum Templates, Stylesheets, Page Layout
    Replies: 7
    Last Post: 2 Oct 2010, 01:45 AM
  4. Grouping Items in Shopping Cart
    By genuine15 in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 30 Jan 2009, 05:40 PM
  5. shopping cart sidebox with checkout button only when cart is full
    By sunnydaydreame in forum Basic Configuration
    Replies: 0
    Last Post: 5 Feb 2008, 12:52 AM

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