X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Dollar Sign in Smarty (https://forum.x-cart.com/showthread.php?t=16589)

Steele 09-14-2005 11:31 AM

Dollar Sign in Smarty
 
Hi all,
How can I compare a string containing dollar sign in smarty?

This:
{if $variable eq "From $79 to $89"}
does not work.

I tried back ticks:
{if $variable eq "From `$`79 to `$`89"}
and also back slashes, but that does not work either.

The string never matches...

Any idea?

Thanks.

shan 09-14-2005 12:41 PM

what is it your trying to do ?

Steele 09-14-2005 12:51 PM

I'm trying to place some headers in left categories menu on www.mr-roses.com/home.php

I edited the /skin1/customer/categories.tpl file like this:

Code:

{* $Id: categories.tpl,v 1.23 2004/06/24 09:53:29 max Exp $ *}
{capture name=menu}
{if $active_modules.Fancy_Categories ne ""}
{include file="`$fancycategories_config.modules_path`/fancy_categories.tpl"}
{else}
{if $config.General.root_categories eq "Y"}
{section name=cat_num loop=$categories}
        {if $categories[cat_num].category eq "50 Roses"}
                <div id="cat_head">Shop by Quantity</div>
        {/if}
        {if $categories[cat_num].category eq "Choose by color"}
                <div id="cat_head">Shop by Color</div>
        {/if}
        {if $categories[cat_num].category eq "Roses by stem length"}
                <div id="cat_head">Shop by Stem Length</div>
        {/if}
        {if $categories[cat_num].category eq "From `$`79 to `$`89"}
                <div id="cat_head">Shop by Price</div>
        {/if}
        {if $categories[cat_num].category eq "Calendar Events"}
                <div id="cat_head">Shop by Occasion</div>
        {/if}
<FONT class="CategoriesList">{$categories[cat_num].category}</FONT>

{/section}
{else} {section name=cat_num loop=$subcategories}
<FONT class="CategoriesList">{$subcategories[cat_num].category}</FONT>

{/section}
{/if}
{/if}
{/capture}
{ include file="menu.tpl" dingbats="dingbats_categorie.gif" menu_title=$lng.lbl_categories menu_content=$smarty.capture.menu }


It works fine as you can see, except that "Shop by Price" label.

Thanks.

shan 09-14-2005 05:28 PM

just use the variable $cat instead and match it with the category id number


All times are GMT -8. The time now is 09:40 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.