{"id":703,"date":"2014-03-30T00:04:08","date_gmt":"2014-03-30T00:04:08","guid":{"rendered":"http:\/\/www.advancedwebhelp.com\/blog\/?p=703"},"modified":"2014-03-30T00:04:08","modified_gmt":"2014-03-30T00:04:08","slug":"5-steps-to-adding-sidebar-block-in-zen-cart","status":"publish","type":"post","link":"https:\/\/www.advancedwebhelp.com\/blog\/2014\/5-steps-to-adding-sidebar-block-in-zen-cart","title":{"rendered":"5 Steps to Adding Sidebar Block in Zen-Cart"},"content":{"rendered":"<p>You may find that you want to add a block to the sidebar in Zen-Cart.  The content may be text, image, or other feature to extend the content on the cart.   The generic concept of adding a block involves 5 steps. This article explains the steps.  For simplicity, we will only add a text block. <\/p>\n<h2>Step 1; Create Sidebox Template<\/h2>\n<p>Add a new file to the server in the following directory: \/includes\/templates\/&lt;template-name&gt;\/sideboxes\/. Name the file something relating to the contents of the sidebox. We will be adding a support phone number to call in a sidebox, so, we might name the file tpl_support_number.php. The file will include what you want to display in the box and will be assigned to the variable $content variable. Below is an example of the contents of the file.<\/p>\n<p><code><\/p>\n<pre>\r\n\r\n  &lt;?php\r\n     \/* Side Box Template  *\/\r\n     $content = \"For information about products or services, call (888) 555-1212\" ;\r\n  ?&gt;\r\n\r\n<\/pre>\n<p><\/code><\/p>\n<h2 style=\"padding-top: 20px ;\">Step 2; Create Sidebox<\/h2>\n<p>Now, to create the actual box; add a new file to the server in the following directory: \/includes\/modules&lt;template-name&gt;\/sideboxes. Name the file something relating to the contents of the sidebox.  In our sample, we will call it support_number.php. The contents of this file will look like the sample below, but, modify the variables to relate to your template. <\/p>\n<p><code><\/p>\n<pre>\r\n\r\n  &lt;?php\r\n  \/**\r\n   *  Support Number Sidebox - used to display a support message \r\n   *  in a sidebox.\r\n   *\r\n   *\/\r\n   $show_message = true ;\r\n   if ($show_message == true) {\r\n       require(\r\n         $template->get_template_dir('tpl_support_number.php', \r\n            DIR_WS_TEMPLATE, $current_page_base,\r\n           'sideboxes') . '\/tpl_support_number.php');\r\n       $title = BOX_HEADING_SUPPORT_NUMBER ;\r\n       $title_link = false;\r\n       require($template->get_template_dir($column_box_default, \r\n           DIR_WS_TEMPLATE, $current_page_base,'common') . '\/' . \r\n           $column_box_default);\r\n   }\r\n  ?&gt;\r\n\r\n<\/pre>\n<p><\/code><\/p>\n<h2 style=\"padding-top: 20px ;\">Step 3; Add Language Variables<\/h2>\n<p>Modify the english.php language file in \/includes\/languages\/ to include the definitions for any text variables you have used in either file. In this example we created a new variable called BOX_HEADING_SUPPORT_NUMBER. So, we will add the following to the english.php file.<\/p>\n<p><code><\/p>\n<pre>\r\n\r\n  \/\/ welcome box text in sideboxes\/welcome.php\r\n  define('BOX_HEADING_SUPPORT_NUMBER', 'SUPPORT INFO');\r\n\r\n<\/pre>\n<p><\/code><\/p>\n<h2 style=\"padding-top: 20px ;\">Step 4; Enable Sidebox:<\/h2>\n<p>Activate the sidebox as follows:<\/p>\n<ul>\n<li>Login into Zen-Cart administration.<\/li>\n<li>Hover over Tools.<\/li>\n<li>Select \u201cLayout Boxes Controller\u201d from the drop down, a list of boxes will appear &#8230;&nbsp; including your new box <\/li>\n<li>Double-click the name of the new box you have created, in this sample, it will say &#8230;&nbsp; sideboxes\/<template-name>\/support_number.php. In the upper right of the window you will see fields that you can edit.<\/li>\n<li>Select to edit the information, an editable form will appear<\/li>\n<li>Fill in the form,  by:\n<ul>\n<li>Selecting the radio button next to &#8220;on&#8221; in \u201cLeft\/Right Column Status\u201d <\/li>\n<li>Selecting the radio button to place the box on the &#8220;left&#8221; or &#8220;right&#8221; sidebar<\/li>\n<li>Typing the correct number is the sort order field to display the box<\/li>\n<li>and then clicking the Update button.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>The sidebox is now enabled on the site<\/p>\n<h2>Step 5; Verify Sidebox:<\/h2>\n<p>Now, visit your  store in a browser and make certain the sidebox displays.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>You may find that you want to add a block to the sidebar in Zen-Cart. The content may be text, image, or other feature to extend the content on the cart. The generic concept of adding a block involves 5 steps. This article explains the steps. For simplicity, we will only add a text block. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,10],"tags":[],"class_list":["post-703","post","type-post","status-publish","format-standard","hentry","category-php","category-zen-cart"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.advancedwebhelp.com\/blog\/wp-json\/wp\/v2\/posts\/703","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.advancedwebhelp.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.advancedwebhelp.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.advancedwebhelp.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.advancedwebhelp.com\/blog\/wp-json\/wp\/v2\/comments?post=703"}],"version-history":[{"count":2,"href":"https:\/\/www.advancedwebhelp.com\/blog\/wp-json\/wp\/v2\/posts\/703\/revisions"}],"predecessor-version":[{"id":713,"href":"https:\/\/www.advancedwebhelp.com\/blog\/wp-json\/wp\/v2\/posts\/703\/revisions\/713"}],"wp:attachment":[{"href":"https:\/\/www.advancedwebhelp.com\/blog\/wp-json\/wp\/v2\/media?parent=703"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.advancedwebhelp.com\/blog\/wp-json\/wp\/v2\/categories?post=703"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.advancedwebhelp.com\/blog\/wp-json\/wp\/v2\/tags?post=703"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}