Page 3 of 5 FirstFirst 12345 LastLast
Results 21 to 30 of 48
  1. #21
    Join Date
    Aug 2010
    Location
    Hartland, MI
    Posts
    282
    Plugin Contributions
    3

    Default Re: Automatically populate category images from their product images

    Ok took store off "Down for Maintenance" and re implemented the changed category_row.php file.
    Check it out - here

  2. #22
    Join Date
    May 2004
    Location
    UK
    Posts
    478
    Plugin Contributions
    0

    Default Re: Automatically populate category images from their product images

    I keep getting sent back to home page not into category?

  3. #23
    Join Date
    Aug 2010
    Location
    Hartland, MI
    Posts
    282
    Plugin Contributions
    3

    Default Re: Automatically populate category images from their product images

    Quote Originally Posted by SarahL View Post
    I keep getting sent back to home page not into category?
    Yup - the question is why?

  4. #24
    Join Date
    Aug 2010
    Location
    Hartland, MI
    Posts
    282
    Plugin Contributions
    3

    Default Re: Automatically populate category images from their product images

    Well I have to take the store back down for the weekend, hopefully we can figure it on monday...

  5. #25

    Default Re: Automatically populate category images from their product images

    I'm just getting started with zencart. This was exactly what I was looking for with the random category pictures. However, it shows up the image unavailable picture for all. In the code, it should kick it to the transpixelgif if no file exists. I'm confused. You can check it out here: www.cheaperbyfar.com.

    Thanks,
    Will

  6. #26
    Join Date
    Aug 2010
    Location
    Hartland, MI
    Posts
    282
    Plugin Contributions
    3

    Default Re: Automatically populate category images from their product images

    I ended up giving up (kept looping me back to the index page) and making all of my category photos using multiple photos of products for that category, came out very nice, but time consuming.

  7. #27
    Join Date
    Jul 2010
    Location
    Kent UK
    Posts
    50
    Plugin Contributions
    0

    Default Re: Automatically populate category images from their product images

    This is my Category row.php - works for me although i am not using category images on home page or seo urls.

    Infact i am using the css categories menu so dont even need this anymore.....

    <?php
    /**
    * index category_row.php
    *
    * Prepares the content for displaying a category's sub-category listing in grid format.
    * Once the data is prepared, it calls the standard tpl_list_box_content template for display.
    *
    * @package page
    * @copyright Copyright 2003-2006 Zen Cart Development Team
    * @copyright Portions Copyright 2003 osCommerce
    * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
    * @version $Id: category_row.php 4084 2006-08-06 23:59:36Z drbyte $
    */
    if (!defined('IS_ADMIN_FLAG')) {
    die('Illegal Access');
    }

    $title = '';
    $num_categories = $categories->RecordCount();

    $row = 0;
    $col = 0;
    $list_box_contents = '';
    if ($num_categories > 0) {
    if ($num_categories < MAX_DISPLAY_CATEGORIES_PER_ROW || MAX_DISPLAY_CATEGORIES_PER_ROW == 0) {
    $col_width = floor(100/$num_categories);
    } else {
    $col_width = floor(100/MAX_DISPLAY_CATEGORIES_PER_ROW);
    }

    while (!$categories->EOF) {

    global $db;
    $sql = "select products_image from " . TABLE_PRODUCTS . " where master_categories_id = " . $categories->fields['categories_id'] . " AND products_image IS NOT NULL AND products_image != '.jpg' AND products_image != '' ORDER BY RAND() LIMIT 1";
    $result = $db->Execute($sql);

    $cat_image = $result->fields['products_image'];
    $filename = DIR_WS_IMAGES . $cat_image;


    if (file_exists($filename)) {


    } else {

    $cat_image = "pixel_trans.gif";
    }

    if (!$categories->fields['categories_image']) !$categories->fields['categories_image'] = $cat_image;


    $cPath_new = zen_get_path($categories->fields['categories_id']);

    // strip out 0_ from top level cats
    $cPath_new = str_replace('=0_', '=', $cPath_new);

    // $categories->fields['products_name'] = zen_get_products_name($categories->fields['products_id']);

    $list_box_contents[$row][$col] = array('params' => 'class="categoryListBoxContents"' . ' ' . 'style="width:' . $col_width . '%;"',
    'text' => '<a href="' . zen_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . zen_image(DIR_WS_IMAGES . $categories->fields['categories_image'], $categories->fields['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br />' . $categories->fields['categories_name'] . '</a>');

    $col ++;
    if ($col > (MAX_DISPLAY_CATEGORIES_PER_ROW -1)) {
    $col = 0;
    $row ++;
    }
    $categories->MoveNext();
    }
    }
    ?>

  8. #28
    Join Date
    Aug 2010
    Location
    Hartland, MI
    Posts
    282
    Plugin Contributions
    3

    Default Re: Automatically populate category images from their product images

    WebMC-
    Thank you for reposting the code, I don't need it now thou...
    check out the images I ended up making here
    I'll have the store up till 5pm EST as I'm working on it.

  9. #29
    Join Date
    Jul 2010
    Location
    Kent UK
    Posts
    50
    Plugin Contributions
    0

    Default Re: Automatically populate category images from their product images

    good stuff good luck with the store - nice website name btw!

  10. #30

    Default Re: Automatically populate category images from their product images

    Dunno, copied yours in exactly, still doesn't work. Guess I'm gonna go the other route.....come back to this later. The other addon I have installed is category dressing, but don't think that's interfering.

 

 
Page 3 of 5 FirstFirst 12345 LastLast

Similar Threads

  1. Category images from product images
    By korayp in forum All Other Contributions/Addons
    Replies: 3
    Last Post: 22 Dec 2009, 04:12 PM
  2. How do I keep the banner images from resizing automatically?
    By bparker in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 19 Nov 2008, 03:33 AM
  3. Populate Images by Category and Product
    By borillion_star in forum Customization from the Admin
    Replies: 0
    Last Post: 1 Sep 2008, 08:57 PM
  4. Automatically populate sub category images + change attribute ordering
    By GTrotter in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 30 Apr 2007, 07:54 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