Post by madany » Tue Sep 28, 2010 6:04 pm

I want create "account form" --> "index.php?route=account/create" with two choices. The choices chosen by active language. Ex: If english (en) is current lang, then all fields show up. If indonesian (id) is current lang, then only field:country that dont show up.
I tried --> if ($lang == 'en') { bla bla bla }
if ($lang == 'id') { bla bla bla }
... but got error --> Notice: Undefined variable: lang.
Plz tell me the right code.. :) thx..

New member

Posts

Joined
Mon Aug 31, 2009 2:03 pm

Post by Qphoria » Tue Sep 28, 2010 9:59 pm

Code: Select all

if ($this->config->get('config_language') == 'en') {

}
This is the exception to the rule on lookups. It used to be (and should still be) $this->language->getCode() but was changed for no good reason in more recent versions

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by madany » Wed Sep 29, 2010 1:34 am

Qphoria wrote:

Code: Select all

if ($this->config->get('config_language') == 'en') {

}
This is the exception to the rule on lookups. It used to be (and should still be) $this->language->getCode() but was changed for no good reason in more recent versions
Thx Q...u really really help me... ;)

New member

Posts

Joined
Mon Aug 31, 2009 2:03 pm
Who is online

Users browsing this forum: Bing [Bot] and 32 guests