{"id":71512,"date":"2017-01-13T17:11:03","date_gmt":"2017-01-13T17:11:03","guid":{"rendered":"http:\/\/webkul.com\/blog\/?p=71512"},"modified":"2023-04-26T04:46:42","modified_gmt":"2023-04-26T04:46:42","slug":"show-module-data-front-layout-opencart","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/show-module-data-front-layout-opencart\/","title":{"rendered":"Show module data at front layout in Opencart"},"content":{"rendered":"\n<p>In our <a href=\"http:\/\/webkul.com\/blog\/create-first-basic-module-opencart\/\">previous blog<\/a>, we learned to build a&nbsp;module in the Opencart. Now, we will learn about saving the values in the module configuration and show them in the front end by putting them on some layout (like account page, product page, home page etc).<\/p>\n\n\n\n<p>So, in order to start, we need to make a module like we did <a href=\"http:\/\/webkul.com\/blog\/create-first-basic-module-opencart\/\">here<\/a>. Now, I&#8217;ve added two more fields to get the heading and description of the content to be shown at the front end.<\/p>\n\n\n\n<p>I&#8217;ve created a language file named &#8216;side_layout.php&#8217; in admin-&gt;language-&gt;en-gb-&gt;module (Opencart version 2.2.0.0). The code for language file is here:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted brush:php\">&lt;?php\n\/**\n * Webkul Software.\n *\n * @category Webkul\n * @package Opencart Module Tutorial\n * @author Webkul\n * @copyright Copyright (c) Webkul Software Private Limited (https:\/\/webkul.com)\n * @license https:\/\/store.webkul.com\/license.html\n *\/\n\/\/ Heading\n$_['heading_title']     = 'Side Layout';\n\n$_['text_module']       = 'Modules';\n$_['text_success']      = 'Success: You have modified side layout module!';\n$_['text_edit']         = 'Edit Side Layout Module';\n\n\/\/ Entry\n$_['entry_status']      = 'Status';\n$_['entry_heading']     = 'Panel Heading';\n$_['entry_description'] = 'Panel Description';\n\n\/\/ Error\n$_['error_permission']  = 'Warning: You do not have permission to modify side layout module!';<\/pre>\n\n\n\n<p>Now, I&#8217;ve created a file name &#8216;side_layout.php&#8217; in admin-&gt;controller-&gt;module (Opencart version 2.2.0.0). Here&#8217;s the code for controller file:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted brush:php\">&lt;?php\n\/**\n * Webkul Software.\n *\n * @category Webkul\n * @package Opencart Module Tutorial\n * @author Webkul\n * @copyright Copyright (c) Webkul Software Private Limited (https:\/\/webkul.com)\n * @license https:\/\/store.webkul.com\/license.html\n *\/\nclass ControllerModuleSidelayout extends Controller {\n\tprivate $error = array();\n\n\tpublic function index() {\n\t\t$this-&gt;load-&gt;language('module\/side_layout');\n\n\t\t$this-&gt;document-&gt;setTitle($this-&gt;language-&gt;get('heading_title'));\n\n\t\t$this-&gt;load-&gt;model('setting\/setting');\n\n\t\tif (($this-&gt;request-&gt;server['REQUEST_METHOD'] == 'POST') &amp;&amp; $this-&gt;validate()) {\n\t\t\t$this-&gt;model_setting_setting-&gt;editSetting('side_layout', $this-&gt;request-&gt;post);\n\n\t\t\t$this-&gt;session-&gt;data['success'] = $this-&gt;language-&gt;get('text_success');\n\n\t\t\t$this-&gt;response-&gt;redirect($this-&gt;url-&gt;link('extension\/module', 'token=' . $this-&gt;session-&gt;data['token'], true));\n\t\t}\n\n\t\t$data['heading_title'] = $this-&gt;language-&gt;get('heading_title');\n\n\t\t$data['text_edit'] = $this-&gt;language-&gt;get('text_edit');\n\t\t$data['text_enabled'] = $this-&gt;language-&gt;get('text_enabled');\n\t\t$data['text_disabled'] = $this-&gt;language-&gt;get('text_disabled');\n\n\t\t$data['entry_status'] = $this-&gt;language-&gt;get('entry_status');\n\t\t$data['entry_heading'] = $this-&gt;language-&gt;get('entry_heading');\n\t\t$data['entry_description'] = $this-&gt;language-&gt;get('entry_description');\n\n\t\t$data['button_save'] = $this-&gt;language-&gt;get('button_save');\n\t\t$data['button_cancel'] = $this-&gt;language-&gt;get('button_cancel');\n\n\t\tif (isset($this-&gt;error['warning'])) {\n\t\t\t$data['error_warning'] = $this-&gt;error['warning'];\n\t\t} else {\n\t\t\t$data['error_warning'] = '';\n\t\t}\n\n\t\t$data['breadcrumbs'] = array();\n\n\t\t$data['breadcrumbs'][] = array(\n\t\t\t'text' =&gt; $this-&gt;language-&gt;get('text_home'),\n\t\t\t'href' =&gt; $this-&gt;url-&gt;link('common\/dashboard', 'token=' . $this-&gt;session-&gt;data['token'], true)\n\t\t);\n\n\t\t$data['breadcrumbs'][] = array(\n\t\t\t'text' =&gt; $this-&gt;language-&gt;get('text_module'),\n\t\t\t'href' =&gt; $this-&gt;url-&gt;link('extension\/module', 'token=' . $this-&gt;session-&gt;data['token'], true)\n\t\t);\n\n\t\t$data['breadcrumbs'][] = array(\n\t\t\t'text' =&gt; $this-&gt;language-&gt;get('heading_title'),\n\t\t\t'href' =&gt; $this-&gt;url-&gt;link('module\/side_layout', 'token=' . $this-&gt;session-&gt;data['token'], true)\n\t\t);\n\n\t\t$data['action'] = $this-&gt;url-&gt;link('module\/side_layout', 'token=' . $this-&gt;session-&gt;data['token'], true);\n\n\t\t$data['cancel'] = $this-&gt;url-&gt;link('extension\/module', 'token=' . $this-&gt;session-&gt;data['token'], true);\n\n\t\tif (isset($this-&gt;request-&gt;post['side_layout_status'])) {\n\t\t\t$data['side_layout_status'] = $this-&gt;request-&gt;post['side_layout_status'];\n\t\t} else {\n\t\t\t$data['side_layout_status'] = $this-&gt;config-&gt;get('side_layout_status');\n\t\t}\n\n\t\tif (isset($this-&gt;request-&gt;post['side_layout_heading'])) {\n\t\t\t$data['side_layout_heading'] = $this-&gt;request-&gt;post['side_layout_heading'];\n\t\t} else {\n\t\t\t$data['side_layout_heading'] = $this-&gt;config-&gt;get('side_layout_heading');\n\t\t}\n\n\t\tif (isset($this-&gt;request-&gt;post['side_layout_description'])) {\n\t\t\t$data['side_layout_description'] = $this-&gt;request-&gt;post['side_layout_description'];\n\t\t} else {\n\t\t\t$data['side_layout_description'] = $this-&gt;config-&gt;get('side_layout_description');\n\t\t}\n\n\t\t$data['header'] = $this-&gt;load-&gt;controller('common\/header');\n\t\t$data['column_left'] = $this-&gt;load-&gt;controller('common\/column_left');\n\t\t$data['footer'] = $this-&gt;load-&gt;controller('common\/footer');\n\n\t\t$this-&gt;response-&gt;setOutput($this-&gt;load-&gt;view('module\/side_layout', $data));\n\t}\n\n\tprotected function validate() {\n\t\tif (!$this-&gt;user-&gt;hasPermission('modify', 'module\/side_layout')) {\n\t\t\t$this-&gt;error['warning'] = $this-&gt;language-&gt;get('error_permission');\n\t\t}\n\n\t\treturn !$this-&gt;error;\n\t}\n}<\/pre>\n\n\n\n<p>A file is created with the name &#8216;side_layout.tpl&#8217; in admin-&gt;view-&gt;template-&gt;module. The code for that file is here:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted brush:php\">&lt;?php echo $header; ?&gt;&lt;?php echo $column_left; ?&gt;\n&lt;div id=\"content\"&gt;\n  &lt;div class=\"page-header\"&gt;\n    &lt;div class=\"container-fluid\"&gt;\n      &lt;div class=\"pull-right\"&gt;\n        &lt;button type=\"submit\" form=\"form-side-layout\" data-toggle=\"tooltip\" title=\"&lt;?php echo $button_save; ?&gt;\" class=\"btn btn-primary\"&gt;&lt;i class=\"fa fa-save\"&gt;&lt;\/i&gt;&lt;\/button&gt;\n        &lt;a href=\"&lt;?php echo $cancel; ?&gt;\" data-toggle=\"tooltip\" title=\"&lt;?php echo $button_cancel; ?&gt;\" class=\"btn btn-default\"&gt;&lt;i class=\"fa fa-reply\"&gt;&lt;\/i&gt;&lt;\/a&gt;&lt;\/div&gt;\n      &lt;h1&gt;&lt;?php echo $heading_title; ?&gt;&lt;\/h1&gt;\n      &lt;ul class=\"breadcrumb\"&gt;\n        &lt;?php foreach ($breadcrumbs as $breadcrumb) { ?&gt;\n        &lt;li&gt;&lt;a href=\"&lt;?php echo $breadcrumb['href']; ?&gt;\"&gt;&lt;?php echo $breadcrumb['text']; ?&gt;&lt;\/a&gt;&lt;\/li&gt;\n        &lt;?php } ?&gt;\n      &lt;\/ul&gt;\n    &lt;\/div&gt;\n  &lt;\/div&gt;\n  &lt;div class=\"container-fluid\"&gt;\n    &lt;?php if ($error_warning) { ?&gt;\n    &lt;div class=\"alert alert-danger\"&gt;&lt;i class=\"fa fa-exclamation-circle\"&gt;&lt;\/i&gt; &lt;?php echo $error_warning; ?&gt;\n      &lt;button type=\"button\" class=\"close\" data-dismiss=\"alert\"&gt;&amp;times;&lt;\/button&gt;\n    &lt;\/div&gt;\n    &lt;?php } ?&gt;\n    &lt;div class=\"panel panel-default\"&gt;\n      &lt;div class=\"panel-heading\"&gt;\n        &lt;h3 class=\"panel-title\"&gt;&lt;i class=\"fa fa-pencil\"&gt;&lt;\/i&gt; &lt;?php echo $text_edit; ?&gt;&lt;\/h3&gt;\n      &lt;\/div&gt;\n      &lt;div class=\"panel-body\"&gt;\n        &lt;form action=\"&lt;?php echo $action; ?&gt;\" method=\"post\" enctype=\"multipart\/form-data\" id=\"form-side-layout\" class=\"form-horizontal\"&gt;\n          &lt;div class=\"form-group\"&gt;\n            &lt;label class=\"col-sm-2 control-label\" for=\"input-status\"&gt;&lt;?php echo $entry_status; ?&gt;&lt;\/label&gt;\n            &lt;div class=\"col-sm-10\"&gt;\n              &lt;select name=\"side_layout_status\" id=\"input-status\" class=\"form-control\"&gt;\n                &lt;?php if ($side_layout_status) { ?&gt;\n                &lt;option value=\"1\" selected=\"selected\"&gt;&lt;?php echo $text_enabled; ?&gt;&lt;\/option&gt;\n                &lt;option value=\"0\"&gt;&lt;?php echo $text_disabled; ?&gt;&lt;\/option&gt;\n                &lt;?php } else { ?&gt;\n                &lt;option value=\"1\"&gt;&lt;?php echo $text_enabled; ?&gt;&lt;\/option&gt;\n                &lt;option value=\"0\" selected=\"selected\"&gt;&lt;?php echo $text_disabled; ?&gt;&lt;\/option&gt;\n                &lt;?php } ?&gt;\n              &lt;\/select&gt;\n            &lt;\/div&gt;\n          &lt;\/div&gt;\n          &lt;div class=\"form-group\"&gt;\n            &lt;label class=\"col-sm-2 control-label\" for=\"input-heading\"&gt;&lt;?php echo $entry_heading; ?&gt;&lt;\/label&gt;\n            &lt;div class=\"col-sm-10\"&gt;\n              &lt;input type=\"text\" name=\"side_layout_heading\" id=\"input-heading\" class=\"form-control\" value=\"&lt;?php echo $side_layout_heading; ?&gt;\" placeholder=\"&lt;?php echo $entry_heading; ?&gt;\"&gt;\n            &lt;\/div&gt;\n          &lt;\/div&gt;\n          &lt;div class=\"form-group\"&gt;\n            &lt;label class=\"col-sm-2 control-label\" for=\"input-description\"&gt;&lt;?php echo $entry_description; ?&gt;&lt;\/label&gt;\n            &lt;div class=\"col-sm-10\"&gt;\n              &lt;textarea name=\"side_layout_description\" id=\"input-description\" class=\"form-control\" placeholder=\"&lt;?php echo $entry_description; ?&gt;\"&gt;&lt;?php echo $side_layout_description; ?&gt;&lt;\/textarea&gt;\n            &lt;\/div&gt;\n          &lt;\/div&gt;\n        &lt;\/form&gt;\n      &lt;\/div&gt;\n    &lt;\/div&gt;\n  &lt;\/div&gt;\n&lt;\/div&gt;\n&lt;?php echo $footer; ?&gt;<\/pre>\n\n\n\n<p>In order to&nbsp;use this module to show its content in the front, we have to build a controller in catalog-&gt;controller-&gt;module with the same name as we made in the backend i.e. &#8216;side_layout.php&#8217;.<\/p>\n\n\n\n<p>Here&#8217;s the code for that controller:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted brush:php\">&lt;?php\n\/**\n * Webkul Software.\n *\n * @category Webkul\n * @package Opencart Module Tutorial\n * @author Webkul\n * @copyright Copyright (c) Webkul Software Private Limited (https:\/\/webkul.com)\n * @license https:\/\/store.webkul.com\/license.html\n *\/\nclass ControllerModuleSidelayout extends Controller {\n\tpublic function index() {\n\t\t\/**\n\t\t * In order to get the value from the backend, we will use $this-&gt;config-&gt;get()\n\t\t * The argument passed in the get method must be same as the name of field we used in the admin end\n\t\t *\/\n\t\t$data['side_layout_heading'] = $this-&gt;config-&gt;get('side_layout_heading');\n\t\t$data['side_layout_description'] = $this-&gt;config-&gt;get('side_layout_description');\n\n\t\treturn $this-&gt;load-&gt;view('module\/side_layout', $data);\n\t}\n}<\/pre>\n\n\n\n<p>We are using a .tpl file to show the content in the HTML tags. So, we will create a file named &#8216;side_layout.tpl&#8217; in catalog-&gt;view-&gt;theme-&gt;default-&gt;template-&gt;module. The code is as here:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted brush:php\">&lt;div class=\"panel panel-default\"&gt;\n\t&lt;div class=\"panel-heading\"&gt;&lt;h3 class=\"panel-title\"&gt;&lt;?php echo $side_layout_heading; ?&gt;&lt;\/h3&gt;&lt;\/div&gt;\n\t&lt;div class=\"panel-body\"&gt;\n\t\t&lt;strong&gt;&lt;?php echo $side_layout_description; ?&gt;&lt;\/strong&gt;\n\t&lt;\/div&gt;\n&lt;\/div&gt;<\/pre>\n\n\n\n<p>Now, after doing this, we&nbsp;have to set the module on some layout. Here, I&#8217;m setting the module&nbsp;on the checkout page. So, for doing that, go to the admin panel and head towards Design-&gt;Layouts. From the layouts list, edit the checkout and select the &#8216;Side Layout&#8217; from the module list and set to your preferred position. I&#8217;ve set it on &#8216;Column Right&#8217; position. See the image.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"alignleft\"><img decoding=\"async\" width=\"1058\" height=\"574\" src=\"http:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/01\/Screenshot_1-1.png\" alt=\"layout edit\" class=\"wp-image-71556\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/01\/Screenshot_1-1.png 1058w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/01\/Screenshot_1-1-250x136.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/01\/Screenshot_1-1-300x163.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/01\/Screenshot_1-1-768x417.png 768w\" sizes=\"(max-width: 1058px) 100vw, 1058px\" loading=\"lazy\" \/><\/figure>\n<\/div>\n\n\n<p>This will&nbsp;look like this in the front end on the&nbsp;checkout page. See image.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"alignleft\"><img decoding=\"async\" width=\"1245\" height=\"535\" src=\"http:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/01\/Screenshot_2-1.png\" alt=\"shipping details\" class=\"wp-image-71557\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/01\/Screenshot_2-1.png 1245w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/01\/Screenshot_2-1-250x107.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/01\/Screenshot_2-1-300x129.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/01\/Screenshot_2-1-768x330.png 768w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/01\/Screenshot_2-1-1200x516.png 1200w\" sizes=\"(max-width: 1245px) 100vw, 1245px\" loading=\"lazy\" \/><\/figure>\n<\/div>\n\n\n<p>Whatever entries\/values you will provide in the backend will be visible in the front-end module. Hope, you learned from this. In the case of any query, just comment.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In our previous blog, we learned to build a&nbsp;module in the Opencart. Now, we will learn about saving the values in the module configuration and show them in the front end by putting them on some layout (like account page, product page, home page etc). So, in order to start, we need to make a <a href=\"https:\/\/webkul.com\/blog\/show-module-data-front-layout-opencart\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":70,"featured_media":41008,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[305],"tags":[256,2059,2071],"class_list":["post-71512","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-opencart","tag-layout","tag-module","tag-opencart"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Show module data at front layout in Opencart - Webkul Blog<\/title>\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\/show-module-data-front-layout-opencart\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Show module data at front layout in Opencart - Webkul Blog\" \/>\n<meta property=\"og:description\" content=\"In our previous blog, we learned to build a&nbsp;module in the Opencart. Now, we will learn about saving the values in the module configuration and show them in the front end by putting them on some layout (like account page, product page, home page etc). So, in order to start, we need to make a [...]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/show-module-data-front-layout-opencart\/\" \/>\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=\"2017-01-13T17:11:03+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-04-26T04:46:42+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/02\/Opencart-Code-Snippet.png\" \/>\n\t<meta property=\"og:image:width\" content=\"825\" \/>\n\t<meta property=\"og:image:height\" content=\"260\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Vikhyat Sharma\" \/>\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=\"Vikhyat Sharma\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/webkul.com\/blog\/show-module-data-front-layout-opencart\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/show-module-data-front-layout-opencart\/\"},\"author\":{\"name\":\"Vikhyat Sharma\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/af7160d2546c64a1856ab1b5ce77d9b0\"},\"headline\":\"Show module data at front layout in Opencart\",\"datePublished\":\"2017-01-13T17:11:03+00:00\",\"dateModified\":\"2023-04-26T04:46:42+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/show-module-data-front-layout-opencart\/\"},\"wordCount\":371,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/show-module-data-front-layout-opencart\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/02\/Opencart-Code-Snippet.png\",\"keywords\":[\"layout\",\"module\",\"opencart\"],\"articleSection\":[\"opencart\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/show-module-data-front-layout-opencart\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/show-module-data-front-layout-opencart\/\",\"url\":\"https:\/\/webkul.com\/blog\/show-module-data-front-layout-opencart\/\",\"name\":\"Show module data at front layout in Opencart - Webkul Blog\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/show-module-data-front-layout-opencart\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/show-module-data-front-layout-opencart\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/02\/Opencart-Code-Snippet.png\",\"datePublished\":\"2017-01-13T17:11:03+00:00\",\"dateModified\":\"2023-04-26T04:46:42+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/show-module-data-front-layout-opencart\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/show-module-data-front-layout-opencart\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/show-module-data-front-layout-opencart\/#primaryimage\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/02\/Opencart-Code-Snippet.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/02\/Opencart-Code-Snippet.png\",\"width\":825,\"height\":260},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/show-module-data-front-layout-opencart\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Show module data at front layout in Opencart\"}]},{\"@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\/af7160d2546c64a1856ab1b5ce77d9b0\",\"name\":\"Vikhyat Sharma\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/7c9c700cc2d7120c9faf1ab3392b4e533808ba197f58c0441d6caecc68179e12?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\/7c9c700cc2d7120c9faf1ab3392b4e533808ba197f58c0441d6caecc68179e12?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"caption\":\"Vikhyat Sharma\"},\"url\":\"https:\/\/webkul.com\/blog\/author\/vikhyat-sharma83\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Show module data at front layout in Opencart - Webkul Blog","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\/show-module-data-front-layout-opencart\/","og_locale":"en_US","og_type":"article","og_title":"Show module data at front layout in Opencart - Webkul Blog","og_description":"In our previous blog, we learned to build a&nbsp;module in the Opencart. Now, we will learn about saving the values in the module configuration and show them in the front end by putting them on some layout (like account page, product page, home page etc). So, in order to start, we need to make a [...]","og_url":"https:\/\/webkul.com\/blog\/show-module-data-front-layout-opencart\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2017-01-13T17:11:03+00:00","article_modified_time":"2023-04-26T04:46:42+00:00","og_image":[{"width":825,"height":260,"url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/02\/Opencart-Code-Snippet.png","type":"image\/png"}],"author":"Vikhyat Sharma","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Vikhyat Sharma","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/show-module-data-front-layout-opencart\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/show-module-data-front-layout-opencart\/"},"author":{"name":"Vikhyat Sharma","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/af7160d2546c64a1856ab1b5ce77d9b0"},"headline":"Show module data at front layout in Opencart","datePublished":"2017-01-13T17:11:03+00:00","dateModified":"2023-04-26T04:46:42+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/show-module-data-front-layout-opencart\/"},"wordCount":371,"commentCount":0,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"image":{"@id":"https:\/\/webkul.com\/blog\/show-module-data-front-layout-opencart\/#primaryimage"},"thumbnailUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/02\/Opencart-Code-Snippet.png","keywords":["layout","module","opencart"],"articleSection":["opencart"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/show-module-data-front-layout-opencart\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/show-module-data-front-layout-opencart\/","url":"https:\/\/webkul.com\/blog\/show-module-data-front-layout-opencart\/","name":"Show module data at front layout in Opencart - Webkul Blog","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/webkul.com\/blog\/show-module-data-front-layout-opencart\/#primaryimage"},"image":{"@id":"https:\/\/webkul.com\/blog\/show-module-data-front-layout-opencart\/#primaryimage"},"thumbnailUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/02\/Opencart-Code-Snippet.png","datePublished":"2017-01-13T17:11:03+00:00","dateModified":"2023-04-26T04:46:42+00:00","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/show-module-data-front-layout-opencart\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/show-module-data-front-layout-opencart\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/show-module-data-front-layout-opencart\/#primaryimage","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/02\/Opencart-Code-Snippet.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/02\/Opencart-Code-Snippet.png","width":825,"height":260},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/show-module-data-front-layout-opencart\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Show module data at front layout in Opencart"}]},{"@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\/af7160d2546c64a1856ab1b5ce77d9b0","name":"Vikhyat Sharma","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/7c9c700cc2d7120c9faf1ab3392b4e533808ba197f58c0441d6caecc68179e12?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\/7c9c700cc2d7120c9faf1ab3392b4e533808ba197f58c0441d6caecc68179e12?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","caption":"Vikhyat Sharma"},"url":"https:\/\/webkul.com\/blog\/author\/vikhyat-sharma83\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/71512","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\/70"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=71512"}],"version-history":[{"count":5,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/71512\/revisions"}],"predecessor-version":[{"id":378254,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/71512\/revisions\/378254"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media\/41008"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=71512"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=71512"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=71512"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}