Thumbnail (scaled down) Product Images (gif or jpg) in Checkout Phase - tested with V4.1 and V5.1 Assuming you have some product images whose filenames are related to your product references then it is possible to display these images at the checkout phase. The images can be in either jpg or gif format but the extensions must lower case for the code to work. These patches can be implemented with just a single line of perl but have grown rather large due to the addition of the option of scaling down the image sizes. To do this make the following changes to ShoppingCart.pl and ActinicOrder.pm (also change ActinicSCCode.fil if using V5) in your Site1 folder (make backup copies first). Make sure you use a text editor and not a word processor program (see www.editpadlite.com if you need one). The following code has been tested on Win32 and Unix with Catalog V4.1 and V5.1. The code should work with Business and other version numbers. In the patches that follow the 1st 6 lines are user modifiable: 1) You should replace '../htdocs/acatalog/' with the information from Actinic / Advanced / Network field:- "Path From CGI-BIN To Catalog Directory". 2) Change $NorcatScale to whatever scale down factor you like ( 2 gives half sized images, 1 full size, fractions are OK ). You can set a different scale for the Add to Cart page (ShoppingCart.pl patch) and The order summary (AcinicOrder.pm and (ActinicSCCode.fil - V5)). This can be useful as there is less space on the summary pages, especially if multi currency is in use. 3) Also if you have a prefix or postfix (4) to your image file names (i.e. bits that aren't part of the product reference) then add that text to $NorcatImagePrefix and $NorcatImageSuffix. 5) You can also amend the code that starts and ends (6) the cart image. Note that this code is slightly different between the Add to Cart (ShoppingCart.pl) page and the other order pages as there is more room on the Add to Cart page. Patching instructions:- In ShoppingCart.pl (V4 and V5 versions) locate the line (there should be only one instance) $VariableTable{$::VARPREFIX."PRODUCTNAME"} = $sLine; # add the product name to the var table change this line to read $VariableTable{$::VARPREFIX."PRODUCTNAME"} = $NorcatImage . $sLine; # add the product name to the var table and INSERT the following code immediately above it:- ############################# CHECKOUT-IMAGE with scaling V1.1 ####################################### # ShoppingCart.pl (V4 and V5 versions) patch # # author Norman Rouxel www.drillpine.biz (V11) # user modifiable variables my $NorcatCatPath = '../htdocs/acatalog/'; # Path From CGI-BIN To Catalog Directory (Actinic/Advanced/Network) my $NorcatImagePrefix = ''; # optional text that prefixes product ref in image filenames my $NorcatImageSuffix = ''; # optional text that follows product ref in image filenames my $NorcatScale = 2; # e.g. 2 -> half size thumbnails. 1 -> full size. Fractions OK. my $NorcatImageStart = '' . $Response[1] . ''; change it to read $ProdName .= '' . '' . $Response[1] . $NorcatImage . ''; and INSERT the following code immediately above it:- ############################# CHECKOUT-IMAGE with scaling V1.1 ####################################### # ActinicOrder.pm (V4 versions only) patch # # author Norman Rouxel www.drillpine.biz (V11) # user modifiable variables my $NorcatCatPath = '../htdocs/acatalog/'; # Path From CGI-BIN To Catalog Directory (Actinic/Advanced/Network) my $NorcatImagePrefix = ''; # optional text that prefixes product ref in image filenames my $NorcatImageSuffix = ''; # optional text that follows product ref in image filenames my $NorcatScale = 2; # e.g. 2 -> half size thumbnails. 1 -> full size. Fractions OK. my $NorcatImageStart = '
0xCF) || ($NByte == 0xC4) || ($NByte == 0xCC) ) { if ( not eof(ImageFile) ) {read(ImageFile, $N1stByte, 1)} # 1st length byte if ( not eof(ImageFile) ) { read(ImageFile, $N2ndByte, 1); # 2nd length byte my $NLength = ord($N1stByte) * 256 + ord($N2ndByte); # calculate fragment length if ( $NLength >= 2 ) # must be at least 2 bytes { seek(ImageFile, $NLength - 2, 1); # seek past this fragments data $NError = 0; # (ignore 2 bytes already read) } } } else { if ( not eof(ImageFile) ) {read(ImageFile, $N1stByte, 1)} # 1st length byte if ( not eof(ImageFile) ) {read(ImageFile, $N2ndByte, 1)} # 2nd length byte if ( not eof(ImageFile) ) {read(ImageFile, $NNextByte, 1)} # Data Precision char if ( not eof(ImageFile) ) {read(ImageFile, $N1stByte, 1)} # 1st height byte if ( not eof(ImageFile) ) { read(ImageFile, $N2ndByte, 1); # 2nd height byte $NImageHeight = ord($N1stByte) * 256 + ord($N2ndByte); # image height } if ( not eof(ImageFile) ) {read(ImageFile, $N1stByte, 1)} # 1st width byte if ( not eof(ImageFile) ) { read(ImageFile, $N2ndByte, 1); # 2nd width byte $NImageWidth = ord($N1stByte) * 256 + ord($N2ndByte); # image width $NImageHeight = int($NImageHeight / $NorcatScale); # scale down $NImageWidth = int($NImageWidth / $NorcatScale); # scale down $NError = 0; $NFoundIt = 1; # whew - that's it } } } } } } } if ( not $NError ) { $NorcatImage = $NorcatImageStart . $NorcatImagePrefix . $NorcatRef . $NorcatImageSuffix . '.jpg" width=' . $NImageWidth . ' height=' . $NImageHeight . $NorcatImageEnd; # image HTML } close ImageFile; } ########## end of MAIN PATCH - CHECKOUT-IMAGE with scaling V1.1 ####################################### Now update the site and that's that.