X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   product.tpl - OMG!! butchery! (https://forum.x-cart.com/showthread.php?t=33065)

hrothbeorht 08-06-2007 11:08 AM

product.tpl - help this poor fool
 
OK.. I admit it.
I've been the butcher. I've made some changes and now something is broken.
I really like the result of my changes, BUT!! one thing is broken that NEEDS to work!!

Ok, I've put some flash in where the product details image was. The thumbnail still worked when browsing products, but for some reason (my butchery) when viewing the cart contents.. the thumbnail won't show.
WhenI view the source, I see that it is trying to show the detailed product image.. (which is now flash)

Here is my code:

Code:

{* $Id: product.tpl,v 1.147.2.13 2007/04/23 07:06:22 max Exp $ *}
{include file="main/include_js.tpl" src="main/popup_image.js"}
{if $active_modules.Special_Offers}
{include file="modules/Special_Offers/customer/product_offers_short_list.tpl" product=$product}
{/if}
{include file="form_validation_js.tpl"}
{if $product.product_type eq "C" && $active_modules.Product_Configurator}
{include file="modules/Product_Configurator/pconf_customer_product.tpl"}
{else}
{capture name=dialog}
<form name="orderform" method="post" action="cart.php?mode=add" onsubmit="javascript: return FormValidation();">
<table width="100%">
<tr>
 <td class="PImgBox" rowspan="2">
 {if $active_modules.Detailed_Product_Images ne "" && $config.Detailed_Product_Images.det_image_popup eq 'Y' && $images ne '' && $js_enabled eq 'Y'}
{include file="modules/Detailed_Product_Images/popup_image.tpl"}
{elseif $product.force_image_type eq 'W' && $product.variantid}
{include file="product_thumbnail.tpl" productid=$product.variantid image_x=$product.image_x image_y=$product.image_y product=$product.product tmbn_url=$product.tmbn_url id="product_thumbnail" type="W"}&nbsp;
{else}
{*{include file="product_thumbnail_f.tpl" productid=$product.productid image_x=$product.image_x image_y=$product.image_y product=$product.product tmbn_url=$product.tmbn_url id="product_thumbnail_f" type="P"}*}
{*---{$id}-{$tmbn_url}-{$http_location}-{$xcart_web_dir}-{$type|default:"T"}-{$productid}-{$image_x}-{$image_y}"{$product|escape}---*}
{if $store_language eq "FR"}
<script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0','width','350','height','450','wmode','transparent','menu','false','src','http://www.website.ca/shop/images/P/F/','quality','high','pluginspage','http://www.macromedia.com/go/getflashplayer','movie','http://www.website.ca/shop/images/P/F/{$product.tmbn_url|filename}' ); //end AC code
</script><noscript>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="335" height="427" id="movie" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="http://www.website.ca/shop/images/P/F/{$product.tmbn_url|filename}.swf" />
<param name="quality" value="high" />
<param name="wmode" value="transparent">
<param name="bgcolor" value="#000000" />
<embed src="http://www.website.ca/shop/images/P/F/{$product.tmbn_url|filename}.swf" quality="high" menu="false" wmode="transparent"  bgcolor="#000000" width="350" height="450" name="{$product.tmbn_url|filename}" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object></noscript>
{else}
<script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0','width','350','height','450','wmode','transparent','menu','false','src','http://www.website.ca/shop/images/P/','quality','high','pluginspage','http://www.macromedia.com/go/getflashplayer','movie','http://www.website.ca/shop/images/P/{$product.tmbn_url|filename}' ); //end AC code
</script><noscript>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="335" height="427" id="movie" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="http://www.website.ca/shop/images/P/{$product.tmbn_url|filename}.swf" />
<param name="quality" value="high" />
<param name="wmode" value="transparent">
<param name="bgcolor" value="#000000" />
<embed src="http://www.website.ca/shop/images/P/{$product.tmbn_url|filename}.swf" quality="high" menu="false" wmode="transparent"  bgcolor="#000000" width="350" height="450" name="{$product.tmbn_url|filename}" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object></noscript>
{/if}
&nbsp;
{*
http://www.website.ca/shop/images/P/flash_img.swf{$product.tmbn_url}
{include file="product_thumbnail.tpl" productid=$product.productid image_x=$product.image_x image_y=$product.image_y product=$product.product tmbn_url=$product.tmbn_url id="product_thumbnail" type="P"}&nbsp;
*}
{/if}
{if $active_modules.Magnifier ne "" && $config.Magnifier.magnifier_image_popup eq 'Y' && $zoomer_images ne '' && $js_enabled eq 'Y'}
{include file="modules/Magnifier/popup_magnifier.tpl"}
{/if}
</object>
 </td>
 <td valign="top" width="100%">
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
 <td><span>{if $product.fulldescr ne ""}{$product.fulldescr}{else}{$product.descr}{/if}</span></td>
{if $product.taxed_price gt 0 and $product.list_price gt 0}
 <td align="right" valign="top" width="60" id="save_percent_box"{if $product.taxed_price >= $product.list_price} style="display: none;"{/if}>
<table width="60" cellspacing="1" cellpadding="2">
<tr>
 <td class="SaveMoneyLabel">
<br />
{math equation="100-(price/lprice)*100" price=$product.taxed_price lprice=$product.list_price format="%3.0f" assign=discount}
&nbsp;<span id="save_percent">{ $discount }</span>%
 </td>
</tr>
</table>
 </td>
{/if}
</tr>
</table>
<p />
<table width="100%" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><b><font class="ProductDetailsTitle">{$lng.lbl_details}</font></b></td></tr>
<tr><td class="Line" height="1" colspan="2"><img src="{$ImagesDir}/spacer.gif" class="Spc" alt="" /></td></tr>
<tr><td colspan="2">&nbsp;</td></tr>
<tr>
 <td width="30%">{$lng.lbl_sku}</td>
 <td nowrap="nowrap" id="product_code">{$product.productcode}</td>
</tr>
{if $config.Appearance.show_in_stock eq "Y" and $config.General.unlimited_products ne "Y" and $product.distribution eq ""}
<tr>
 <td width="30%">{$lng.lbl_in_stock}</td>
 <td nowrap="nowrap" id="product_avail_txt">
{if $product.avail gt 0}{$lng.txt_items_available|substitute:"items":$product.avail}{else}{$lng.lbl_no_items_available}{/if}
 </td>
</tr>
{/if}
 
..clipped~!


guy gregor 08-06-2007 11:33 AM

Re: product.tpl - OMG!! butchery!
 
in the spirit of the post , my eyes started to glaze over when i came to a piece of code the refered to language = FR ...

i had loads of bother inserting flash , but used
http://cit.ucsf.edu/embedmedia/step1.php to generate the code for me , which worked but ive no idea why !

probly not much help ...

hrothbeorht 08-06-2007 11:41 AM

Re: product.tpl - the fool I could be..
 
Hi greg,

I've overcome all the problems in getting flash to display correctly. I'm not really looking for another way to embed.That's not really the issue (I hope):?
The issue is how when viewing the "cart contents" it is showing "P" instead of "T".

hrothbeorht 08-06-2007 01:32 PM

Progress made - a wee Update (still unsolved)
 
Well.. I've been able to turn up more of the puzzle.
here is product_thumbnail.tpl:
Code:

{if $config.Appearance.show_thumbnails eq "Y"}
<img{if $id ne ''} id="{$id}"{/if}
src="{if $tmbn_url}{$tmbn_url}{else}
{if $full_url}{$http_location}{else}
{$xcart_web_dir}{/if}
/image.php?type={$type|default:"T"}&amp;id={$productid}{/if}
"{if $image_x ne 0} width="{$image_x}"{/if}
{if $image_y ne 0} height="{$image_y}"{/if}
alt="{$product|escape}" />{/if}

it returns:
http://www.website.ca/shop/images/P/flash_img.swf
I need it to return:
http://www.website.ca/shop/images/T/storm_1.jpg

This isn't really progress.. just that I'm learning that when I force in some stuff without doing it correctly (dynamically with smooth happy logic) I end up with more glitches that keep spilling out.

So, in the first post I kind of "forced" flash in. I'd really like to have preserved the code that is there. I hope to have the "P" product image and "T" thumbnail image stay correct. The way I have done it, I've messed things up.
I see that product_thumbnail.tpl is where that broken image is. So, in looking and my messy hack job and now knowing exactly what image is "broken" I hope some kind soul can help!

-hroth


All times are GMT -8. The time now is 02:00 PM.

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