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 Product Images Popup on Thumbnail click. (https://forum.x-cart.com/showthread.php?t=202)

yipcha 07-25-2003 01:44 PM

detailed pictures dosn't load correctly
 
I played around with it some more even tried "window.open('..customer/product_detailed_images.php?" I tried changing the permissions on the both product.tp and product_detailed_images.php because the window opens so product.tpl is working? but the picture isn't showing so doe that mean it can't find product_detailed_images.php to capture the image?
My modified product.tpl(chmod644) is in skin1/customer/main & my product_detailed_images.php(chmod755) is in xcartdir/customer (I deleted the duplicate I had in skin1/customer)
I did notice when changing the file that the format of what I was looking for was a little different than what boomer posted I must be using a different version (3.3.6) below is my product.tpl if that helps. :?
Code:

* $Id: product.tpl,v 1.59.2.2 2003/01/23 14:37:23 basil Exp $ *}
{literal}
<SCRIPT language=JavaScript1.2>
<!--
function productimagedetail(product_id) {
var w = "420"; //width
var h = "420"; //height
window.open('customer/product_detailed_images.php?productid='+product_id,"detailedproduct","width="+w+",height="+h+",resizable,scrollbars=yes");
}
-->
</SCRIPT>
{/literal}
{literal}
<SCRIPT language=JavaScript1.2>
<!--
function product_option(name_of_option)
{
{/literal}
for(i=0; i<{php}echo count($product_options) {/php}; i++)
  if (document.orderform[i].name.search(name_of_option) != -1)
        return document.orderform[i];
return -1;     
{literal}
}

function FormValidation()

{/literal}
{if $javascript_code}
{$javascript_code}
{else}
return true;
{/if}
{literal}
}
-->
</SCRIPT>
{/literal}

{ include file="location.tpl" }
{capture name=dialog}
<table border=0 width=100%>
<form name=orderform method=post action="cart.php?mode=add">
<tr>
<td valign=top align=left rowspan=2 width=100>
{if $active_modules.Detailed_Product_Images ne ""}{/if}{include file="product_thumbnail.tpl" productid=$product.productid image_x=$product.image_x image_y=$product.image_y product=$product.product}{if $active_modules.Detailed_Product_Images ne ""}{/if}

</td>
<td valign=top>
<span class=>
{if $product.fulldescr ne ""}{$product.fulldescr}{else}{$product.descr}{/if}
</span>



<table width=100% cellpadding=0 cellspacing=0 border=0>
<tr><td colspan=2><font class=ProductDetailsTitle>{$lng.lbl_details}</font></td></tr>
<tr><td class=Line height="1" colspan=2>[img]{$ImagesDir}/orangespacer.gif[/img]</td></tr>
<tr><td colspan=2></td></tr>
{if $config.General.show_in_stock eq "Y" and $product.distribution eq ""}
<tr><td width=30%>{$lng.lbl_quantity}</td><td nowrap>{if $product.avail gt 0}{$product.avail}{else}{$lng.txt_no}{/if} {$lng.txt_items_available}</td></tr>
{/if}
{if $product.weight ne "0.00"}<tr><td width=30%>{$lng.lbl_weight}</td><td nowrap>{$product.weight} {$config.General.weight_symbol}</td></tr>{/if}
{if $active_modules.Extra_Fields ne ""}
{include file="modules/Extra_Fields/product.tpl"}
{/if}
{if $active_modules.Subscriptions ne "" and $subscription}
{include file="modules/Subscriptions/subscription_info.tpl"}
{else}
<tr><td class=ProductPriceConverting>{$lng.lbl_price}:</td>
<td>
{if $product.price ne 0}
<font class=ProductDetailsTitle>{include file="currency.tpl" value=$product.price}</font><font class=MarketPrice> {include file="customer/main/alter_currency_value.tpl" alter_currency_value=$product.price}</font>{if $config.General.use_vat eq "Y"}, {$lng.lbl_including_vat} {$product.vat}%{/if}
{else}
<input type=text size=7 name=price>
{/if}
</td>
</tr>
{/if}
</table>



<table border=0 width=100% cellpadding=0 cellspacing=0>
<tr><td colspan=2>
<font class=ProductDetailsTitle>{$lng.lbl_options}</font>
</td></tr>
<tr><td class=Line height="1" colspan=2>[img]{$ImagesDir}/orangespacer.gif[/img]</td></tr>
<tr><td colspan=2></td></tr>
{if $active_modules.Product_Options ne ""}
{ include file="modules/Product_Options/customer_options.tpl"}
{/if}
<tr><td height=25 width=30%>{$lng.lbl_quantity}{if $product.min_amount gt 1}
<FONT class=ProductDetailsTitle>{$lng.txt_need_min_amount} {$product.min_amount} {$lng.lbl_items}</FONT>{/if}</td>
<td>
{if $config.General.show_in_stock eq "Y" and ($product.avail le 0 or $product.avail lt $product.min_amount)}
{$lng.txt_out_of_stock}
{else}
{if $config.General.show_in_stock ne "Y"}
{assign var="mq" value=$config.General.max_select_quantity}
{else}
{math equation="min(maxquantity+minamount, productquantity)+1" assign="mq" maxquantity=$config.General.max_select_quantity minamount=$product.min_amount productquantity=$product.avail}
{/if}
{if $product.distribution eq ""}
<select name=amount>
{if $product.min_amount le 1}
{assign var="start_quantity" value=1}
{else}
{assign var="start_quantity" value=$product.min_amount}
{/if}
{section name=quantity loop=$mq start=$start_quantity}
<option value="{%quantity.index%}" {if $smarty.get.quantity eq %quantity.index%}selected{/if}>{%quantity.index%}</option>
{/section}
</select>
{else}
<font class=ProductDetailsTitle>1</font><input type=hidden name=amount value=1> {$lng.txt_product_downloadable}
{/if}
{/if}
</td></tr>
<tr><td colspan=2>
<input type=hidden name=mode value=add>
{if $config.General.show_in_stock ne "Y" or ($product.avail gt 0 and $product.avail ge $product.min_amount)}
{include file="customer/main/product_prices.tpl"}
{include file="buttons/add_to_cart.tpl"}

