Page 1 of 2 12 LastLast
Results 1 to 10 of 16
  1. #1
    Join Date
    Aug 2006
    Location
    portlandish, oregon
    Posts
    799
    Plugin Contributions
    0

    Default productListHeading images?

    I would like my productListHeadings to each have a different image. So if you search by brand, the brand's image/banner will show up, and if you search by category, I can have an image show up for each one. Just not sure how to go about doing this, or if it is even possible

  2. #2
    Join Date
    Apr 2006
    Posts
    265
    Plugin Contributions
    0

    Default Re: productListHeading images?

    I'm not clear on what you're describing. Can you post a mock-up of what you're trying to achieve?

    BrandTim

  3. #3
    Join Date
    Aug 2006
    Location
    portlandish, oregon
    Posts
    799
    Plugin Contributions
    0

    Default Re: productListHeading images?

    Basically...the heading at the top says (Tops, T-shirts, Shoes, (Brand name) etc...) I was thinking about making different images for each heading and having that show instead of text...I was also thinking about possibly putting descriptions, and I do realize this can be achieved with category descriptions, but don't know how I would do that for a brand without making each brand it's own category.

    Ex1 is what it currently looks like...
    Ex2 is what I would possibly want it to look like instead...
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	Ex1.jpg 
Views:	215 
Size:	79.5 KB 
ID:	2419   Click image for larger version. 

Name:	Ex2.jpg 
Views:	208 
Size:	83.6 KB 
ID:	2420  

  4. #4
    Join Date
    Apr 2006
    Posts
    265
    Plugin Contributions
    0

    Default Re: productListHeading images?

    The productListHeadings are from categories with products in them. ZenCart already supports having images for categories, so this is a built-in function. Just upload your category images, fix the sizes in the admin, and then remove the category name display from your template.

    If you could use the manufacturer field for the brand you could do the same thing with the images there. It wouldn't be hard to add a field in the database for manufacturer's description and add that to your template...

    Does this make sense?

    BrandTim

  5. #5
    Join Date
    Aug 2006
    Location
    portlandish, oregon
    Posts
    799
    Plugin Contributions
    0

    Default Re: productListHeading images?

    Totally makes sense with the categories. The only thing I am wondering is...I have category images for all my subcategories already, so if you go to GIRLS, there are pictures of all the subcategories for girls, but these are not the images I would want to use for the headings. If that makes sense.

    I think I am being to0 OCD about things.

    The manufacturers...when it comes to altering the database, I wouldn't know what to do.

  6. #6
    Join Date
    Apr 2006
    Posts
    265
    Plugin Contributions
    0

    Default Re: productListHeading images?

    Ok, one thing at a time.

    Basically it sounds like you want two category images: one to display 'one level up', ie. an image for Tops, T-Shirts, Tank Tops, etc. on the Girls page, and a second image to replace the category heading text.

    Second, I see that you're already using the manufacturer as the brand .... are you using the manufacturer image option at present? Either way, you could basically do the same thing as above.

    Both of these are fairly easily done. How much have you worked with PHP and databases? I know you said you wouldn't know what to do to modify the database, but if I give you an SQL command would you know how to run it?

    BrandTim

  7. #7
    Join Date
    Aug 2006
    Location
    portlandish, oregon
    Posts
    799
    Plugin Contributions
    0

    Default Re: productListHeading images?

    I am not using a manufactuer image at the moment. I've played around with it, but the image didn't show up anywhere. Then I read in another thread that it only shows up in the manufacturers sidebox when you are on the product info page...

    and yes I can run an SQL command

  8. #8
    Join Date
    Apr 2006
    Posts
    265
    Plugin Contributions
    0

    Default Re: productListHeading images?

    Cool beans.

    One thing at a time then. Let's start with replacing the category header text with an image.

    First thing is to make space in your database for a second category image. Run this SQL:

    Code:
    ALTER TABLE `categories` ADD `categories_image_header` VARCHAR( 64 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL ;
    Now you'll need to be able to add an image there.

    If you haven't modified your admin/categories.php file and you're using ZC1.3.7, you can replace it with the attached file. If you have modified that file, I recommend using WinMerge to do a file compare. There are three new sections that need to be added.

    Last is to make it display.

    In your includes/templates/YOUR_TEMPLATE/templates/tpl_index_product_list.php file, replace this:
    Code:
    <h1 id="productListHeading"><?php echo $breadcrumb->last(); ?></h1>
    with this:
    Code:
    <?php
        $the_products_category = $db->Execute("select categories_image_header from " . TABLE_CATEGORIES . " where categories_id= '" . $current_category_id . "'");
        $category_image_header = $the_products_category->fields['categories_image_header'];
        if ($category_image_header) {
    ?>
    <div id="categoryImgHeaderListing" class="categoryImgHeader"><?php echo zen_image(DIR_WS_IMAGES . $category_image_header, '', YOUR_WIDTH_HERE, YOUR_HEIGHT_HERE); ?></div>
    <?php } else { ?>
    <h1 id="productListHeading"><?php echo $breadcrumb->last(); ?></h1>
    <?php } ?>
    You'll need to alter the height and width to fit your design.

    Let me know when you've got that working and we'll see about the brand images.

    BrandTim
    Attached Files Attached Files

  9. #9
    Join Date
    Aug 2006
    Location
    portlandish, oregon
    Posts
    799
    Plugin Contributions
    0

    Default Re: productListHeading images?

    alright so got everything going...how or where do I change the height and width...do I just put in 60px where height would be, or do I have to write it a certain way? Besides that, looks like it is working. I have the new space in the categories to upload a second image!

  10. #10
    Join Date
    Apr 2006
    Posts
    265
    Plugin Contributions
    0

    Default Re: productListHeading images?

    Good stuff.

    Yes, you just replace YOUR_HEIGHT_HERE with 60px, but you need to format it as a string so it needs quotes, like this:
    Code:
    '60px'
    That should do it.

    BrandTim

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 2
    Last Post: 5 Sep 2014, 03:28 AM
  2. Replace productListHeading with image
    By TonyB6 in forum Templates, Stylesheets, Page Layout
    Replies: 7
    Last Post: 19 Aug 2011, 01:06 PM
  3. productListHeading
    By d1rage5 in forum Setting Up Categories, Products, Attributes
    Replies: 6
    Last Post: 27 Jul 2008, 01:39 AM
  4. productListHeading size for category name??
    By StevenB in forum General Questions
    Replies: 4
    Last Post: 29 May 2007, 02:33 AM
  5. Images: Shop/images or Upgrade/images
    By MeltDown in forum Upgrading from 1.3.x to 1.3.9
    Replies: 2
    Last Post: 24 Dec 2006, 05:56 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