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

Products.tpl - What is safe to get rid of?

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 05-12-2006, 03:12 AM
 
Grant Grant is offline
 

Senior Member
  
Join Date: Apr 2006
Posts: 171
 

Default Products.tpl - What is safe to get rid of?

I want to take my products.tpl file from THIS to something like THIS.

I need to know what I HAVE to keep in the template file to ensure the store stills runs properly. There seems to be a lot of stuff in the original .tpl file that may not be needed. I guess an explaination of what each piece of code does is what i'm after really.

This is my products.tpl file

Quote:
{* $Id: products.tpl,v 1.45.2.17 2006/02/27 08:53:50 svowl Exp $ *}
{if $active_modules.Feature_Comparison ne '' && $products && $printable ne 'Y'}
{include file="modules/Feature_Comparison/compare_selected_button.tpl"}
{include file="modules/Feature_Comparison/products_check_js.tpl"}
{/if}
{*** WebsiteCM Custom Category Templates mod - start ***}
{if $categorytpl ne ""}
{include file="customer/main/$categorytpl" product=$product}
{else}
{*** WebsiteCM Custom Category Templates mod - end ***}
{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}
{assign var="discount" value=0}
<TABLE border="0" width="100%">
<TR>
<TD width="90" align="center" valign="top">
{if $active_modules.Special_Offers ne "" and $products[product].have_offers}
{include file="modules/Special_Offers/customer/product_offer_thumb.tpl" product=$products[product]}
{$lng.lbl_see_details}
{else}
<A href="product.php?productid={$products[product].productid}&cat={$cat}&page={$navigation_page}{if $featured eq 'Y'}&featured{/if}">{include file="product_thumbnail.tpl" productid=$products[product].productid image_x=$config.Appearance.thumbnail_width product=$products[product].product tmbn_url=$products[product].tmbn_url}
{$lng.lbl_see_details}</A>
{/if}
{if $active_modules.Feature_Comparison ne '' && $products[product].fclassid > 0 && $printable ne 'Y'}




{include file="modules/Feature_Comparison/compare_checkbox.tpl" id=$products[product].productid}
{/if}
</TD>
<TD valign="top">
<FONT class="ProductTitle">{$products[product].product}</FONT>


{$lng.lbl_sku}: {$products[product].productcode}
<FONT size="1">




{$products[product].descr|truncate:300:"...":true}


</FONT>
<HR size="1" noshade width="100%" align="left">
{if $products[product].product_type eq "C"}
{include file="buttons/details.tpl" href="product.php?productid=`$products[product].productid`&cat=`$cat`&page=`$navigation_page`"}
{else}
{if $active_modules.Subscriptions ne "" and ($products[product].catalogprice gt 0 or $products[product].sub_priceplan gt 0)}
{include file="modules/Subscriptions/subscription_info_inlist.tpl"}
{else}
{if $products[product].taxed_price ne 0}
{if $products[product].list_price gt 0 and $products[product].taxed_price lt $products[product].list_price}
{math equation="100-(price/lprice)*100" price=$products[product].taxed_price lprice=$products[product].list_price format="%3.0f" assign=discount}
{if $discount gt 0}
<FONT class="MarketPrice">{$lng.lbl_market_price}: <S>
{include file="currency.tpl" value=$products[product].list_price}
</S></FONT>

{/if}
{/if}
{if $active_modules.Special_Offers ne "" and $products[product].use_special_price ne ""}
<S>
{/if}
<FONT class="ProductPrice">{$lng.lbl_our_price}: {include file="currency.tpl" value=$products[product].taxed_price}</FONT><FONT class="MarketPrice">{include file="customer/main/alter_currency_value.tpl" alter_currency_value=$products[product].taxed_price}</FONT>{if $discount gt 0}{if $config.General.alter_currency_symbol ne ""}, {/if}{$lng.lbl_save_price} {$discount}%{/if}
{if $active_modules.Special_Offers ne "" and $products[product].use_special_price ne ""}
</S>
{/if}
{if $products[product].taxes}


