X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Detailed Image(s) Popup 2.1 [3.4.x-4.0.x] (https://forum.x-cart.com/showthread.php?t=8460)

B00MER 02-16-2005 05:59 AM

If you'd like to donate, see my 'Freebies' page. Appreciate any contributions. :wink: This mod should work fine on a 4.x x-cart.

andreas04031 02-16-2005 12:22 PM

4.0.11 - it works like a charm, thanks boomer

weckie 02-20-2005 11:40 AM

Hi Boomer,


Well i tried whole sunday to get it working in my version 4.0.11 but too bad i could not get it to work, may be it is because i am running also fashion mosaic skin in version 4.0.11. (maybe you know more about it.

andreas04031 02-20-2005 01:00 PM

what you need to watch is the different location of the file below.

Step 1) - 4.xx version xcart/product_detailed_images.php
Step 1) - 3.xx version xcart/customer/product_detailed_images.php

I put everything together and it worked from the very first time on a few 4.xx carts, Andy

weckie 02-20-2005 10:46 PM

i know i saw it too, have tried it but it did'nt work for me. i have put th files even in all dirs. still didn't work.
Maybe it is because of fashion mosaic.

scraps 02-22-2005 12:35 PM

detailed image popup
 
I installed this today on my site, and as far as I know it should be working. I did have the smarty error and got the file changed to the right directory, but the popup window is not appearing or even clickable from the image.

Any thoughts?

scraps 02-22-2005 12:38 PM

just a thought here, I do keep my images in the file system, would this have any effect?

I will not change that either, so if that would be the problem, I'll have to do without this mod :(

weckie 03-01-2005 07:17 AM

hi i managed to get it to work so far in 4.0.12 but now i got this error in the popup window.

Code:

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/s/t/steijn/welkoop/xcart/product_detailed_images.php on line 3
{\rtf1\ansi\ansicpg1252\deff0\deflang1043{\fonttbl{\f0\froman\fcharset0 Times New Roman;}{\f1\fswiss\fcharset0 Arial;}} {\colortbl ;\red0\green0\blue255;} {\*\generator Msftedit 5.41.15.1507;}\viewkind4\uc1\pard\f0\fs24 \line\par \f1\fs20\par }


Anyone know how to solve this problem...

See it at http://www.weckonline.nl

greetz

weckie 03-01-2005 07:32 AM

sorry forget the link to a product with detailed images

here it is..

http://www.weckonline.nl/xcart/product.php?productid=16134&cat=252&page=1

weckie 03-08-2005 12:26 AM

language in product_images.tpl
 
Hi boomer,

well, i finally got it work in my site V4.0.12

Q: I have changed the words Previous and Next to {$lng.lbl_previous} and {$lng.lbl_next}.

I created the labels in each language. BUT. nothing appears.
maybe i did something wrong. Could you help me a bit.

Regards.

scraps 03-08-2005 08:35 AM

I did not give up :)
 
I did not give up and finally got this working for me in 4.04. I had been not commenting out the part where you take out the detailed images from bottom of page. I am not all that familiar with how to do this stuff, so that doesn't help, but I am learning. :) I had commented out the part I was suppose to, but I didn't realize you have to also comment the "if" statements under the scripting lines as well.

I do have a question, is it possible when the window pops up to have the window open slightly larger so you can see the "next" and "previous" buttons. My images are small enough that I'm not seeing these on the pages that popup. (Possibly a note could be added to "resize" there windows to see more images before the first image pops up)

Thank you so much, left a donation for you today, as I really love this option.

B00MER 03-08-2005 10:17 AM

Any 30,40 or 85 values, you find in the script you can simply increase these values to get a larger viewing area (padding/margin).

Thanks for the donation ;)

scraps 03-08-2005 12:37 PM

I managed to get that window a bit larger and am happy with how it works now Boomer, one last question on this mod, is there a way to have it "close" when it comes to the last detailed image and they click on the next button for next image, but if no image is there it would close window automatically, or have it say how many images such as a 1 of 3 at image 2 might say 2 of 5, image 3 in the window or just some way of the customer knowing how many images are there? For new people to carts especially, they will wonder why no "next" image is coming up.

