{"id":363583,"date":"2023-01-18T11:03:03","date_gmt":"2023-01-18T11:03:03","guid":{"rendered":"https:\/\/webkul.com\/blog\/?p=363583"},"modified":"2023-01-18T11:03:11","modified_gmt":"2023-01-18T11:03:11","slug":"register-own-smarty-helper-plugin-in-prestashop","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/register-own-smarty-helper-plugin-in-prestashop\/","title":{"rendered":"Register your own smarty helper plugin in PrestaShop"},"content":{"rendered":"\n<p>In this blog, we are going to learn how to register your own smarty helper plugin in PrestaShop. PrestaShop uses a <a href=\"https:\/\/www.smarty.net\/about_smarty\" target=\"_blank\" rel=\"noreferrer noopener\">Smarty<\/a> template engine for the view section. Smarty is open source and provides flexibility for custom development.<\/p>\n\n\n\n<p>PrestaShop has already registered its own helper plugin like <code>displayPrice<\/code>, <code>convertPrice<\/code>, <code>displayWtPrice<\/code>, etc. <\/p>\n\n\n\n<p>We can directly use it in our smarty file. <\/p>\n\n\n\n<p><strong>For example:<\/strong><\/p>\n\n\n\n<p><code>{displayPrice price=$price currency=$id_currency}<\/code><\/p>\n\n\n\n<p>We will learn how to create and register our own smarty helper plugin. <\/p>\n\n\n\n<p>Smarty provides a method <code><a href=\"https:\/\/www.smarty.net\/docs\/en\/api.register.plugin.tpl\" target=\"_blank\" rel=\"noreferrer noopener\">registerPlugin()<\/a><\/code> which provides the facility to register plugins dynamically. But this method is not directly available in our module, PrestaShop has an alternative function <code>smartyRegisterFunction<\/code> that is available globally.<\/p>\n\n\n\n<p>This function takes 6 parameters:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><strong>Parameter<\/strong><\/td><td><strong>Required<\/strong><\/td><td><strong>Description<\/strong><\/td><\/tr><tr><td><code>$smarty<\/code><\/td><td>Yes<\/td><td>Pass smarty object (ie: <code>$this-&gt;context-&gt;smarty<\/code>)<\/td><\/tr><tr><td><code>$type<\/code><\/td><td>Yes<\/td><td>Plugin type: function, modifier, or block<\/td><\/tr><tr><td><code>$function<\/code><\/td><td>Yes<\/td><td>Your function name<\/td><\/tr><tr><td><code>$params<\/code><\/td><td>Yes<\/td><td>Array of parameters<\/td><\/tr><tr><td><code>$lazy<\/code><\/td><td>No<\/td><td>Pass as <code>true<\/code> if the function is not called on every page<\/td><\/tr><tr><td><code>$initial_lazy_register<\/code><\/td><td>No<\/td><td>Allows to only load external classes when they are needed<\/td><\/tr><\/tbody><\/table><figcaption class=\"wp-element-caption\">&#8220;smartyRegisterFunction&#8221; parameters description<\/figcaption><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Types of plugins in PrestaShop:<\/h3>\n\n\n\n<p>There are 3 plugins in the PrestaShop:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Function<\/li>\n\n\n\n<li>Modifier<\/li>\n\n\n\n<li>Block<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">Function plugin:<\/h4>\n\n\n\n<p>All attributes passed to template functions from the template are contained in the <code>$params<\/code> as an associative array.<\/p>\n\n\n\n<p><strong>ie:<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">smartyRegisterFunction(\n    $this-&gt;context-&gt;smarty,\n    &#039;function&#039;,\n    &#039;displayProductQuantity&#039;,\n    &#091;\n        &#039;WkTestClass&#039;,\n        &#039;displayProductQuantity&#039;\n    ]\n);<\/pre>\n\n\n\n<p>Create a <code>WkTestClass<\/code> and create a static method <code>displayProductQuantity<\/code>:<\/p>\n\n\n\n<p><strong>ie:<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">class WkTestClass\n{\n    public static function displayProductQuantity($params)\n    {\n        if (!$params&#091;&#039;id_product&#039;]) {\n            return false;\n        }\n\n        return StockAvailable::getQuantityAvailableByProduct((int)$params&#091;&#039;id_product&#039;]);\n    }\n}<\/pre>\n\n\n\n<p>Now, you can use this function in smarty like below:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">{displayProductQuantity id_product=&#039;1&#039;}  \/\/ Print available stock for product ID: 1<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Modifier plugin:<\/h4>\n\n\n\n<p>Modifiers are little functions that are applied to a variable in the template before it is displayed or used in some other context. Modifiers can be chained together.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">smartyRegisterFunction(\n    $this-&gt;context-&gt;smarty,\n    &#039;modifier&#039;,\n    &#039;removeSlashes&#039;,\n    &#091;\n        &#039;WkTestClass&#039;,\n        &#039;removeSlashesFromString&#039;\n    ]\n);<\/pre>\n\n\n\n<p>Create a <code>WkTestClass<\/code> and create a static method <code>removeSlashesFromString<\/code>:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">class WkTestClass\n{\n    public static function removeSlashesFromString($params)\n    {\n        if (!$params) {\n            return false;\n        }\n\n        return stripslashes($params);\n    }\n}<\/pre>\n\n\n\n<p>You can use this modifier in smarty like:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">{&quot;Who\\&#039;s Peter Griffin?&quot;|removeSlashes}  \/\/ Output: Who&#039;s Peter Griffin?<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Modifier plugin:<\/h4>\n\n\n\n<p>Block functions are functions of the form: <code>{func} .. {\/func}<\/code>. In other words, they enclose a template block and operate on the contents of this block.<\/p>\n\n\n\n<p><strong>ie:<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">smartyRegisterFunction(\n    $this-&gt;context-&gt;smarty,\n    &#039;block&#039;,\n    &#039;getFormattedProductInfo&#039;,\n    &#091;\n        &#039;WkTestClass&#039;,\n        &#039;getFormattedProductInfo&#039;\n    ]\n);<\/pre>\n\n\n\n<p>Create a <code>WkTestClass<\/code> and create a static method <code>getFormattedProductInfo<\/code>:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">public static function getFormattedProductInfo($params, $content, $smarty = null, &amp;$repeat = false)\n{\n    \/\/ only output on the closing tag\n    if (!$repeat &amp;&amp; isset($params) &amp;&amp; Tools::strlen($content)) {\n        $objProduct = new Product((int)$params&#091;&#039;id_product&#039;], false, (int)$params&#091;&#039;id_lang&#039;]);\n        echo sprintf(\n            $content,\n            $objProduct-&gt;name,\n            StockAvailable::getQuantityAvailableByProduct((int)$params&#091;&#039;id_product&#039;])\n        );\n    }\n}<\/pre>\n\n\n\n<p>You can use this block in smarty like:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">{getFormattedProductInfo id_product=&#039;1&#039; id_lang=&#039;1&#039;}\nThis product name is %s which current stock is %d.\n{\/getFormattedProductInfo}\n\n\/\/ Output: This product name is Hummingbird printed t-shirt which current stock is 2397.<\/pre>\n\n\n\n<p><strong>Note:<\/strong> In the block plugin, by default, the function <code>getFormattedProductInfo<\/code> is called twice by Smarty: once for the opening tag, and once for the closing tag. At the first call, the <code>$repeat<\/code> param value is <code>true<\/code> but the <code>$content<\/code> param is null that&#8217;s why I have checked for <code>$repeat<\/code> param value to <code>false<\/code> because at the second call, this value is <code>false<\/code> and the actual <code>$content<\/code> value exists.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"931\" height=\"399\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/01\/image-110.png\" alt=\"Smarty helper plugin example\" class=\"wp-image-365159\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/01\/image-110.png 931w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/01\/image-110-300x129.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/01\/image-110-250x107.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/01\/image-110-768x329.png 768w\" sizes=\"(max-width: 931px) 100vw, 931px\" loading=\"lazy\" \/><figcaption class=\"wp-element-caption\">Smarty helper plugin example<\/figcaption><\/figure>\n\n\n\n<p>That\u2019s all about this blog.<\/p>\n\n\n\n<p>If any issue or doubt please feel free to mention it in the comment section.<\/p>\n\n\n\n<p>I would be happy to help.<\/p>\n\n\n\n<p>Also, you can explore our\u00a0<a href=\"https:\/\/webkul.com\/prestashop-development\/\" target=\"_blank\" rel=\"noreferrer noopener\">PrestaShop Development Services<\/a>\u00a0&amp; a large range of quality\u00a0<a href=\"https:\/\/store.webkul.com\/PrestaShop-Extensions.html\" target=\"_blank\" rel=\"noreferrer noopener\">PrestaShop Modules<\/a>.<\/p>\n\n\n\n<p>For any doubt contact us at&nbsp;<a href=\"mailto:support@webkul.com\">support@webkul.com<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this blog, we are going to learn how to register your own smarty helper plugin in PrestaShop. PrestaShop uses a Smarty template engine for the view section. Smarty is open source and provides flexibility for custom development. PrestaShop has already registered its own helper plugin like displayPrice, convertPrice, displayWtPrice, etc. We can directly use <a href=\"https:\/\/webkul.com\/blog\/register-own-smarty-helper-plugin-in-prestashop\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":384,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[209],"tags":[2065,4448],"class_list":["post-363583","post","type-post","status-publish","format-standard","hentry","category-prestashop","tag-prestashop","tag-smarty"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Register your own smarty helper plugin in PrestaShop - Webkul Blog<\/title>\n<meta name=\"description\" content=\"Smarty is open source and provides flexibility for custom development. In this, I have explained how we can register our own smarty plugin.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/webkul.com\/blog\/register-own-smarty-helper-plugin-in-prestashop\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Register your own smarty helper plugin in PrestaShop - Webkul Blog\" \/>\n<meta property=\"og:description\" content=\"Smarty is open source and provides flexibility for custom development. In this, I have explained how we can register our own smarty plugin.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/register-own-smarty-helper-plugin-in-prestashop\/\" \/>\n<meta property=\"og:site_name\" content=\"Webkul Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webkul\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-01-18T11:03:03+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-01-18T11:03:11+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/01\/image-110.png\" \/>\n<meta name=\"author\" content=\"Ajeet Chauhan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webkul\" \/>\n<meta name=\"twitter:site\" content=\"@webkul\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ajeet Chauhan\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/webkul.com\/blog\/register-own-smarty-helper-plugin-in-prestashop\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/register-own-smarty-helper-plugin-in-prestashop\/\"},\"author\":{\"name\":\"Ajeet Chauhan\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/7eee8f48857441660231d6a643103357\"},\"headline\":\"Register your own smarty helper plugin in PrestaShop\",\"datePublished\":\"2023-01-18T11:03:03+00:00\",\"dateModified\":\"2023-01-18T11:03:11+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/register-own-smarty-helper-plugin-in-prestashop\/\"},\"wordCount\":419,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/register-own-smarty-helper-plugin-in-prestashop\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/01\/image-110.png\",\"keywords\":[\"prestashop\",\"smarty\"],\"articleSection\":[\"prestashop\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/register-own-smarty-helper-plugin-in-prestashop\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/register-own-smarty-helper-plugin-in-prestashop\/\",\"url\":\"https:\/\/webkul.com\/blog\/register-own-smarty-helper-plugin-in-prestashop\/\",\"name\":\"Register your own smarty helper plugin in PrestaShop - Webkul Blog\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/register-own-smarty-helper-plugin-in-prestashop\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/register-own-smarty-helper-plugin-in-prestashop\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/01\/image-110.png\",\"datePublished\":\"2023-01-18T11:03:03+00:00\",\"dateModified\":\"2023-01-18T11:03:11+00:00\",\"description\":\"Smarty is open source and provides flexibility for custom development. In this, I have explained how we can register our own smarty plugin.\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/register-own-smarty-helper-plugin-in-prestashop\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/register-own-smarty-helper-plugin-in-prestashop\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/register-own-smarty-helper-plugin-in-prestashop\/#primaryimage\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/01\/image-110.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/01\/image-110.png\",\"width\":931,\"height\":399,\"caption\":\"image-110\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/register-own-smarty-helper-plugin-in-prestashop\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Register your own smarty helper plugin in PrestaShop\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/webkul.com\/blog\/#website\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"name\":\"Webkul Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/webkul.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/webkul.com\/blog\/#organization\",\"name\":\"WebKul Software Private Limited\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"width\":380,\"height\":380,\"caption\":\"WebKul Software Private Limited\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webkul\/\",\"https:\/\/x.com\/webkul\",\"https:\/\/www.instagram.com\/webkul\/\",\"https:\/\/www.linkedin.com\/company\/webkul\",\"https:\/\/www.youtube.com\/user\/webkul\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/7eee8f48857441660231d6a643103357\",\"name\":\"Ajeet Chauhan\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/e97b5fe8122a2283f5fe35ae6fca4725ac46026413ce7959b575f842f6bd6c92?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/e97b5fe8122a2283f5fe35ae6fca4725ac46026413ce7959b575f842f6bd6c92?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"caption\":\"Ajeet Chauhan\"},\"description\":\"Ajeet is a talented Software Engineer specializing in the PrestaShop platform. With expertise in PrestaShop Shipping &amp; Payments Integration, Marketplace Development, and Headless services, he delivers innovative solutions that enhance eCommerce functionality, driving seamless operations for businesses and their customers.\",\"url\":\"https:\/\/webkul.com\/blog\/author\/ajeetchauhan-symfony143\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Register your own smarty helper plugin in PrestaShop - Webkul Blog","description":"Smarty is open source and provides flexibility for custom development. In this, I have explained how we can register our own smarty plugin.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/webkul.com\/blog\/register-own-smarty-helper-plugin-in-prestashop\/","og_locale":"en_US","og_type":"article","og_title":"Register your own smarty helper plugin in PrestaShop - Webkul Blog","og_description":"Smarty is open source and provides flexibility for custom development. In this, I have explained how we can register our own smarty plugin.","og_url":"https:\/\/webkul.com\/blog\/register-own-smarty-helper-plugin-in-prestashop\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2023-01-18T11:03:03+00:00","article_modified_time":"2023-01-18T11:03:11+00:00","og_image":[{"url":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/01\/image-110.png","type":"","width":"","height":""}],"author":"Ajeet Chauhan","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Ajeet Chauhan","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/register-own-smarty-helper-plugin-in-prestashop\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/register-own-smarty-helper-plugin-in-prestashop\/"},"author":{"name":"Ajeet Chauhan","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/7eee8f48857441660231d6a643103357"},"headline":"Register your own smarty helper plugin in PrestaShop","datePublished":"2023-01-18T11:03:03+00:00","dateModified":"2023-01-18T11:03:11+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/register-own-smarty-helper-plugin-in-prestashop\/"},"wordCount":419,"commentCount":0,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"image":{"@id":"https:\/\/webkul.com\/blog\/register-own-smarty-helper-plugin-in-prestashop\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/01\/image-110.png","keywords":["prestashop","smarty"],"articleSection":["prestashop"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/register-own-smarty-helper-plugin-in-prestashop\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/register-own-smarty-helper-plugin-in-prestashop\/","url":"https:\/\/webkul.com\/blog\/register-own-smarty-helper-plugin-in-prestashop\/","name":"Register your own smarty helper plugin in PrestaShop - Webkul Blog","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/webkul.com\/blog\/register-own-smarty-helper-plugin-in-prestashop\/#primaryimage"},"image":{"@id":"https:\/\/webkul.com\/blog\/register-own-smarty-helper-plugin-in-prestashop\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/01\/image-110.png","datePublished":"2023-01-18T11:03:03+00:00","dateModified":"2023-01-18T11:03:11+00:00","description":"Smarty is open source and provides flexibility for custom development. In this, I have explained how we can register our own smarty plugin.","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/register-own-smarty-helper-plugin-in-prestashop\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/register-own-smarty-helper-plugin-in-prestashop\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/register-own-smarty-helper-plugin-in-prestashop\/#primaryimage","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/01\/image-110.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/01\/image-110.png","width":931,"height":399,"caption":"image-110"},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/register-own-smarty-helper-plugin-in-prestashop\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Register your own smarty helper plugin in PrestaShop"}]},{"@type":"WebSite","@id":"https:\/\/webkul.com\/blog\/#website","url":"https:\/\/webkul.com\/blog\/","name":"Webkul Blog","description":"","publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webkul.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webkul.com\/blog\/#organization","name":"WebKul Software Private Limited","url":"https:\/\/webkul.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","width":380,"height":380,"caption":"WebKul Software Private Limited"},"image":{"@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webkul\/","https:\/\/x.com\/webkul","https:\/\/www.instagram.com\/webkul\/","https:\/\/www.linkedin.com\/company\/webkul","https:\/\/www.youtube.com\/user\/webkul\/"]},{"@type":"Person","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/7eee8f48857441660231d6a643103357","name":"Ajeet Chauhan","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/e97b5fe8122a2283f5fe35ae6fca4725ac46026413ce7959b575f842f6bd6c92?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/e97b5fe8122a2283f5fe35ae6fca4725ac46026413ce7959b575f842f6bd6c92?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","caption":"Ajeet Chauhan"},"description":"Ajeet is a talented Software Engineer specializing in the PrestaShop platform. With expertise in PrestaShop Shipping &amp; Payments Integration, Marketplace Development, and Headless services, he delivers innovative solutions that enhance eCommerce functionality, driving seamless operations for businesses and their customers.","url":"https:\/\/webkul.com\/blog\/author\/ajeetchauhan-symfony143\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/363583","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/users\/384"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=363583"}],"version-history":[{"count":19,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/363583\/revisions"}],"predecessor-version":[{"id":365167,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/363583\/revisions\/365167"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=363583"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=363583"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=363583"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}