Kryptronic Software Support Forum

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.

#1 09-18-2004 02:48:39

Steven
Member
Registered: 04-21-2004
Posts: 84

Adding More Images To Product

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

 

#2 09-24-2004 15:36:08

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19798
Website

Re: Adding More Images To Product

(1) Use the admin Database Utilties | Manage User Defined Table Columns functions to add new columns.  In this example, we'll add:

Code:


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:

Code:


$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:

Code:


$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:

Code:


($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:

Code:


($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:

Code:


(CGIVAR)product_xtraimage1(/CGIVAR)
(CGIVAR)product_xtraimage2(/CGIVAR)
(CGIVAR)product_xtraimage3(/CGIVAR)


Nick Hendler

Offline

 

#3 11-14-2004 19:42:46

Petro
Member
Registered: 09-16-2003
Posts: 31

Re: Adding More Images To Product

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

 

#4 11-15-2004 12:58:11

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19798
Website

Re: Adding More Images To Product

In your product detail element, add this:

Code:


(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>


Nick Hendler

Offline

 

#5 11-15-2004 14:28:49

Petro
Member
Registered: 09-16-2003
Posts: 31

Re: Adding More Images To Product

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

 

#6 11-24-2004 12:27:49

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19798
Website

Re: Adding More Images To Product

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.


Nick Hendler

Offline

 

#7 11-29-2004 05:54:26

thedon122
Member
Registered: 01-21-2004
Posts: 155

Re: Adding More Images To Product

hi,

has anyone sucessfully done the above mod?

cheers
Charlie

Offline

 

#8 12-25-2004 03:32:42

roxie
Member
From: Central Oregon
Registered: 11-17-2003
Posts: 80
Website

Re: Adding More Images To Product

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

 

#9 12-25-2004 04:08:37

roxie
Member
From: Central Oregon
Registered: 11-17-2003
Posts: 80
Website

Re: Adding More Images To Product

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

 

#10 01-14-2005 15:46:37

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19798
Website

Re: Adding More Images To Product

You would replace the code if you printed both images from within the same routine.  I was suggesting you made two calls to the routine.


Nick Hendler

Offline

 

#11 01-14-2005 16:09:48

acetracer
Member
Registered: 02-20-2004
Posts: 48

Re: Adding More Images To Product

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

 

Board footer