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

product_prices.tpl for wholesale prices - won't edit

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 08-08-2010, 08:10 AM
 
Sisom Sisom is offline
 

eXpert
  
Join Date: Sep 2006
Posts: 310
 

Default product_prices.tpl for wholesale prices - won't edit

Hi, I've been trying to change the colors on the wholesale prices on the product pages, but I've come across something very strange - part of the code in customer/main/product_prices.tpl is outputting HTML, but the other part just doesn't seem to do anything.

My product_prices.tpl looks like this:
Code:
{* $Id: product_prices.tpl,v 1.23.2.1 2010/02/25 11:15:18 aim Exp $ vim: set ts=2 sw=2 sts=2 et: *} <div id="wl-prices"{if !$product_wholesale} style="display: none;"{/if}> {if $product.taxes} {capture name=taxdata} {include file="customer/main/taxed_price.tpl" taxes=$product.taxes display_info="N"} {/capture} {/if} <table cellspacing="1" summary="{$lng.lbl_wholesale_prices|escape}"> <tr class="head-row"> <th>{$lng.lbl_quantity}</th> <th>{$lng.lbl_price}{if $smarty.capture.taxdata}*{/if}</th> </tr> {foreach from=$product_wholesale item=w name=wi} <tr class="wholesale"> <td> {strip} {$w.quantity}{if $w.next_quantity eq 0}+{elseif $w.next_quantity ne $w.quantity}-{$w.next_quantity}{/if} &nbsp; {$lng.lbl_item}{if $w.quantity > 1}s{/if} {* COMMENTING OUT X-CART PLURAL CODE *} {* {if $w.quantity eq "1"} {$lng.lbl_item} {else} {$lng.lbl_items} {/if} *} {* COMMENTING OUT X-CART PLURAL CODE --->END *} {/strip} </td> <td>{include file="currency.tpl" value=$w.taxed_price tag_id="wp`$smarty.foreach.wi.index`"}</td> </tr> {/foreach} </table> <div{if !$smarty.capture.taxdata} style="display: none;"{/if}> <strong>*{$lng.txt_note}:</strong>{$smarty.capture.taxdata} </div> </div>

You can see that I thought I'd do an experiment to make the automatic insertion of 's' for plural items, a little shorter code-wise, but then I decided to add a class to the second table row, and use a descendant selector to modify the table cells. But it doesn't work. The class doesn't show up when I view the site in my browser, and check the source HTML.
But the code in the table header DOES work. If I insert the word 'test' as follows:
Code:
<tr class="head-row"> <th>{$lng.lbl_quantity}TEST</th> <th>{$lng.lbl_price}{if $smarty.capture.taxdata}*{/if}TEST</th> </tr>
it appears in the browser, but no matter what I do to the next table row (including completely commenting out all of the following piece of code), it still appears exactly the same!
Code:
{foreach from=$product_wholesale item=w name=wi} <tr class="wholesale"> <td> {strip} {$w.quantity}{if $w.next_quantity eq 0}+{elseif $w.next_quantity ne $w.quantity}-{$w.next_quantity}{/if} &nbsp; {$lng.lbl_item}{if $w.quantity > 1}s{/if} {* COMMENTING OUT X-CART PLURAL CODE *} {* {if $w.quantity eq "1"} {$lng.lbl_item} {else} {$lng.lbl_items} {/if} *} {* COMMENTING OUT X-CART PLURAL CODE --->END *} {/strip} </td> <td>{include file="currency.tpl" value=$w.taxed_price tag_id="wp`$smarty.foreach.wi.index`"}</td> </tr> {/foreach}

Even when I commented out all of that code, it still displays in the browser, but I can't work out how!

Does anybody have any ideas? It's hard enough trying to edit things, without them refusing to change after being edited!

You can see what it looks like on the product page for 'Test product' here:

http://www.mrdtrading.co.uk/store/home.php?shopkey=martin

Many thanks.
__________________
X-Cart Gold Version 4.3.2
Reply With Quote
  #2  
Old 08-08-2010, 08:17 AM
 
Sisom Sisom is offline
 

eXpert
  
Join Date: Sep 2006
Posts: 310
 

Default Re: product_prices.tpl for wholesale prices - won't edit

I've also tried the following:
Code:
{* $Id: product_prices.tpl,v 1.23.2.1 2010/02/25 11:15:18 aim Exp $ vim: set ts=2 sw=2 sts=2 et: *} <div id="wl-prices"{if !$product_wholesale} style="display: none;"{/if}> {if $product.taxes} {capture name=taxdata} {include file="customer/main/taxed_price.tpl" taxes=$product.taxes display_info="N"} {/capture} {/if} <table cellspacing="1" summary="{$lng.lbl_wholesale_prices|escape}"> {* <tr class="head-row"> <th>{$lng.lbl_quantity}</th> <th>{$lng.lbl_price}{if $smarty.capture.taxdata}*{/if}</th> </tr> *} </table> <div{if !$smarty.capture.taxdata} style="display: none;"{/if}> <strong>*{$lng.txt_note}:</strong>{$smarty.capture.taxdata} </div> </div>

This makes the browser display two rows of the bottom row, i.e. it now displays:
10+ Items ё49.99
10+ Items ё49.99

So obviously it must be getting the table row (not the table header) from somewhere else.

I even tried inserting the following:
Code:
<tr class="head-row"> <th>{$lng.lbl_quantity}</th> <th>{$lng.lbl_price}{if $smarty.capture.taxdata}*{/if}</th> </tr> <tr><td>TEST</td></tr>

But it wouldn't display the 'TEST', it just didn't exist in the HTML source.
__________________
X-Cart Gold Version 4.3.2
Reply With Quote
  #3  
