Thread: Newest Products
View Single Post
  #160  
Old 01-10-2007, 01:12 PM
 
MCM MCM is offline
 

Senior Member
  
Join Date: Dec 2005
Posts: 114
 

Default Re: Newest Products

Hi,

I tried adding this to a cart (4.0.1 and have run into the following error at newproducts.php

Fatal error: Smarty error: [in customer/main/newproducts.tpl line 40]: syntax error: unidentified token '[/img]{/if' (Smarty_Compiler.class.php, line 1384) in /home/jmscoins/public_html/Smarty-2.6.9/Smarty.class.php on line 1088

The rest of the page also doesn't show up properly: http://www.jmscoins.com/newproducts.php

Here are the files I added and where:


newproducts.php is in the xcart root directory. The only adjustment I made was the line change around page 13.



newproducts.tpl is in customer/main/

Code:
{* $Id: newproducts.tpl,v 1.0.0.1 2005/09/23 01:00:00 jfc Exp $ *} {* This uses $lng.lbl_newproducts_since => "Products added since" $lng.lbl_newproducts => "New Products" *} {if ($navigation_page eq "")||($navigation_page eq "1")}{$current_category.description|regex_replace:"/[\n]/":" "} {/if} {capture name=dialog} {assign var="tmp" value="0"} {assign var="url" value="newproducts.php?"} {* ext-1 - this could be moved to a new .tpl file *} <font size="2">{$lng.lbl_newproducts_since}: {foreach from=$newproducts_dayrange key=name item=field} {if $name eq $days}{$field}{else}{$field}{/if} {/foreach} </font> {* ext-1 *} {if $products ne "" } <BR clear="left"> <HR size="1" noshade> {/if} {if !empty($products) && is_array($products)} {* ext-2 - this could be moved to a new .tpl file *} {if $sort_fields} <DIV align="right"><font size="2"> {$lng.lbl_sort_by}: {foreach from=$sort_fields key=name item=field} {if $name eq $sortby}[img]{$ImagesDir}/{if $sortdirection eq [/img]{/if}{$field}{if $name eq $sortby}{/if} {/foreach}</font> </DIV> {/if} {* ext-2 *} {if $total_pages gt 2} { include file="customer/main/navigation.tpl" } {/if} <HR size="1" width="100%"> {include file="customer/main/products.tpl" products=$products} {else} {$lng.txt_no_newproducts} {/if} {/capture} {include file="dialog.tpl" title=$lng.lbl_newproducts content=$smarty.capture.dialog extra="width=100%"} { include file="customer/main/navigation.tpl" }


This is line 40:
Code:
{if $name eq $sortby}[img]{$ImagesDir}/{if $sortdirection eq [/img]{/if}{$field}{if $name eq $sortby}{/if}



This is at the bottom of home_main.tpl before the else clause

Code:
{elseif $main eq "newproducts"} {include file="customer/main/newproducts.tpl"}


I also uploaded the language variables.

If anyone has any insight, I'd really appreciate it. Also, is there any way to append "NEW" to the title of any new product wherever displayed in the store?

Thanks,

Jeremy
__________________
Version 4.0.17/4.0.18
Reply With Quote