![]() |
How can I add an image as an extra field in 4.x? Or can I?
I'm trying to add a manufacturer logo (gif image) to each product I sell, but cannot figure out how. I want the image (approximately 100 x 30) to rest on top of the Title of the product a person is viewing. Can anyone tell me how to do this? Thank you.
|
How about hard-coding it into the description?
|
How would I do that exactly? I have about 40 different manufacturers with logos. 8O
|
Just call the image in your description using standard html.
|
Yeah, but what I mean is, I have about 2000 items now and don't want to go through each one individually if possible.
|
Maybe I am being thick here, but isn't that exacly what "Manufacturers" is for in 4.x?
You can add an image there for each manufacturer then just insert the proper variables in the product.tpl file where you want to see the logo. |
Thanks for the help too TelaFirma, very appreciated. How exactly would I do it as to not go through each item one by one? Also, what would be a sample code to use? Thanks.
|
You would need to set the images within Admin and then I would update all the products using an import.
|
I did this by putting
Code:
[img]mlogo.php?manufacturerid={$manufacturerid.manufacturerid}[/img] wherever you need the manufacturer's logo to display in product.tpl. If you would like the logo to link to the page that views all of the manufacturer's products, use Code:
<a href="manufacturers.php?manufacturerid={$manufacturerid.manufacturerid}"> Make sure you put the manufacturer's logo's in the admin side for this to display correctly. Otherwise, default_image.gif will show up. An example of it in action: http://www.heritagetoys.com/product.php?productid=16840&cat=0&page=1 |
Thank you very much!
|
Quote:
I apologize for the ignorance, can you explain how to put it on the admin side? (because of multiple manufacturers). Thank you. |
No problem at all. When you log in to your admin account, under the management menu on the left hand side, you will find "Manufacturers about 3rd down. Here you can create new manufacturers, change their display order, make them acitve/inactive. If you click on the name of a manufacturer, you can add a logo, description, and URL.
I've found with X-cart that the question "Where the #$%% do I find that setting?!?" to come up a lot. #-o :) you can surf around www.heritagetoys.com to see how it works w/multiple manufacuturers. |
Thank you. The way you have your site set up with it is exactly what I needed too. :)
|
Well, if I could ask one last question on this...
I have it displayed in product.tpl exactly how I want it. However, it still brings up the default image even though an image is added to the manufacturer. Is there something I'm missing? Thank you |
Check to make sure that you have not named a manufacturer in 2 different ways (example - Acme and Acme, inc.) and then associated all of your products with the manufacturer name that doesn't have a logo. Sounds silly, but that happened to me during a product import once. If its not that, then ???.
|
you have to add this
You have to add this to your product.php otherwise it won't work.
Code:
$manufacturer = func_query_first("SELECT manufacturer,image,image_type,manufacturerid FROM $sql_tbl[manufacturers] WHERE manufacturerid='$product_info[manufacturerid]'"); right above Code:
$smarty->assign("product",$product_info); by default the manufacturer image is not called as a variable. I did it on my site and it works great. good luck |
I like this and I would like to use this but the directions on exactly where to put this I am just not finding. Could someone detail exactly where to put these codes for the morons like me.
Thank you, |
In product.php as stated above. Are you not finding the code or not finding the file?
|
Ok I found it. I did it exactly the way the said it and **POOF** nothing.
|
Haven't looked at this thread in awhile. Sorry about steering you wrong w/forgeting the .php part. :oops:
Just to clarify things a little. Use the code weckie posted in product.php if you need the manufacturer to show up in product.tpl, products.php if it in products.tpl, and in include/search.php if you need it in the search. This is the original thread I found all of this originally: http://forum.x-cart.com/viewtopic.php?t=13883&highlight=manufacturer |
All times are GMT -8. The time now is 07:11 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.