You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.
Hi
I want to add more field in the admin area to allow extra pictures to be easily displayed alongside the existing picture for products that require them.
I understand that this is achievable by adding columns to the products table and modifying ste_prod.pl - but this is only vaguely described on these forums.
Is there someone kind enough here to post a step by step tutorial on how to accomplish this modification?
I believe it's very simple to do but adding the extra image calls into the existing logic is mind boggling for me.
Cheers
Steven
Offline
(1) Use the admin Database Utilties | Manage User Defined Table Columns functions to add new columns. In this example, we'll add:
product_xtraimage1 product_xtraimage2 product_xtraimage3
(2) Open up the file ./cgi-bin/library/modules/ste_prod.pl for editing. In the routine 'ste_prod_detail', change:
$column_line = "product_id,product_name,product_number,product_pricestatus,product_regprice,product_saleprice,product_volprice,product_voltext,product_recurprice,product_recurstatus,product_keywords,product_usecatdisc,product_useinv,product_inv,product_imgxlguse,product_imgxlg,product_imglg,product_imgsm,product_lgdisp,product_descshort,product_desclong,product_xopt";
To:
$column_line = "product_id,product_name,product_number,product_pricestatus,product_regprice,product_saleprice,product_volprice,product_voltext,product_recurprice,product_recurstatus,product_keywords,product_usecatdisc,product_useinv,product_inv,product_imgxlguse,product_imgxlg,product_imglg,product_imgsm,product_lgdisp,product_descshort,product_desclong,product_xopt,product_xtraimage1,product_xtraimage2,product_xtraimage3";
And:
($product_id,$product_name,$product_number,$product_pricestatus,$product_regprice,$product_saleprice,$product_volprice,$product_voltext,$product_recurprice,$product_recurstatus,$product_keywords,$product_usecatdisc,$product_useinv,$product_inv,$product_imgxlguse,$product_imgxlg,$product_imglg,$product_imgsm,$product_lgdisp,$product_descshort,$product_desclong,$product_xopt) = @$row;
To:
($product_id,$product_name,$product_number,$product_pricestatus,$product_regprice,$product_saleprice,$product_volprice,$product_voltext,$product_recurprice,$product_recurstatus,$product_keywords,$product_usecatdisc,$product_useinv,$product_inv,$product_imgxlguse,$product_imgxlg,$product_imglg,$product_imgsm,$product_lgdisp,$product_descshort,$product_desclong,$product_xopt,$product_xtraimage1,$product_xtraimage2,$product_xtraimage3) = @$row;
This will get all three columns available as variables in your product detail display elements. They will be available as:
(CGIVAR)product_xtraimage1(/CGIVAR) (CGIVAR)product_xtraimage2(/CGIVAR) (CGIVAR)product_xtraimage3(/CGIVAR)
Offline
I've done all the steps above and now have a new Text Field in the Admin for each Product. I can also get it to display whatever is typed in that field by using (CGIVAR)product_xtraimage1(/CGIVAR), but how would I make it so it displays a link to a new popup image instead of just displaying "item123.jpg"?
So under my default product image I would have VIEW1 - VIEW2 - VIEW3, and when you click on those, the appropriate popup image is loaded.
I think something has to be changed in "ste_prod_show_image_detail" routine, but I cant get it to work.
I've seen this done and working nicely on wwwsarcasticclothing.com
Offline
In your product detail element, add this:
(CGIGET TYPE="SUB" VALUE="ste_prod_show_image_detail" PARAMS="(CGIVAR)product_imglg(/CGIVAR)|(CGIVAR)product_xtraimage1(/CGIVAR)|(CGIVAR)product_imgxlguse(/CGIVAR)")<BR> (CGIGET TYPE="SUB" VALUE="ste_prod_show_image_detail" PARAMS="(CGIVAR)product_imglg(/CGIVAR)|(CGIVAR)product_xtraimage2(/CGIVAR)|(CGIVAR)product_imgxlguse(/CGIVAR)")<BR> (CGIGET TYPE="SUB" VALUE="ste_prod_show_image_detail" PARAMS="(CGIVAR)product_imglg(/CGIVAR)|(CGIVAR)product_xtraimage3(/CGIVAR)|(CGIVAR)product_imgxlguse(/CGIVAR)")<BR>
Offline
Thanks Nick. But all this does is display the default product image again. Somehow I have to specify where the new "product_xtraimage" are located, no?
I dont want it to display more then one image in the product detail, I want to have 2 or 3 separate popup xtra large images.
Take a look at this example:
Offline
Then you'll need to make edits to the routine 'ste_prod_show_image_detail' in the file ./cgi-bin/library/modules/ste_prod.pl. Look for where it prints the image and do whatever you need to there.
Offline
hi,
has anyone sucessfully done the above mod?
cheers
Charlie
Offline
I am attempting the mod for the second image display - not linked, but static. I am getting a second image and have made changes to the 'ste_prod_show_image_detail' but am still gettig the original product detail image as the second image.
I created a second folder named 'product_detail2' for the second detail images
The edits below made sense to me but aren't working-
------------
my ($imglg,$xtraimage1,$imgxlg,$imgxlguse) = @_;
if (($imglg ne "") && (-e "$server_media_path/images/product_detail/$imglg")) {
if (($xtraimage1 ne "") && (-e "$server_media_path/images/product_detail2/$xtraimage1")) {
if (($imgxlg ne "") && (-e "$server_media_path/images/product_xlarge/$imgxlg") && ($imgxlguse eq "Y")) {
$image_url = "$images_path/product_detail/$imglg";
$image_url = "$images_path/product_detail2/$xtraimage1";
$popup_image_url = "$images_path/product_xlarge/$imgxlg";
------------and
print "<IMG SRC=\"$images_path/product_detail/$imglg\" WIDTH=\"$store_large_image_width\" BORDER=\"0\">";
print "<IMG SRC=\"$images_path/product_detail/$xtraimage1\" WIDTH=\"$store_large_image_width\" BORDER=\"0\">";
I'm not a code writer, but can figure some stuff out after awhile. Can anyone tell me what is wrong. This would work perfectly for me if I could get the right image to come up for 'xtraimage1'.
Merry Christmas!
RoxAnne
Offline
Update:
In Nick's reply
In your product detail element, add this: (CGIGET TYPE="SUB" VALUE="ste_prod_show_image_detail" PARAMS="(CGIVAR)product_imglg(/CGIVAR)|(CGIVAR)product_xtraimage1(/CGIVAR)|(CGIVAR)product_imgxlguse(/CGIVAR)")<BR>
Shouldn't it be 'replace'? Doing it that way removes the second original image. (Working from the original Default Image Display.) But I still don't have the print function right. I did find a typo - the 2 in one folder name.
Grateful to anyone who posts the answer. :-)
RoxAnne
Offline
ATS has a great mod for this which has a more professional appearance, I would highly recommend using that (and all of his services) for this.
Offline