Loaded Commerce Community

Banner


Board index » Web Design and Development » Designers Workshop

All times are UTC - 5 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Show manufacturer image instead of name on product listings
PostPosted: Fri Sep 16, 2011 5:49 pm 
Offline
CRE Freak

Joined: Sat Aug 01, 2009 9:54 am
Posts: 37
Ok pretty straight forward on this one... I hope... all I'd like to do is display the image for the product's Manufacturer on all of my product listing pages instead of just the text for the product's manufacturer.

Unlike usual I know where the code I want to alter is located, I just don't know how it needs to be changed to do what I want.

Code from catalog\includes\modules\product_listing.php
Code:
case 'PRODUCT_LIST_MANUFACTURER':
$lc_align = '';
$lc_text = '&nbsp;<a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing[$x]['manufacturers_id'] . $params) . '">' . $listing[$x]['manufacturers_name'] . '</a>&nbsp;';
            break;


I've been playing around with many different things and I thought initially that it might be as simple as just changing that little part that says ['manufacturers_name'] to ['manufacturers_image'] but that gave me nothing but a blank space.

I've also try to pull code out of the manufacturer_info.php file, specifically this part:
Code:
tep_image(DIR_WS_IMAGES . $manufacturer['manufacturers_image'], $manufacturer['manufacturers_name'])
and put it in the code above in many different ways but came up with no better results.

I'm sure I must be close but it's eluding me, anybody have any suggestions?


Top
 Profile  
 
 Post subject: Re: Show manufacturer image instead of name on product listings
PostPosted: Fri Sep 16, 2011 9:08 pm 
Offline
CRE Legend
User avatar

Joined: Thu Jun 12, 2008 6:39 am
Posts: 2405
Location: New Zealand
Half way there I suppose. Because product_listing.php doesn't actually make the calls to the database (and manufacturers_image isn't one that's in the tep_db_query.) Try looking at /index.php, take it from there.

Simon

_________________
www.codemehappy.com
For Cre Loaded tips, how-to articles and more


Top
 Profile  
 
 Post subject: Re: Show manufacturer image instead of name on product listings
PostPosted: Sat Sep 17, 2011 10:41 am 
Offline
CRE Talented

Joined: Sun Nov 29, 2009 10:57 am
Posts: 352
AUwebman1 wrote:

I've been playing around with many different things and I thought initially that it might be as simple as just changing that little part that says ['manufacturers_name'] to ['manufacturers_image'] but that gave me nothing but a blank space.

I've also try to pull code out of the manufacturer_info.php file, specifically this part:
Code:
tep_image(DIR_WS_IMAGES . $manufacturer['manufacturers_image'], $manufacturer['manufacturers_name'])
and put it in the code above in many different ways but came up with no better results.

I'm sure I must be close but it's eluding me, anybody have any suggestions?


Try This:
Code:
          case 'PRODUCT_LIST_MANUFACTURER':
            $lc_align = '';
       $manufactures_query = tep_db_query("select manufacturers_image from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$listing[$x]['manufacturers_id'] . "'");
       $manu_image = tep_db_fetch_array($manufactures_query);
            $lc_text = '&nbsp;<a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing[$x]['manufacturers_id'] . $params) . '">' . tep_image(DIR_WS_IMAGES . $manu_image['manufacturers_image'], tep_get_manufacturers_name((int)$listing[$x]['manufacturers_id'])) . '</a>&nbsp;';
            break;


This is the easy quick way for the listings page only... Personally, I would add a call to the manufacturers image in each of the database queries within index.php, that way you can just call the image to display using
Code:
$listing[$x]['manufacturers_image']


Hope it helps

_________________
CSS Store - http://mdjl40.mdjl-demo.co.uk -Work in Progress
YMM Filter Lists - http://mdjl-demo.co.uk/6-4-1a -Pagnation/Filter Lists


Top
 Profile  
 
 Post subject: Re: Show manufacturer image instead of name on product listings
PostPosted: Tue Sep 20, 2011 6:02 pm 
Offline
CRE Freak

Joined: Sat Aug 01, 2009 9:54 am
Posts: 37
TheLango - thanks! The longer bit of code you gave me for the product_listing.php file worked perfectly.

Would there be any reason why I would want to put that shorter bit of code into the index.php file instead? Other than the fact that it is shorter and more simplified? I'm assuming the old saying "If it isn't broke, don't fix it," applies here. I did try but I couldn't figure out where to insert it, and I got a few critical store errors in the process.

I'm feeling really close now to going live with v6.4...and of course right on cue now v6.5 is coming out :roll: :lol:


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

Board index » Web Design and Development » Designers Workshop

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
It is currently Thu May 24, 2012 6:49 am
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

Login

Forums Latest Activity

Top Listing

1. Cart2Cart - Shopping...
    Category: Shopping Cart Database Conversion Scripts
    
2. Points & Rewards PLUS!...
    Category: Add-Ons
    
3. Configuration Server...
    Category: Fixes
    
4. Credit Card with CCV
    Category: Payment Modules
    
5. CC7333_ATS
    Category: Templates
    
Show more...

© CRE Loaded is a product of Chain Reaction Ecommerce, Inc. Usage & Privacy Policy