Jump to content

Pick up a smarty variable with Helpers in a .php document


Recommended Posts

Hi all I am new to the forum,
For several weeks I play a little on Presta and I want to make a small personal Module.
So I use the online documentation. I am training on the small module proposed "mymodule." I wonder how do you retrieve smarty variables to display in my back office. Here so I have a .php page that works very well.
When picking the currency (in red in my example), the currency is not displayed. I tried different syntaxes, and then try to add the start of the global $ smarty function;
The idea is not to write "€ or $ ', but to recover the variable to be adapted according to the currency of the obviously shop.
If anyone can help me how one recovers these variables it would tip top because my Google search are not helpfull or must doing something wrong. Thank you :)


public function displayForm()
{ global $smarty;
$default_lang = (int)Configuration::get('PS_LANG_DEFAULT');
    // Init Fields form array
    $fields_form[0]['form'] = array(
        'legend' => array(
            'title' => $this->l('Settings'),
'icon' => 'icon-cogs',
        'input' => array(
                'type' => 'text',
                'label' => $this->l('Configuration value'),
                'name' => 'MYMODULE_NAME',
                'size' => 20,
                'prefix' => Tools::getValue($id_currency),
                'required' => true


Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...