Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2007
    Posts
    62
    Plugin Contributions
    0

    Default Splitting product_listing array and wrapping containers around

    Hello,

    We're working on a small shop, where on the category page we'd like output the products in blocks of nine, with the possibility to click through to the next nine. I've got the script for doing that, but I'm not sure how I'd split the array in the product_listing module apart.

    We'd like to wrap a DIV around every nine products. Say we've got 20 products on a page, we'd like to end up with a structure like this:

    Code:
    <div class="ourblock">
      Products 1-9
    </div>
    
    <div class="ourblock">
      Products 10-18
    </div>
    
    <div class="ourblock">
      Products 19-20
    </div>
    I can see in the file where it loops through the products, but I'm not sure how I'd check for nine products and wrap a DIV around them, then move on to the next lot.. would be great if someone could offer some coding insight on this!

    Thanks, Karl

  2. #2
    Join Date
    Jul 2006
    Location
    Montreal, Canada
    Posts
    2,279
    Plugin Contributions
    0

    Default Re: Splitting product_listing array and wrapping containers around

    i think it is much easier to use this module


    Column Layout Grid for Product Listing
    http://www.zen-cart.com/index.php?ma...products_id=77

  3. #3
    Join Date
    Jun 2007
    Posts
    62
    Plugin Contributions
    0

    Default Re: Splitting product_listing array and wrapping containers around

    tony_sar,

    many thanks! I'd actually used this contributions before and even looked at it again when I was trying to solve this problem, though I wasn't sure how I'd do the wrapping. But your prod got me going again..

    I set the contribution to list columns, 9 per row and then used an override for tpl_columnar_display.php where I added the DIVs at the beginning and end of each loop of nine.

    Works great now, thanks for you help!

  4. #4
    Join Date
    Jul 2006
    Location
    Montreal, Canada
    Posts
    2,279
    Plugin Contributions
    0

    Default Re: Splitting product_listing array and wrapping containers around

    glad that mod helped out

 

 

Similar Threads

  1. Text wrapping around the product image
    By locom in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 20 Apr 2011, 03:04 AM
  2. Wrapping text around image, and borders not working in IE
    By timmyneal in forum Templates, Stylesheets, Page Layout
    Replies: 15
    Last Post: 11 Nov 2009, 08:49 AM
  3. wrapping text around images
    By Karole in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 5 Mar 2007, 07:19 PM
  4. Stop text wrapping around product image?
    By mattys in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 23 Nov 2006, 07:47 PM

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