Results 1 to 6 of 6
  1. #1
    Join Date
    Dec 2006
    Posts
    4
    Plugin Contributions
    0

    Default Showing category image as featured product image

    The site I am working on is at http://s142103556.websitehome.co.uk/.
    As you can see it is being used to sell mobile phones. Due to the fact that each phone has a large number of deals, which each cost different ammounts I have decided to make each phone into a sub-category.
    I would like to show some of these phones on the front page, I have been trying to edit the Featured Products, listing to make this possible.

    The main problem is that currently the product image (just the network logo) is being shown rather than the phone image.
    I have tried to do this by replacing:
    PHP Code:
    zen_image(DIR_WS_IMAGES $featured_products->fields['products_image'], $featured_products->fields['products_name'], 
    with
    PHP Code:
    zen_image(DIR_WS_IMAGES $categories->fields['categories_image'], $categories->fields['categories_name'], 
    but that only worked on pages where the image had already appeared.

    Could someone please give me the db query so that $categories is defined correctly.

    Thanks,
    Lydia

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: Showing category image as featured product image

    The images named orange.jpg and O2.jpg are images the you must have uploaded as the product image.

    Don't hack the code - upload the correct image for the product.
    Zen-Venom Get Bitten

  3. #3
    Join Date
    Dec 2006
    Posts
    4
    Plugin Contributions
    0

    Default Re: Showing category image as featured product image

    But on the category page I still want to see the network provider logos, so visitors can easily see which provider each deal is from.

  4. #4
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: Showing category image as featured product image

    Add these plan images as additional images by renaming a copy if the image with the phone image name followed by a sffix of _1 & _2 etc

    This way you can easily remove a plan logo when this changes by removing it's image
    Zen-Venom Get Bitten

  5. #5
    Join Date
    Dec 2006
    Posts
    4
    Plugin Contributions
    0

    Default Re: Showing category image as featured product image

    Err sorry but I don't really see how that will help.

  6. #6
    Join Date
    Dec 2006
    Posts
    4
    Plugin Contributions
    0

    Default Re: Showing category image as featured product image

    Never mind I have now managed it. The queries needed to be changed to

    PHP Code:
    if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) {
      
    $featured_products_query "select distinct p.products_id, p.products_image, pd.products_name, c.categories_image, cd.categories_name
                               from (" 
    TABLE_PRODUCTS " p
                               left join " 
    TABLE_FEATURED " f on p.products_id = f.products_id 
                               left join " 
    TABLE_PRODUCTS_DESCRIPTION " pd on p.products_id = pd.products_id
                               
                               left join " 
    TABLE_PRODUCTS_TO_CATEGORIES " p2c on p.products_id = p2c.products_id
                               left join " 
    TABLE_CATEGORIES_DESCRIPTION " cd on p2c.categories_id = cd.categories_id),
                       
                               " 
    TABLE_CATEGORIES " c
                               
                               where p.products_id = p2c.products_id
                               and p2c.categories_id = c.categories_id
                               and p.products_id = f.products_id and p.products_id = pd.products_id and p.products_status = 1 and f.status = 1 and pd.language_id = '" 
    . (int)$_SESSION['languages_id'] . "'";
    } else {
      
    $featured_products_query "select distinct p.products_id, p.products_image, pd.products_name, c.categories_image, cd.categories_name
                               from (" 
    TABLE_PRODUCTS " p
                               left join " 
    TABLE_FEATURED " f on p.products_id = f.products_id
                               left join " 
    TABLE_PRODUCTS_DESCRIPTION " pd on p.products_id = pd.products_id 
                               
                               left join " 
    TABLE_PRODUCTS_TO_CATEGORIES " p2c on p.products_id = p2c.products_id
                               left join " 
    TABLE_CATEGORIES_DESCRIPTION " cd on p2c.categories_id = cd.categories_id),
                       
                               " 
    TABLE_CATEGORIES " c
                               where p.products_id = p2c.products_id
                               and p2c.categories_id = c.categories_id
                               and c.parent_id = '" 
    . (int)$new_products_category_id "'
                               and p.products_id = f.products_id and p.products_id = pd.products_id and p.products_status = 1 and f.status = 1 and pd.language_id = '" 
    . (int)$_SESSION['languages_id'] . "'";



 

 

Similar Threads

  1. Remove product image from product page NOT category image
    By rgoetz in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 3 Aug 2011, 11:25 AM
  2. Different category image and product image
    By audiomandan in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 31 Mar 2011, 08:55 AM
  3. Category featured image: I want to show only subcategories, not featured products!
    By ilmarchez in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 3 Dec 2010, 05:33 PM
  4. image per category with no product image
    By momora in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 1 Oct 2009, 03:00 PM
  5. Prevent top category image from showing on product page?
    By JHouse in forum Templates, Stylesheets, Page Layout
    Replies: 7
    Last Post: 19 Feb 2009, 04:08 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