Thank you,

B00MER 03-08-2005 01:42 PM

The script is setup to simply loopback to the 1st image, the customer should realize they are back at the begining or you can auto close if they reach the end by editing the function forward() in product_images.tpl:

Code:

function forward(){
        if (which<photos.length-1){
                which++
        } else {
                which=0;
        }


to:

Code:

function forward(){
        if (which<photos.length-1){
                which++
        } else {
                window.close();
        }


weckie 03-08-2005 03:08 PM

language
 
have you read my message BOOMER. on page six last message....

B00MER 03-09-2005 05:56 AM

Re: language in product_images.tpl
 
Quote:

Originally Posted by weckie
Q: I have changed the words Previous and Next to {$lng.lbl_previous} and {$lng.lbl_next}.

I created the labels in each language. BUT. nothing appears.
maybe i did something wrong. Could you help me a bit.


Try removing the entries you added and add this to SQL patch area:
Code:

INSERT INTO xcart_languages (code, descr, name, value, topic) VALUES ('US', 'next', 'lbl_next', 'Next', 'Labels');
INSERT INTO xcart_languages (code, descr, name, value, topic) VALUES ('US', 'prev', 'lbl_previous', 'Previous', 'Labels');


issay 03-11-2005 09:26 AM

Will it be possible to have the detailed image appearing in the default location set by xcart, but only one image at a time. If there are more than one image, have a <previous> and <next> button to navigate through the imges. It all happens in the product page not in a pop-up window ... pop-ups are a nusiance sometimes .. hope someone can help.

velander 03-16-2005 08:45 AM

Code to automatically close the pop-up window.
 
I found that if the user doesn't close the pop-up window, and then selects another detailed image from another product, it will display in the same pop-up window, but it doesn't get focus, so it can stay hidden if it is behind another window.

I have added code to automatically close the pop-up window if the user clicks on another window.

Add the following code to product_images.tpl before the end of the java script which ends with:

Existing code:
Code:

//-->
</script>
{/literal}



Insert code:
Code:

function kill_it() {
        window.close();
}


Then change the body tag from:

Code:

<body LEFTMARGIN=0 TOPMARGIN=0 RIGHTMARGIN=0 BOTTOMMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0>
to:

Code:

<body LEFTMARGIN=0 TOPMARGIN=0 RIGHTMARGIN=0 BOTTOMMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 onblur="kill_it()">

I made this change on a version 4.0.12 cart, but it should work on any version.

Thanks for the great mod, Boomer. You saved me lots of time.

weckie 03-16-2005 10:33 AM

works only with one detailed image....
 
hi eric

The automatic kill is great, BUT.... if you have more than one detailed image you can not use previous or next function. if you click on NEXT the window will close instead of showing the next image.

May be you can solve this problem somehow...

longhorn180 03-18-2005 02:09 PM

Hey Boomer. I sell books online and I have an image that I call on the product_thumbnail.tpl file that displays above the picture if it is an audio book. It's just a way to let the customer know whether or not it's an audio book. I also need it to show above the image on the product.tpl, but I don't know the proper way to write it to work with your javascript in the detailed_popup.tpl file. Here is the code:
Code:

{if $products[product].param08 eq "Audio Books"}[img]{$ImagesDir}/audio.gif[/img]
{/if}


I was hoping you might be able to help me figure this out. Here is an example of the what I'm talking about:

http://www.thecrackedbook.com/xcart/customer/home.php?cat=294

longhorn180 03-23-2005 11:01 AM

Disregard my last post. I was able to call the pic in another part of the page that actually looks better than right above the detailed image. Thanks anyway.

kalmaster 04-01-2005 07:25 AM

Thanks alot boomer, this MOD works great!!!

pwd88 04-04-2005 03:34 PM

Does anyone tried to have this detailed image popup mod working at products.tpl and cart.tpl level, I tried, but no luck, that will be nice if we can have this popup mod works at different level

RobotDeathSquad 04-05-2005 12:37 PM

Is there anyway to display the alt text that has been entered followed by "(click to close window)" instead of just having "click to close window"?
Or display that text below the image or something?

D.Thornley@salford.ac.uk 04-24-2005 02:28 AM

Is this hack compatible with v4.0.12 ?

Online Michael 04-25-2005 03:37 AM

I have discovered something rather interesting and I don't know if it's a bug or not. What I did was I entered the http://www.stonecomputers.com.au website (which btw is using this mod) and clicked on an image of a laptop which it then enlarged on a separate window (so far so good). I then entered the http://www.mydukkan.com website and did the same thing with a guitar. What happened was, the window that displayed the image of a laptop was replaced with a picture of a guitar. Both websites were using the same image window to display their own images and no matter how many more new sites you visit, that use this mode, all the detailed pictures are shown through this one window. And while viewing the image, you can use the 'Back' button on your browser and see all the images previously shown. Sort of cool in a way... but not really sure what to think of it actually. Just thought you guys may want to know.

sstillwell@aerostich.com 04-25-2005 08:58 AM

Quote:

Originally Posted by RobotDeathSquad
Is there anyway to display the alt text that has been entered followed by "(click to close window)" instead of just having "click to close window"?
Or display that text below the image or something?


Put this somewhere in skin1/customer/main/product_images.tpl
Code:

{if $images[1].imageid ne ""}
  <tr>
    <td width="20%" height="21" onClick="javascript:backward();return false;" style="cursor:pointer;cursor:hand;" onMouseOver="'"><p align="left">[img]{$ImagesDir}/larrow.gif[/img] Previous</td>
    <td align="center"><div id="photosalt"><script>document.write(photos_alt[0])</script></div></td>
    <td width="20%" height="21" onClick="javascript:forward();return false;" style="cursor:pointer;cursor:hand;"><p align="right">Next [img]{$ImagesDir}/rarrow.gif[/img]</td>
  </tr>
{/if}


The line
Code:

<script>document.write(photos_alt[0])</script>

Will print out the Alt text above the image in this case.

LightingMania 04-28-2005 07:07 AM

Quote:

Warning: Smarty error: unable to read resource: "detailed_popup_js.tpl" in /x-cart/Smarty-2.6.3/Smarty.class.php on line 1082

Above is an error I am getting with x-cart 4.0.13

Any idea how to correct this?

Thanks!

chetlucas 04-28-2005 07:38 AM

Fix for Smarty Error Message
 
I solved this problem about the smarty error not being able to read the file (same error you are having and version).

I changed the "product.tpl" to put in a ../ before the file that was to be included so it knew where to look for it. It was at {include file="../detailed_popup_js.tpl"}.

Once this was accomplished, voila - it was fixed. Now, if we could only do something with the search function!!

Owl 04-29-2005 12:50 AM

:p
 
did i ever tell you i love you bomer? :oops:
it works on my shop atleast, with the php file directly under, not in customer

dazybabes 05-03-2005 02:37 AM

had initial problems with the product.tpl but got rid of the strip tags and it seemed to work but now in the pop up I get


Quote:

Parse error: parse error in d:\domains\kitinfo.co.uk\wwwroot\kitwarehouse\prod uct_detailed_images.php on line 19

this is the product_detailed_images.php

Code:

<?php
#
# Detailed Images Popup
# Version 2.1
# http://www.cart-lab.com
# info@cart-lab.com
# (C)opyright 2003-2004 CartLab, all rights reserved.
# Full license at: http://www.cart-lab.com/license.php
#
require "./auth.php";

#
# Collect product images
#
$images = func_query("select * from $sql_tbl[images] where productid='$productid' order by orderby,imageid");

# Find max width and total height of all collected images (currently not used)
foreach($images as $k=>$v) {
Б─═ Б─═foreach($v as $kk=>$vv) {
Б─═ Б─═Б─═ Б─═if($kk=="image_x") {
Б─═ Б─═Б─═ Б─═Б─═ Б─═if($maxwidth >= $previous_maxwidth) {
Б─═ Б─═Б─═ Б─═Б─═ Б─═Б─═ Б─═$maxwidth=$vv;
Б─═ Б─═Б─═ Б─═Б─═ Б─═}
Б─═ Б─═Б─═ Б─═Б─═ Б─═$previous_maxwidth=$vv;
Б─═ Б─═Б─═ Б─═} elseif($kk=="image_y") {
Б─═ Б─═Б─═ Б─═Б─═ Б─═if($maxheight >= $previous_maxheight) {
Б─═ Б─═Б─═ Б─═Б─═ Б─═Б─═ Б─═$maxheight=$vv;
Б─═ Б─═Б─═ Б─═Б─═ Б─═}
Б─═ Б─═Б─═ Б─═Б─═ Б─═$previous_maxheight=$vv;
Б─═ Б─═Б─═ Б─═}Б─═ Б─═Б─═ Б─═
Б─═ Б─═}
}

$smarty->assign("winw",$maxwidth);
$smarty->assign("winh",$maxheight);
$smarty->assign("images",$images);
$smarty->display("customer/main/product_images.tpl");

?>


any ideas??

TelaFirma 05-03-2005 04:24 AM

you need to get rid of all those Б─═ Б─═Б─═ Б─═Б─═ Б─═ marks infront of the code (starting at line 19)

dazybabes 05-03-2005 05:48 AM

I dont know where all those crosses came from as all Ive done is copy and paste the coding. Anyway Ive deleted them now and I get this now?!

Warning: Invalid argument supplied for foreach() in d:\domains\kitinfo.co.uk\wwwroot\kitwarehouse\prod uct_detailed_images.php on line 18
No Image(s) Found!


Should I be keeping my images somewhere special or something??[/b][/code]

dazybabes 05-04-2005 12:30 AM

Ok so I've re-added all original files of Boomers and Im still getting this error message in the pop up?


Warning: Invalid argument supplied for foreach() in d:\domains\kitinfo.co.uk\wwwroot\kitwarehouse\prod uct_detailed_images.php on line 18
No Image(s) Found!


Can anyone see where the problem might be?

Code:

<?php
#
# Detailed Images Popup
# Version 2.1
# http://www.cart-lab.com
# info@cart-lab.com
# (C)opyright 2003-2004 CartLab, all rights reserved.
# Full license at: http://www.cart-lab.com/license.php
#
require "./auth.php";

#
# Collect product images
#
$images = func_query("select * from $sql_tbl[images] where productid='$productid' order by orderby,imageid");

# Find max width and total height of all collected images (currently not used)
foreach($images as $k=>$v) {
Б─═ Б─═foreach($v as $kk=>$vv) {
Б─═ Б─═Б─═ Б─═if($kk=="image_x") {
Б─═ Б─═Б─═ Б─═Б─═ Б─═if($maxwidth >= $previous_maxwidth) {
Б─═ Б─═Б─═ Б─═Б─═ Б─═Б─═ Б─═$maxwidth=$vv;
Б─═ Б─═Б─═ Б─═Б─═ Б─═}
Б─═ Б─═Б─═ Б─═Б─═ Б─═$previous_maxwidth=$vv;
Б─═ Б─═Б─═ Б─═} elseif($kk=="image_y") {
Б─═ Б─═Б─═ Б─═Б─═ Б─═if($maxheight >= $previous_maxheight) {
Б─═ Б─═Б─═ Б─═Б─═ Б─═Б─═ Б─═$maxheight=$vv;
Б─═ Б─═Б─═ Б─═Б─═ Б─═}
Б─═ Б─═Б─═ Б─═Б─═ Б─═$previous_maxheight=$vv;
Б─═ Б─═Б─═ Б─═}Б─═ Б─═Б─═ Б─═
Б─═ Б─═}
}

$smarty->assign("winw",$maxwidth);
$smarty->assign("winh",$maxheight);
$smarty->assign("images",$images);
$smarty->display("customer/main/product_images.tpl");

?>

Ignore the crosses they just turn up when I copy and paste the code from dreamweaver??

if anyone needs to look at the site let me know

B00MER 05-04-2005 05:34 AM

Quote:

Originally Posted by dazybabes
Ignore the crosses they just turn up when I copy and paste the code from dreamweaver??


Dreamweaver, is probably the problem try editing the files with Notepad or a simple text editor and reupload the files. Dreamweaver is known for mucking up code. :wink:

dazybabes 05-05-2005 05:51 AM

Sorry still no go???

I've uploaded the files from your website also straight to my ftp etc and still getting the same problem when I click on the 'view details' bit in the product info

Warning: Invalid argument supplied for foreach() in d:\domains\kitinfo.co.uk\wwwroot\kitwarehouse\prod uct_detailed_images.php on line 18
No Image(s) Found!


this is line 18

Code:

foreach($images as $k=>$v) {

This is the full coding for the product_detailed_images.php
Code:

<?php
#
# Detailed Images Popup
# Version 2.1
# http://www.cart-lab.com
# info@cart-lab.com
# (C)opyright 2003-2004 CartLab, all rights reserved.
# Full license at: http://www.cart-lab.com/license.php
#
require "./auth.php";

#
# Collect product images
#
$images = func_query("select * from $sql_tbl[images] where productid='$productid' order by orderby,imageid");

# Find max width and total height of all collected images (currently not used)
foreach($images as $k=>$v) {
foreach($v as $kk=>$vv) {
if($kk=="image_x") {
if($maxwidth >= $previous_maxwidth) {
$maxwidth=$vv;
}
$previous_maxwidth=$vv;
} elseif($kk=="image_y") {
if($maxheight >= $previous_maxheight) {
$maxheight=$vv;
}
$previous_maxheight=$vv;
}
}
}

$smarty->assign("winw",$maxwidth);
$smarty->assign("winh",$maxheight);
$smarty->assign("images",$images);
$smarty->display("customer/main/product_images.tpl");

?>


Is that coding in line 18 correct? has it been changed or should I be saving or loading my detailed images somewhere else??

Any help would be great or I will have to revert to an alternative way of viewing images??[/code][/b]

B00MER 05-05-2005 06:26 AM

Quote:

Originally Posted by dazybabes
Warning: Invalid argument supplied for foreach() in d:\domains\kitinfo.co.uk\wwwroot\kitwarehouse\prod uct_detailed_images.php on line 18
No Image(s) Found!


this is line 18

Code:

foreach($images as $k=>$v) {


Are you currently passing product_detailed_images.php an productid from the product.tpl page? Also do you have a product added that has more than 2 detailed images, as well as the module is not disabled.

It seems the array is empty, which means no productid was specified or no detailed images exist, this is why you see No Image(s) Found! after the warning.

Hope this helps.
:wink:

bmm 05-06-2005 12:09 AM

Thank You Boomer
 
BOOMER,
WOW, somehow my reply...made into a NEW TOPIC!
So I am reposting.

Just a simple "Thank You", the mod works great using 4.0.12 ( too chicken to update to 4.0.13).
Et al,
you have to read the WHOLE post (2 parts) most questions are answered
in the first thread http://forum.x-cart.com/viewtopic.php?t=276 for 3.XXX questions.

I have a list of ideas based off this mod, but you would have to charge.....

What a sick mod...and for free! = Donations!

BTW, I checked out http://www.cart-lab.com, WOW. Where do I start?

Thanks,


-r

dazybabes 05-06-2005 01:53 AM

Well a new day and a Fresh look at things has brought success!?

Had another gander thru the coding and saw something wrong in the product.tpl so copied your original coding and hey presto!?

Works Brilliantly Boomer thanks for your help!?

although I do have a question???

Is there anyway of incorporating the detailed image alt text inbetween the next and previous buttons???

Pleeease, pretty pleeease??? :lol:

offline 05-10-2005 08:12 AM

With a little modification I got this great mod working in no time. One question, how do I make the popup window slightly larger so I can see the next & prev tags?


All times are GMT -8. The time now is 09:34 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.