<TABLE border="0">
<TR>
<TD>[img]{$ImagesDir}/spacer.gif[/img]</TD>
<TD>{include file="customer/main/taxed_price.tpl" taxes=$products[product].taxes}</TD>
</TR>
</TABLE>
{/if}
{if $active_modules.Special_Offers ne "" and $products[product].use_special_price ne ""}
{include file="modules/Special_Offers/customer/product_special_price.tpl" product=$products[product]}
{/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}
{/if}
</TD></TR>
</TABLE>






{/section}
{if $active_modules.Feature_Comparison ne '' && $products && $printable ne 'Y'}
{include file="modules/Feature_Comparison/compare_selected_button.tpl"}
{/if}
{else}
{$lng.txt_no_products_found}
{/if}
{/if}
{*** WebsiteCM Custom Category Templates mod - start ***}
{/if}
{*** WebsiteCM Custom Category Templates mod - end ***}

Any help would be greatly appreciated before I start to rush in there like a bull in a china shop
__________________
X-Cart version : 4.0.18
Mod : Customer Also Bought
Mod : Custom catergory Templates
Mod : Custon Product Templates
Reply With Quote
  #2  
Old 05-12-2006, 03:20 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default

That is a lot to ask Why not just try commenting out one piece at a time until you get where you want to go? Make a backup first.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #3  
Old 05-12-2006, 03:28 AM
 
Grant Grant is offline
 

Senior Member
  
Join Date: Apr 2006
Posts: 171
 

Default

Quote:
Originally Posted by balinor
That is a lot to ask Why not just try commenting out one piece at a time until you get where you want to go? Make a backup first.

Haha, yeah sorry I know it is.

Ok so commenting out? I know i've seen this before but I can't remember what you have to do. Is it [**] or something before everyline you want to lose?
__________________
X-Cart version : 4.0.18
Mod : Customer Also Bought
Mod : Custom catergory Templates
Mod : Custon Product Templates
Reply With Quote
  #4  
Old 05-12-2006, 03:31 AM
 
Grant Grant is offline
 

Senior Member
  
Join Date: Apr 2006
Posts: 171
 

Default

Ok 1 question then

What part of that code is pulling the 'short description' from the product info?

Is it ;

{$products[product].descr|truncate:300:"...":true}

?

And if so - is it possible to add html (ie a clickable image) in the short description field or is it text only?
__________________
X-Cart version : 4.0.18
Mod : Customer Also Bought
Mod : Custom catergory Templates
Mod : Custon Product Templates
Reply With Quote
  #5  
Old 05-12-2006, 03:34 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default

Yes, that is it. To comment it out, you would do this:

{* {$products[product].descr|truncate:300:"...":true} *}

And yes, the description fields accept html
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #6  
Old 05-12-2006, 03:40 AM
 
Grant Grant is offline
 

Senior Member
  
Join Date: Apr 2006
Posts: 171
 

Default

Quote:
Originally Posted by balinor
Yes, that is it. To comment it out, you would do this:

{* {$products[product].descr|truncate:300:"...":true} *}

And yes, the description fields accept html

Big up B

This is gonna be easier than I thought.
When I've done it i'll up the code in case anybody else is ever looking for the same thing
__________________
X-Cart version : 4.0.18
Mod : Customer Also Bought
Mod : Custom catergory Templates
Mod : Custon Product Templates
Reply With Quote
  #7  
Old 05-12-2006, 08:27 AM
  Zaja's Avatar 
Zaja Zaja is offline
 

X-Adept
  
Join Date: Mar 2004
Location: The Universe is my home
Posts: 420
 

Default

Grant, do you feel lucky today?