{if $login ne "" and $active_modules.Wishlist ne ""}
{include file="customer/add2wl.tpl"}
{/if}
{/if}
</td>
</tr></table>
</td>
<td align=right valign=top width=60>
{if $product.discount ne 0}<table border=0 width=60><tr><td width=55 height=56 class="SaveMoneyLabel" background="{$ImagesDir}/save_money.gif" align=center valign=middle>


{ $product.discount }%
</td></tr></table>{/if}
</td>
</tr>
<input type=hidden name=productid value="{$product.productid}">
<input type=hidden name=cat value="{$smarty.get.cat}">
<input type=hidden name=page value="{$smarty.get.page}">
</form>
</table>
{/capture}
{include file="dialog.tpl" title=$product.producttitle content=$smarty.capture.dialog extra="width=100%"}
{if $active_modules.Detailed_Product_Images ne ""}



<!--{include file="modules/Detailed_Product_Images/product_images.tpl" }
{/if}
{if $active_modules.Upselling_Products ne ""}-->



{include file="modules/Upselling_Products/related_products.tpl" }
{/if}
{if $active_modules.Recommended_Products ne ""}



{include file="modules/Recommended_Products/recommends.tpl" }
{/if}
{if $active_modules.Customer_Reviews ne ""}



{include file="modules/Customer_Reviews/vote_reviews.tpl" }
{/if}

Linux server
PHP Version 4.3.2
Mysql Version 4.0.13
Xcart 3.3.6 gold

yipcha 07-27-2003 12:19 PM

figured it out works now
 
thanks stars I figured it out I commented out the wrong line and somehow it was making it not work but it works now..... :P -sorry I posted my whole file in retrospect that probably is not forum kosher... my bad apoligies all around... :)

blagarde 08-04-2003 01:43 PM

What if some thumbnails have detailed images but others do not? It's not too cool to have a blank window pop up when there's nothing there. I thought the first {if $active_modules..... } statement around the image would take care of this, but it does not. HELP!

Thanks!!

jeeya 08-04-2003 03:39 PM

.
 
HELLO,

I wonder if this code will also work for detailed product images, if I have 3 to 4 images than it will be too big space to hold them , so If I use code similar to that will that work for detailed product images to go in more detail :roll:

finestshops 08-04-2003 07:08 PM

> if I have 3 to 4 images

Your popup window will have vertical scroll bar
so people can see all the images.

Tye 08-08-2003 05:02 AM

Hi Boomer, just reading your code for detailed images!
 
Do you know if it is possible to have the detailed images linking... in my case i would like to link to a pdf file.

Also how do I put text into the detailed images box next to the relavent image.

Regards
Tye

finestshops 08-08-2003 05:18 AM

Re: Hi Boomer, just reading your code for detailed images!
 
Quote:

Originally Posted by Tye
Do you know if it is possible to have the detailed images linking... in my case i would like to link to a pdf file.
Also how do I put text into the detailed images box next to the relavent image.


Sure. Just put <a> tag around

Code:

[img]../product_image.php?imageid={$images[image].imageid}[/img]

and add text under this code in /modules/Detailed_Product_Images/product_images.tpl

blagarde 08-15-2003 03:03 PM

But what if some products do not have a detailed image while others do? Blank popup windows suck. The "{if $active_modules..... }" statement around the image doesn't seem do it. I still can't figure it out.

B00MER 08-15-2003 03:31 PM

Quote:

Originally Posted by blagarde
But what if some products do not have a detailed image while others do? Blank popup windows suck. The "{if $active_modules..... }" statement around the image doesn't seem do it. I still can't figure it out.


{if $images}...{/if}

;)

Tye 08-18-2003 05:06 AM

Full code! Is this correct!
 
{* $Id: product_images.tpl,v 1.6 2002/05/20 06:55:24 lucky Exp $ *}
{if $images ne ""}
{capture name=dialog}
{section name=image loop=$images}
{if $images[image].avail eq "Y"}
[img]../product_image.php?imageid={$images[image].imageid}[/img]




{/if}
{/section}
{/capture}
{if $smarty.capture.dialog ne ""}
{include file="dialog.tpl" title=$lng.lbl_detailed_images content=$smarty.capture.dialog extra="width=100%"}
{/if}
{/if}
[img]../product_image.php?imageid={if $images[image].imageid}[/img]


All times are GMT -8. The time now is 10:28 AM.

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