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)

schawel 08-25-2006 02:36 PM

Re: Detailed Image(s) Popup 2.1 [3.4.x-4.0.x]
 
I just get this in the window that pops up

[img]/product_image.php?imageid=99[/img]

No photo..just a path..booo

schawel 08-26-2006 07:18 AM

Re: Detailed Image(s) Popup 2.1 [3.4.x-4.0.x]
 
Quote:

Originally Posted by schawel
I just get this in the window that pops up

[img]/product_image.php?imageid=99[/img]

No photo..just a path..booo



Let me clarify.

I have followed the steps EXACTLY. On the product page i see my product image and a link below it labled "View larger image". Ok. I click on the link and a window pops open just fine. The window that pops open has the above echoed into it. It seems as though that window which pops up (product_deatiled_images.php) can not find or parse the smarty code. i click on the link in the popup [img]/product_image.php?imageid=99[/img] and the window goes away as it should.

Any ideas?

schawel 08-28-2006 08:50 AM

Re: Detailed Image(s) Popup 2.1 [3.4.x-4.0.x]
 
This is the VIEWED SOURCE of the popup.



<script type="text/javascript">
<!--

// Initial Resize
var h = 187+40;
var w = 488+30;

// make sure size isn't bigger than users screen

if(h>=screen.height) {
h=screen.height-30;
}
if(w>=screen.width) {
w=screen.width;
}

window.resizeTo(w,h);

// Vars
var photos=new Array()
var photos_width=new Array()
var photos_height=new Array()
var which=0

// Images
photos[0]="/product_image.php?imageid=101"
photos_width[0]="488"
photos_height[0]="187"


var preloadedimages=new Array()
for (i=0;i<photos.length;i++){
preloadedimages[i]=new Image()
preloadedimages[i].src=photos[i]
}

function applyeffect(){
if (document.all && photoslider.filters){
photoslider.filters.revealTrans.Transition=Math.fl oor(Math.random()*23)
photoslider.filters.revealTrans.stop()
photoslider.filters.revealTrans.apply()
}
}

function playeffect(){
if (document.all && photoslider.filters)
photoslider.filters.revealTrans.play()
}

function backward(){
if (which>0){
which--
} else {
which=photos.length-1;
}
applyeffect()
document.images.photoslider.src=photos[which]
newWidth=parseInt(photos_width[which])+30;
newHeight=parseInt(photos_height[which])+85;
if(newHeight>=screen.height) {
newHeight=screen.height-30;
}
if(newWidth>=screen.width) {
newWidth=screen.width;
}
window.resizeTo(newWidth,newHeight)
playeffect()
}

function forward(){
if (which<photos.length-1){
which++
} else {
which=0;
}
applyeffect()
document.images.photoslider.src=photos[which]
newWidth=parseInt(photos_width[which])+30;
newHeight=parseInt(photos_height[which])+85;
if(newHeight>=screen.height) {
newHeight=screen.height-30;
}
if(newWidth>=screen.width) {
newWidth=screen.width;
}
window.resizeTo(newWidth,newHeight)
playeffect()
}
//-->
</script>



<body>

<a href="javascript:window.close();">

<script type="text/javascript">
document.write('[img]'+photos[0]+'[/img]')
</script>

</a>

</body>
</html>

B00MER 08-28-2006 10:07 AM

Re: Detailed Image(s) Popup 2.1 [3.4.x-4.0.x]
 
What version of X-Cart are you running?

If your using any version above 3.5.x+ you'll need to put the php file straight in the root of your x-cart installation and change the reference in the .tpl files accordingly.

Hope this helps.

B00MER 08-28-2006 10:27 AM

Re: Detailed Image(s) Popup 2.1 [3.4.x-4.0.x]
 
Quote:

Originally Posted by girlsbits
Thanks to Boomer for this mod, it works fine except that instead of showing the default thumbnail image (130x150px) on the product details page, how would I show a resized larger image (250x297) which would then open a popup window on click? The current correct code for the larger image of 250x297 is this:


If I am understanding your question correctly you want to use a detailed image for the thumbnail? If so wouldn't be easiest just to use the thumbnail portion of the product pages for just that thumbnails, except use a larger image instead?

If your still wanting to do such try using $images instead of $product in the include file for the image.

Code:

{include file="product_thumbnail.tpl" productid=$product.productid image_x=$images.image_x image_y=$images.image_y product=$product.product tmbn_url=$images.tmbn_url id="product_thumbnail" type="P"}

schawel 08-28-2006 11:58 AM

Re: Detailed Image(s) Popup 2.1 [3.4.x-4.0.x]
 
Thanks.

I want to keep my thumbnail as is. But I just want to have the thumbnail and the linked text below it open the window up and display and large detailed image there. It almost works, but the image for some reason is not reaching that popup. I must be something path related.

I have the OG version of X-Cart Gold v4.0.18

I did drop the product_detailed_images.php into the ROOT or the public_html dir.

example: http://www.canineconfections.com/Canine-Confections-15-Piece-p-16138.html

Thanks again.

B00MER 08-28-2006 12:55 PM

Re: Detailed Image(s) Popup 2.1 [3.4.x-4.0.x]
 
Code:

document.write('[img]'+photos[0]+'[/img]')

It seems your trying to use BB Codes for posting an image i.e. the img/img isn't HTML 8O

try:
Code:

document.write('<img src="'+photos[0]+'">');

instead :D/

schawel 08-28-2006 01:25 PM

Re: Detailed Image(s) Popup 2.1 [3.4.x-4.0.x]
 
Killer. That worked.

I looked at your OG code. You have them in there. Was that a mistake or is something wrong with how im calling things?


Either way.. You solved it. Thanks!

B00MER 08-28-2006 01:43 PM

Re: Detailed Image(s) Popup 2.1 [3.4.x-4.0.x]
 
Quote:

Originally Posted by schawel
Killer. That worked. I looked at your OG code. You have them in there. Was that a mistake or is something wrong with how im calling things?


No it probably was due to the recent switch from phpBB to vB here on the forums, it may have happened on other code postings as well. #-o

goldoak 08-31-2006 10:10 AM

Re: Detailed Image(s) Popup 2.1 [3.4.x-4.0.x]
 
Hi all,
Any updates to this thread for 4.1.x versions?
Trying to display the detailed images' alt text in the popup window as a caption.
I've located the location in '/main/popup_image.tpl' where I want it to appear, but don't know how to reference the alt text.

Any help would be greatly appreciated.
thanks


All times are GMT -8. The time now is 01:53 AM.

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