Old 08-08-2010, 09:06 AM
 
Shamun Shamun is offline
 

X-Adept
  
Join Date: Jun 2009
Location: North Carolina
Posts: 841
 

Default Re: product_prices.tpl for wholesale prices - won't edit

Try running www.yoursite.com/cleanup.php to clear the cache.
__________________
- Shane Munroe
Reply With Quote

The following user thanks Shamun for this useful post:
Sisom (08-08-2010)
  #4  
Old 08-08-2010, 10:35 AM
 
Sisom Sisom is offline
 

eXpert
  
Join Date: Sep 2006
Posts: 310
 

Default Re: product_prices.tpl for wholesale prices - won't edit

I tried that Tal, but no luck. I have just edited customer/main/send_to_friend.tpl and it worked fine, so I can't understand why product_prices.tpl isn't doing what I tell it to!

I have just tried reducing it down to:
Code:
{* $Id: product_prices.tpl,v 1.23.2.1 2010/02/25 11:15:18 aim Exp $ vim: set ts=2 sw=2 sts=2 et: *} <div id="wl-prices"{if !$product_wholesale} style="display: none;"{/if}> {if $product.taxes} {capture name=taxdata} {include file="customer/main/taxed_price.tpl" taxes=$product.taxes display_info="N"} {/capture} {/if} <table cellspacing="1" summary="{$lng.lbl_wholesale_prices|escape}"> <tr class="head-row"> <th>{$lng.lbl_quantity}</th> <th>{$lng.lbl_price}{if $smarty.capture.taxdata}*{/if}</th> </tr> </table> <div{if !$smarty.capture.taxdata} style="display: none;"{/if}> <strong>*{$lng.txt_note}:</strong>{$smarty.capture.taxdata} </div> </div>

and yet it still displays the table row, meaning nothing that I deleted could have been displaying it. I just don't get it.

Also, the wholesale prices header has never appeared, I presume it should be at the head of the table, due to:
Code:
<table cellspacing="1" summary="{$lng.lbl_wholesale_prices|escape}">
__________________
X-Cart Gold Version 4.3.2
Reply With Quote
  #5  
Old 08-08-2010, 10:40 AM
 
Sisom Sisom is offline
 

eXpert
  
Join Date: Sep 2006
Posts: 310
 

Default Re: product_prices.tpl for wholesale prices - won't edit

I also tried deleting the whole table, and that worked - i.e. the wholesale prices table completely vanished:

Code:
{* $Id: product_prices.tpl,v 1.23.2.1 2010/02/25 11:15:18 aim Exp $ vim: set ts=2 sw=2 sts=2 et: *} <div id="wl-prices"{if !$product_wholesale} style="display: none;"{/if}> {if $product.taxes} {capture name=taxdata} {include file="customer/main/taxed_price.tpl" taxes=$product.taxes display_info="N"} {/capture} {/if} <div{if !$smarty.capture.taxdata} style="display: none;"{/if}> <strong>*{$lng.txt_note}:</strong>{$smarty.capture.taxdata} </div> </div>

So somehow, the following piece of code doesn't actually do anything, even though it must!
Code:
{foreach from=$product_wholesale item=w name=wi} <tr class="wholesale"> <td> {strip} {$w.quantity}{if $w.next_quantity eq 0}+{elseif $w.next_quantity ne $w.quantity}-{$w.next_quantity}{/if} &nbsp; {$lng.lbl_item}{if $w.quantity > 1}s{/if} {* COMMENTING OUT X-CART PLURAL CODE *} {* {if $w.quantity eq "1"} {$lng.lbl_item} {else} {$lng.lbl_items} {/if} *} {* COMMENTING OUT X-CART PLURAL CODE --->END *} {/strip} </td> <td>{include file="currency.tpl" value=$w.taxed_price tag_id="wp`$smarty.foreach.wi.index`"}</td> </tr> {/foreach}

I know it must be doing something, because when I remove the following piece of code only, the table head row, I see two versions of the table data cells, one on top of the other:
Code:
<tr class="head-row"> <th>{$lng.lbl_quantity}</th> <th>{$lng.lbl_price}{if $smarty.capture.taxdata}*{/if}</th> </tr>

This is a real head scratcher for me.
__________________
X-Cart Gold Version 4.3.2
Reply With Quote
  #6  
Old 03-13-2012, 06:30 AM
  pauldodman's Avatar 
pauldodman pauldodman is offline
 

X-Guru
  
Join Date: Jul 2003
Location: Spain / UK
Posts: 3,054
 

Default Re: product_prices.tpl for wholesale prices - won't edit

Just in case anyone else gets stuck with this - the table is actually built up in Product_Options/func.js
__________________
Paul Dodman
e-business & m-commerce consultant
w: www.luminointernet.com
e: xcart@luminointernet.com

Professional X-Cart help, advice, support and services, specialists in Mobile X-Cart.
Reply With Quote

The following user thanks pauldodman for this useful post:
Ben G (09-08-2014)
  #7  
Old 09-08-2014, 06:17 PM
 
Ben G Ben G is offline
 

Advanced Member
  
Join Date: Nov 2006
Posts: 100
 

Default Re: product_prices.tpl for wholesale prices - won't edit

pauldodman is correct.

The following post might help some understand a little more how Product_Options/func.js and product_prices.tpl work together.
http://forum.x-cart.com/showthread.php?p=377050#post377050
__________________
Ben
X-Cart 4.6.6 Gold Plus - lots of modules
X-Cart 4.7.9 Gold Plus - lots of modules
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 11:15 AM.

   

 
X-Cart forums © 2001-2020