Is there a way in smarty to get array element, if key ends with “_description_name”?
E.g to do this in jquery it would be: [array$=”_description_name”]
Example:
[index] => Array
(
[language_id] => Array
(
[1] => Array
(
[language_id] => Array
(
[name] => language_id
[value] => 1
[fvalue] => 1
)
[extra_description_name] => Array
(
[name] => extra_description_name
[value] => Paint Colours
)
I want to get the text “Paint Colours”, without the “extra_”. So I want the same code to work if this was change to product_description_name.
I see this working in 2 parts:
1. {assign var="name" value=$index.language_id[1]|endsWith:'_description_name'}
2. {if $name.value}{$name.value}{/if}
But the endWith doesn’t exist
You might be able to try
{...|preg_match:'/_description_name$/'}