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)
-   -   view details rollover on products.tpl (https://forum.x-cart.com/showthread.php?t=3414)

leadtrum 07-01-2003 12:52 PM

view details rollover on products.tpl
 
okay first...here's a test of what i want:
http://www.aerotrends.com/store/rollover.html

basically what i was looking to do was to have this 'view details' rollover appear when the user rolled over the that <tr>. well what you people already know is that you can't do a rollover in a repeating section because the <img name=""> will repeat for every new row. so basically say you name your value "pic" then for each new row it'll be "pic".

my idea was to use the smarty cycle tag after the name to give it like a numeric value.

for example

[img]pictures.jpg[/img]

problem is that its not cylcing at all, it just stays at one. I know there's gotta be a better way to do it then using the cycle tag. Is there a way that I can reference the number of the row created by the section loop?

here's the code i have so far:

product_thumbnail.tpl (param09 is my thumbnail field)

Code:

{* $Id: product_thumbnail.tpl,v 1.8 2003/04/24 09:50:33 svowl Exp $ *}
{if $config.Appearance.show_thumbnails eq "Y"}
{if $products[product].param09 ne ""}[img]http://www.aerotrends.com/{$products[product].param09}[/img]{/if}
{/if}
{if $products[product].param09 eq ""}
[img]http://www.aerotrends.com/store/images/noimage.gif[/img]{/if}


customer/main/products.tpl
Code:

{* $Id: products.tpl,v 1.33 2003/04/24 09:50:33 svowl Exp $ *}
{if $usertype eq "C" and $config.Appearance.products_per_row ne "" and $config.Appearance.products_per_row gt 0 and $config.Appearance.products_per_row lt 4 and ($featured eq "Y" or $config.Appearance.featured_only_multicolumn eq "N")}
{include file="customer/main/products_t.tpl" products=$products}
{else}
{if $products}
{section name=product loop=$products}
<table border=0 width=100%>
<tr bgcolor="{cycle values="#F7F7F7,#FFFFFF"}"><td width=90 align=center valign=top bgcolor="#FFFFFF">
<a href=product.php?productid={$products[product].productid}&cat={$cat}&page={$navigation_page}>{include file="product_thumbnail.tpl" productid=$products[product].productid image_x=$config.Appearance.thumbnail_width product=$products[product].product}

[img]http://www.aerotrends.com/store/images/main/seedetails.gif[/img]</a></td>
<td valign=top>
{$products[product].product}</font>


<font size=1 color=#666666>{$products[product].param02}</font>




<font size=1>
{$products[product].descr|truncate:300:"...":true}


</font>
<hr size=1 noshade width=100% align=left>
{if $products[product].param01 ne ""}
<font size=1 color="66666">Material: {$products[product].param01}


{/if}
{if $active_modules.Subscriptions ne "" and $products[product].catalogprice}
{include file="modules/Subscriptions/subscription_info_inlist.tpl"}
{else}
{if $products[product].price ne 0}
{if $products[product].list_price gt 0}
{math equation="100-(price/lprice)*100" price=$products[product].price lprice=$products[product].list_price format="%d" assign=discount}
<font class=MarketPrice>{$lng.lbl_market_price}: <s>
{include file="currency.tpl" value=$products[product].list_price}
</s></font>

{/if}
<font class=ProductPrice>{$lng.lbl_our_price}: {include file="currency.tpl" value=$products[product].price}</font><font class=MarketPrice>{include file="customer/main/alter_currency_value.tpl" alter_currency_value=$products[product].price}</font>{if $products[product].list_price gt 0}, save {$discount}%{/if}{if $config.Taxes.use_vat eq "Y" and $products[product].vat gt "0"}, {$lng.lbl_including_vat} {$products[product].vat}%{/if}
{else}
<font class=ProductPrice>{$lng.lbl_enter_your_price}</font>
{/if}
{/if}
{if $usertype eq "C" and $config.Appearance.buynow_button_enabled eq "Y"}
{include file="customer/main/buy_now.tpl" product=$products[product]}
{/if}
</td></tr>
</table>
[img]images/viewdetails_off.gif[/img]
{/section}
{else}
{$lng.lbl_no_products_found}
{/if}
{/if}


leadtrum 07-01-2003 07:35 PM

found it out...i just used the counter function in smarty to do it.

product_thumbnail.tpl
Code:

{* $Id: product_thumbnail.tpl,v 1.8 2003/04/24 09:50:33 svowl Exp $ *}
{if $config.Appearance.show_thumbnails eq "Y"}
{if $products[product].param09 ne ""}[img]http://www.aerotrends.com/{$products[product].param09}[/img]{/if}
{/if}
{if $products[product].param09 eq ""}
[img]http://www.aerotrends.com/store/images/noimage.gif[/img]{/if}


customer/main/products.tpl
Code:

{* $Id: products.tpl,v 1.33 2003/04/24 09:50:33 svowl Exp $ *}
{if $usertype eq "C" and $config.Appearance.products_per_row ne "" and $config.Appearance.products_per_row gt 0 and $config.Appearance.products_per_row lt 4 and ($featured eq "Y" or $config.Appearance.featured_only_multicolumn eq "N")}
{include file="customer/main/products_t.tpl" products=$products}
{else}
{if $products}
{* initialize the count *}
{counter start=0 skip=1 print=false name=ct}
{counter start=0 skip=1 print=false name=sub}
{section name=product loop=$products}
<table border=0 width=100%>
<tr bgcolor="{cycle values="#F7F7F7,#FFFFFF"}" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('view{counter name=sub}','','images/viewdetails.gif',1)"><td width=90 align=center valign=top bgcolor="#FFFFFF">
<a href=product.php?productid={$products[product].productid}&cat={$cat}&page={$navigation_page}>{include file="product_thumbnail.tpl" productid=$products[product].productid image_x=$config.Appearance.thumbnail_width product=$products[product].product}</a></td>
<td valign=top>
{$products[product].product}</font>


<font size=1 color=#666666>{$products[product].param02}</font>




<font size=1>
{$products[product].descr|truncate:300:"...":true}


</font>
<hr size=1 noshade width=100% align=left>
{if $products[product].param01 ne ""}
<font size=1 color="66666">Material: {$products[product].param01}


{/if}
{if $active_modules.Subscriptions ne "" and $products[product].catalogprice}
{include file="modules/Subscriptions/subscription_info_inlist.tpl"}
{else}
{if $products[product].price ne 0}
{if $products[product].list_price gt 0}
{math equation="100-(price/lprice)*100" price=$products[product].price lprice=$products[product].list_price format="%d" assign=discount}
<font class=MarketPrice>{$lng.lbl_market_price}: <s>
{include file="currency.tpl" value=$products[product].list_price}
</s></font>

{/if}
<font class=ProductPrice>{$lng.lbl_our_price}: {include file="currency.tpl" value=$products[product].price}</font><font class=MarketPrice>{include file="customer/main/alter_currency_value.tpl" alter_currency_value=$products[product].price}</font>{if $products[product].list_price gt 0}, save {$discount}%{/if}{if $config.Taxes.use_vat eq "Y" and $products[product].vat gt "0"}, {$lng.lbl_including_vat} {$products[product].vat}%{/if}
{else}
<font class=ProductPrice>{$lng.lbl_enter_your_price}</font>
{/if}
{/if}
{if $usertype eq "C" and $config.Appearance.buynow_button_enabled eq "Y"}
{include file="customer/main/buy_now.tpl" product=$products[product]}
{/if}
</td></tr>
</table>
[img]images/viewdetails_off.gif[/img]
{/section}
{else}
{$lng.lbl_no_products_found}
{/if}
{/if}


http://www.aerotrends.com/store/customer/home.php?cat=275 :D

Xixao 01-05-2004 02:28 PM

Wow! Who designed your template? Did you? Can I get a quote for my store?

leon 01-05-2004 07:48 PM

Thank you for sharing this mod, nice, could be usefull on my second project.

And yes, you have an inspiring site, doesnt look like xcart at all.


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

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