Replace products.tpl code with this:
Code:
{* $Id: products.tpl,v 1.45.2.17 2006/04/21 08:53:50 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} {assign var="discount" value=0} <table border="0" cellpadding="5" cellspacing="1" width="100%"> <tr style="background-color:{cycle values="#eee,#fff};"> <td style="width:300px;"> <font class="ProductTitle">{$products[product].product}</font> </td> <td> {if $products[product].product_type eq "C"} {include file="buttons/details.tpl" href="product.php?productid=`$products[product].productid`&cat=`$cat`&page=`$navigation_page`"} {else} {if $active_modules.Subscriptions ne "" and ($products[product].catalogprice gt 0 or $products[product].sub_priceplan gt 0)} {include file="modules/Subscriptions/subscription_info_inlist.tpl"} {else} {if $products[product].taxed_price ne 0} <font class="ProductPrice">{include file="currency.tpl" value=$products[product].taxed_price}</font> {/if} {/if} </td> <td style="text-align:right;width:110px;"> {if $usertype eq "C" and $config.Appearance.buynow_button_enabled eq "Y"} <form style="margin:0;" name="orderform_{$products[product].productid}_{$products[product].add_date}" method="post" action="cart.php?mode=add"> <input type="hidden" name="productid" value="{$products[product].productid}"> <input type="hidden" name="cat" value="{$smarty.get.cat|escape:"html"}"> <input type="hidden" name="page" value="{$smarty.get.page|escape:"html"}"> <input type="hidden" name="amount" value="1"> <input type="button" value="{$lng.lbl_add_to_cart}" onclick="document.orderform_{$products[product].productid}_{$products[product].add_date}.submit();"> </form> {/if} </td> {/if} </tr> </table> {/section} {else} {$lng.txt_no_products_found} {/if} {/if}
__________________
_/ _/ _/ _/ _/ _/ _/ _/ _/

7dana.com
Reply With Quote
  #8  
Old 05-12-2006, 09:51 AM
 
Grant Grant is offline
 

Senior Member
  
Join Date: Apr 2006
Posts: 171
 

Default

Zaja - you are a LEGEND!

Thank you so much brother - that works beautifully

I have a little problem though - after speaking with Jon at websitecm it turns out that I have to be using skin1/customer/main/products_t.tpl and NOT skin1/customer/main/products.tpl

Now i've had a look inside products_t.tpl and had a play around and boy is that one confusing page of code!

Could the code you have written here be used in the products_t.tpl file also? And where would I place it? Because everytime i've tried to edit it at all I get all kinds of math errors and smarty parse errors.

Ideally i'm trying to go from this : (which is the basic 1 column product_t.tpl with the buy button activated)

http://www.wyzeshop.com/1st.jpg

To something like this :

http://www.wyzeshop.com/2nd.jpg

Thanks again for hooking up that code man
__________________
X-Cart version : 4.0.18
Mod : Customer Also Bought
Mod : Custom catergory Templates
Mod : Custon Product Templates
Reply With Quote
  #9  
Old 05-12-2006, 11:23 AM
  Zaja's Avatar 
Zaja Zaja is offline
 

X-Adept
  
Join Date: Mar 2004
Location: The Universe is my home
Posts: 420
 

Default

Well....you need a full customization of product listing!

It may be better to look into the "Professional Help Services - Requests" forum, there you can find users(like Ryan, TelaFirma, Boomer, Jon, Carrie ... ) that can do it for you with a reasonable fee.
__________________
_/ _/ _/ _/ _/ _/ _/ _/ _/

7dana.com
Reply With Quote
  #10  
Old 05-12-2006, 01:29 PM
 
Grant Grant is offline
 

Senior Member
  
Join Date: Apr 2006
Posts: 171
 

Default

Quote:
Originally Posted by Zaja
Well....you need a full customization of product listing!

It may be better to look into the "Professional Help Services - Requests" forum, there you can find users(like Ryan, TelaFirma, Boomer, Jon, Carrie ... ) that can do it for you with a reasonable fee.

Thats what I have slowly started to realise.

So the code you pasted earlier can't just be thrown into products_t.tpl then?

Anyone have any idea what kind of dollar am I gonna be looking at for something like this?
__________________
X-Cart version : 4.0.18
Mod : Customer Also Bought
Mod : Custom catergory Templates
Mod : Custon Product Templates
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



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 12:11 PM.

   

 
X-Cart forums © 2001-2020