This is a great tutorial on how to use multiple image directories. This allows you to manage your image files more efficiently if you have a lot of images or have multiple manufacturers with numerous images.
Tutorial by Markuz - agorasupport.com
Step by Step Guide
First of all, elect a userField to be reserved for your manufacturer - I recommend userFieldFive as the others tend to be reserved for other descriptions, large images, option files etc. So lets just assume that you're using userFieldFive for this tutorial....
You'll need to cheat server etiquette for this to work properly, assuming you actually want to include the name of the manufacturer as a search field and display the manufacturer as text on your product display so here is how we go about it.
In userFieldFive when you're adding or editing, enter the name of the manufacturer, for example...
Sony
Marantz
JVC
Philips
It is important that you ALWAYS use the manufacturer name in exactly the same way - so if you use all lowercase in the User5 field then you must use all lowercase everywhere else or certain things won't happen that should.
Now, go to your server and in your ROOT directory create a new graphics directory. I always use "gfx" as its short and to the point. Inside that directory, create new directories for ALL current manufacturers, retaining the case that you used in User5, for example your directories would be as follows.......
gfx/Sony
gfx/Marantz
gfx/JVC
gfx/Philips
OK, so you've got your directories set up with the names of the manufacturers so all you need to do now is set up your store to reflect this. Go into your Store Manager and if you've got the settings setup to use Picserve to display your pictures you need to ditch this and have them set up as follows.....
Please enter the full URL of your /images directory. For example:
http://www.yourdomain.com/cgi-bin/store/html/images
DO NOT include the trailing slash!!! /
Set this as: /gfx
(the "/" at the start means that your site will ALWAYS look to the root directory first, so keep that in there!)
Do you want to self-serve the images?
Set this as: No
Open up your agora.setup.db file in ASCII mode and edit this line....
$sc_image_string_template = '<IMG SRC="%%URLofImages%%/%%image%%" BORDER=0>';
to
$sc_image_string_template = '<IMG SRC="%%URLofImages%%/%%userFieldFive%%/%%image%%" BORDER=0>';
This means that whenever it wants to display the image for your product, it will read User5 first (your manufacturer field) and look inside that directory for the image. This is why it's important that whatever you input into the User5 field be EXACTLY the same as the name you give the directory or the image won't show up!!
Save the file again and re-upload in ASCII format
That's basically it! If you want to display the NAME of the manufacturer in text format on your productPage.inc file then add in %%userFieldFive%% wherever you want the manufacturer's name to be displayed. If you have also uploaded a logo for the manufacturer, make sure it's the SAME name as the name you used in the User5 field ie Sony.jpg not sony.jpg and place it in the manufacturer's directory. You can pull up this image anywhere in your productPage.inc by using the following line....
<img src="%%URLofImages%%/%%userFieldFive%%/%%userFieldFive%%.jpg">
This will go to your default folder, go into the folder for your manufacturer and use the corresponding logo so you'll actually end up with...
<img src="www.yourdomain.com/gfx/Marantz/Marantz.jpg"> for example.
If you want to allow your users to search by manufacturer then you'd have this link in your menu:
<form action="agora.cgi" method="post">
Search by manufacturer
<input type="text" size="15" name="user5">
<input type="submit" value="submit">
</form>
If you want your customers to be able to view "more by manufacturer" when they're looking at a particular product then you'd add this coding into your productPage.inc file....
<a href="agora.cgi?cart_id=&user5=%%userFieldFive%%>More By Manufacturer</a>
If you want your customers to be able to view "more by manufacturer" but within the SAME product category that they are currently viewing, you would add this coding into your productPage.inc file....
<a href="agora.cgi?cart_id=&user5=%%userFieldFive%%&p=%%product%%>Similar Items by this Manufacturer</a>
|
|