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

products_t.tpl not aligh properly (centre)

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 11-14-2004, 02:25 PM
 
x-online x-online is offline
 

Senior Member
  
Join Date: Apr 2004
Location: Australia, Sydney
Posts: 189
 

Default products_t.tpl not aligh properly (centre)

I am having a problem with this products_t.tpl

"buy now" button was once disabled.
I turned that on and found out that it was left alignment rather than centre

So what i get is basicly..
*******************************
Market price
Price
%
BUY NOW
*******************************

Can some one please help me make them align centre all together?
like:
*******************************
Market price
Price
%
BUY NOW
*******************************
here are my products_t.tpl
********************************
{* $Id: products_t.tpl,v 1.10.2.3 2004/10/13 12:42:44 max Exp $ *}
<TABLE border="0" width="100%" cellpadding="0" cellspacing="0"><TR><TD class="TableThumbnailBorder">

<TABLE border="0" width="100%" cellpadding="5" cellspacing="1">

{math equation="floor(100/x)" x=$config.Appearance.products_per_row assign="width"}

{section name=product loop=$products}
{assign var="discount" value=0}

{if %product.index% is div by $config.Appearance.products_per_row}
<TR>
{assign var="cell_counter" value=0}
{/if}

{math equation="x+1" x=$cell_counter assign="cell_counter" }
<TD width="{$width}%" align="center" valign="top" class="DialogBox">

{$products[product].product}

<TABLE cellpadding="3" cellspacing="0" border="0"><TR><TD height="100">
{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}

</TD></TR>
</TABLE>
{$lng.lbl_see_details}


{if $active_modules.Subscriptions ne "" and $products[product].catalogprice}
{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="%d" assign=discount}
{if $discount gt 0}
<FONT class="MarketPrice">{$lng.lbl_market_price}:
{include file="currency.tpl" value=$products[product].list_price}
</FONT>

{/if}
{/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}, save {$discount}%{/if}
{if $products[product].taxes}
{include file="customer/main/taxed_price.tpl" taxes=$products[product].taxes}{/if}
{else}
<FONT class="ProductPrice">{$lng.lbl_enter_your_price}</FONT>
{/if}
{/if}
{if $active_modules.Feature_Comparison ne '' && $products[product].fclassid > 0}


{include file="modules/Feature_Comparison/compare_checkbox.tpl" id=$products[product].productid}
{/if}
<center>{if $usertype eq "C" and $config.Appearance.buynow_button_enabled eq "Y"}
{include file="customer/main/buy_now.tpl" product=$products[product]}
{/if}</center>


<hr color="#000000" width="200" size="2"></TD>

{capture name=prod_index}
{math equation="index+x+1" index=%product.index% x=$config.Appearance.products_per_row}
{/capture}
{if $smarty.capture.prod_index is div by $config.Appearance.products_per_row }
</TR>
{/if}

{/section}

{if $cell_counter lt $config.Appearance.products_per_row}
{section name=rest_cells loop=$config.Appearance.products_per_row start=$cell_counter}
<TD class="DialogBox"></TD>
{/section}
</TR>
{/if}

</TABLE>
</TD></TR></TABLE>
***********************************

Can not see anything wrong there.

Please advise.
__________________
X-Cart version 4.x (Most likely will be the latest version)
Reply With Quote
  #2  
Old 11-15-2004, 04:03 AM
 
balinor balinor is offline
 

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

Default

The <center> tag is a depreciated tag in html and shouldn't be used. In order to center the items on that page, you will need to add align="center" to the <table> tag, as well as any <td> tags just to be safe. You will also need to edit the buy_now.tpl the same way to get the quantity line and the buy now button to align properly.

If you want to center just a single item in a table without centering the rest, try enclosing the item with div tags. Example:

<div align="center">Item you want to center</div>

That should solve it!
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #3  
Old 11-15-2004, 04:10 AM
 
x-online x-online is offline
 

Senior Member
  
Join Date: Apr 2004
Location: Australia, Sydney
Posts: 189
 

Default thanks.

I just got an answer from xcart as well.

For any of those who had the same prblems:
*****************************************
I have chanded the following lines in the skin1/customer/main/buy_now.tpl:

- line 18 (<TR align=center>);
- line 20 (<TD height="25" nowrap align=right
width=52%>{$lng.lbl_quantity});
- line 22 (<TD nowrap align=left>);
- line 62 (<TABLE border="0" cellpadding="0" cellspacing="0" align=center><TR>);
*****************************************
by X-cart team!

Thanks again to x-cart team and balinor for your input and helping me out.
__________________
X-Cart version 4.x (Most likely will be the latest version)
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:33 AM.

   

 
X-Cart forums © 2001-2020