Asked 2 years ago
10 Jun 2021
Views 274
Jules

Jules posted

override {} in Prestashop or smarty

how to override {} in Prestashop or smarty

i added some schema at header.tpl for home page

"potentialAction":
   {
   "@type": "SearchAction",
   "target": "https://website.com/?controller=search&search_query={search_term_string}",
   "query": "required",
   "query-input":"required name=search_term_string"
   }


but it generate the error because {search_term_string} , because smarty or prestashop try to acess constant or variable for {search_term_string}
so we need to override {} some how so it display {search_term_string} as it is
jignesh

jignesh
answered Jun 10 '21 00:00

use literal tag , {literal} tags allow a block of data to be taken literally means in between the {literal}{/literal} tags is not interpreted,


"potentialAction":
   {
   "@type": "SearchAction",
   "target": "https://website.com/?controller=search&search_query={literal}{search_term_string}{/literal}",
   "query": "required",
   "query-input":"required name=search_term_string"
   }

Post Answer