Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

view details rollover on products.tpl

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 07-01-2003, 12:52 PM
 
leadtrum leadtrum is offline
 

Member
  
Join Date: May 2003
Posts: 14
 

Default 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}
Reply With Quote
  #2  
Old 07-01-2003, 07:35 PM
 
leadtrum leadtrum is offline
 

Member
  
Join Date: May 2003
Posts: 14
 

Default

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
Reply With Quote
  #3  
Old 01-05-2004, 02:28 PM
 
Xixao Xixao is offline
 

Advanced Member
  
Join Date: Dec 2003
Posts: 32
 

Default

Wow! Who designed your template? Did you? Can I get a quote for my store?
Reply With Quote
  #4  
Old 01-05-2004, 07:48 PM
  leon's Avatar 
leon leon is offline
 

X-Wizard
  
Join Date: Mar 2003
Location: Costa Rica
Posts: 1,213
 

Default

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.
__________________
It doesn\'t matter what is done... it is how it is done.
=============================
XCart Version: 3.5.3 -> Dmcigars.com
XCart Version: 4.1.3....
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 02:57 AM.

   

 
X-Cart forums © 2001-2020