Forums / Templates, Stylesheets, Page Layout / more of the Fun Stuff..

more of the Fun Stuff..

Views: 626

Results 1 to 7 of 7
20 Apr 2011, 10:53 PM
#1
soniccc avatar

soniccc

Zen Follower

Join Date:
May 2010
Location:
Cyberspace
Posts:
387
Plugin Contributions:
0

more of the Fun Stuff..

So, thanks to Great advice from ghj42, I'm on a Euphoric rush. So I coded this to have the text "total" show up in the cart right next to the cartTotals:

'<div class="cartBoxTotal"><span class="textTotal">Totalt</span>' . $currencies->format($_SESSION['cart']->show_total()) . '</div>';

Could this also be done a better way??

20 Apr 2011, 10:56 PM
#2
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: more of the Fun Stuff..

I'd recommend spelling it without a "t" at the end.

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

20 Apr 2011, 10:58 PM
#3
soniccc avatar

soniccc

Zen Follower

Join Date:
May 2010
Location:
Cyberspace
Posts:
387
Plugin Contributions:
0

Re: more of the Fun Stuff..

I guess that's the better way...

20 Apr 2011, 11:01 PM
#4
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: more of the Fun Stuff..

For multi-lingual sites it would be better to define the text in a PHP constant in your language files and then echo the constant,

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

21 Apr 2011, 7:41 AM
#5
soniccc avatar

soniccc

Zen Follower

Join Date:
May 2010
Location:
Cyberspace
Posts:
387
Plugin Contributions:
0

Re: more of the Fun Stuff..

Sounds great. How do I do that?

21 Apr 2011, 7:45 AM
#6
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: more of the Fun Stuff..

You go to the language files for each of pages where you want to use the text, and each of the language on your site and create an override file for your template (there's more on this in the FAQ) and add an additional entry as per the "define" statements already there.

Then in your code snippet above, instead of > <span class="textTotal">Totalt</span>you'd put

<span class="textTotal"><?php echo YOUR_NEW_DEFINED_CONSTANT_NAME; ?></span>

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

21 Apr 2011, 7:54 AM
#7
soniccc avatar

soniccc

Zen Follower

Join Date:
May 2010
Location:
Cyberspace
Posts:
387
Plugin Contributions:
0

Re: more of the Fun Stuff..

Looks cool.. I'll work on this, Thanks!