View Single Post
  #38  
Old 07-18-2007, 04:12 PM
 
Sisom Sisom is offline
 

eXpert
  
Join Date: Sep 2006
Posts: 310
 

Default Re: 3 column layout with thumbnail for Related Products

I think the part that actually pulls the price is this bit:

{if $product.taxes}<font class="ProductPriceVat">
{include file="customer/main/taxed_price.tpl"
taxes=$product.taxes}</font>


It's the taxed_price.tpl file, which is this little gem of architecture:


{* $Id: taxed_price.tpl,v 1.10 2005/11/17 06:55:38 max Exp $ *}
{if $taxes}
{foreach key=tax_name item=tax from=$taxes}
{if $tax.tax_value gt 0 or $tax.tax_value eq ""}
{if $tax.display_including_tax eq "Y"}
{if $display_info eq ""}{assign var="display_info" value=$tax.display_info}{/if}
{$lng.lbl_including_tax|substitute:"tax":$tax.tax_ display_name}{if $display_info eq "V" or ($display_info eq "A" and $tax.rate_type eq "$")} {if $is_subtax ne 'Y'}<span id="tax_{$tax.taxid}">{/if}<b>{include file="currency.tpl" value=$tax.tax_value}</b>{if $is_subtax ne 'Y'}</span>{/if}{elseif $display_info eq "R"} {if $tax.rate_type eq "$"}{include file="currency.tpl" value=$tax.rate_value}{else}{$tax.rate_value|forma tprice}%{/if}{elseif $display_info eq "A"} {if $tax.rate_type eq "%"}{$tax.rate_value|formatprice}% ({if $is_subtax ne 'Y'}<span id="tax_{$tax.taxid}">{/if}{include file="currency.tpl" value=$tax.tax_value}{if $is_subtax ne 'Y'}</span>{/if}){/if}{/if}
{* <br /> *}
{/if}
{/if}
{/foreach}
{/if}


It's not as bad as it looks though, basically it's lots of {if} tags, which then decide what to display, depending on whether you've selected to display prices including tax, etc.

I would comment out the first part (not in the taxed_price.tpl file, in the related_products.tpl file)

{* <font class="ProductPrice">{include file="currency.tpl" value=$product_links[cat_num].taxed_price}</font> *}

and leave this part (below), and see what you get.


{if $product.taxes}<font class="ProductPriceVat">
{include file="customer/main/taxed_price.tpl"
taxes=$product.taxes}</font>

Then do this:

{if $product.taxes}<font class="ProductPriceVat">TEST TEST TEST
{include file="customer/main/taxed_price.tpl"
taxes=$product.taxes}</font>

to see if the words "TEST TEST TEST" display. If they do, you know that the rest of the code is creating (or trying to create!) the text after the TEST words.

That's how I find out lots of things when editing the appearance of my cart - very often I'm not sure which piece of code is producing what, so I just bung in "TEST TEST TEST" somewhere in the template I'm editing, and see where it turns up.

So basically just feel free to comment out anything you want using {* *}, then you can see what code is doing what, without any risk of mucking the template up. You just delete the {* *} comment tags when you want to bring that piece of code back into action.

Let me know how you get on.
__________________
X-Cart Gold Version 4.3.2
Reply With Quote