Pages

Monday, February 7, 2011

How to create page in the zencart?

1. write define(‘FILENAME_DEFINE_YOURPAGENAME’, ‘define_yourpagename’); in the "includes\filenames.php"

2. create language file

\includes\languages\english\yourpagename.php



3. create a page in this directory
\includes\languages\english\html_includes\define_yourpagename.php

Its not necessary but If you want to use this page as define pages in this case you must create this page

4. create a folder and page in this directory (directory name is 'yourpagename')

\includes\modules\pages\yourpagename\header.php

in this page write below code
notify('NOTIFY_HEADER_START_SITE_MAP');
/**
* load language files
*/
require(DIR_WS_MODULES . zen_get_module_directory('require_languages.php'));
$breadcrumb->add(NAVBAR_TITLE);
// include template specific file name defines
$define_page = zen_get_file_directory(DIR_WS_LANGUAGES . $_SESSION['language'] . '/html_includes/', FILENAME_DEFINE_YOURPAGENAME, 'false');

?>

5. create a page

\includes\templates\template_default\templates\tpl_yourpagename_default.php

in this page write your content.

If you want to use this page as define page you can use below code.

You can edit define page content from 'Admin Panel >> Tools >> Define page editor'