Hello I’d like to assign a variable in a template file from prestashop with smarty.
How can I do this?
I have following code so far:
{$db = DB::getInstance()}
{$id_lang = Context::getContext()->language->id}
{$sql = 'SELECT value FROM ps_feature_value_lang WHERE id_feature_value = 29 AND id_lang = $id_lang'} <- this is not working
It doesn’t work because the variable is inside the quotes. You need to concatenate the string with the variable.
Not tested, but it should be something like that: