Archive for the ‘Zen Cart’ Category
Adding Page to Zen Cart 1.3.8
September 5th, 2008 Posted 8:31 pm
create your html includes file – it is a blank file named define_shopping_cart.php
upload that to your includes/language/english/html_includes and to includes/language/english/html_includes/your folder.
Edit includes/modules/pages/shopping_cart/header.php.php. Add this line
// include template specific file name defines
$define_page = zen_get_file_directory(DIR_WS_LANGUAGES . $_SESSION['language'] . ‘/html_includes/’, FILENAME_DEFINE_SHOPPING_CART, ‘false’);
before
// This should be last line of the script:
$zco_notifier->notify(‘NOTIFY_HEADER_END_SHOPPING_CART’);
———————
Edit includes/filenames.php – add
define(‘FILENAME_DEFINE_SHOPPING_CART’, ‘define_shopping_cart’);
be nice to yourself and put it in alphabetically- line 68
OR
includes/extra_datafiles/define_shopping_cart_filenames.php
with at least this in it
<?php
define(‘FILENAME_DEFINE_SHOPPING_CART’, ‘define_shopping_cart’);
?>
————————
Edit includes/templates/your folder/templates/tpl_shopping_cart_default.php.
line 33
Replace <?php echo TEXT_INFORMATION ?> with <?php echo define_page ?>
Posted in Zen Cart
Zen Cart Cheat Sheet
September 5th, 2008 Posted 8:28 pm
Remove number of sub-categories :
Admin -> Config -> My Store -> Show Category Counts Set to false
Remove the -> (arrow sign) from sub categories:
admin -> configuration -> layout setting – > categories separator.
Remove Sidebox Header :
#categoriesHeading {
display: none;
}
New products box-2 columns instead of 3:
admin -> configuration -> Index listing -> New Products Columns per Row
Image with no borders : img {border: none;}
Zen_image with Align : zen_image(DIR_WS_CATALOG_IMAGES . PRODUCTS_IMAGE_NO_IMAGE, $pInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, ‘align=”right” hspace=”5″ vspace=”5″‘)
Adding ID to zen_draw_input_field
zen_draw_input_field(‘fax’, ”, ‘id=”fax”‘)
Main File Locations:
Index body location : templates/tpl_index_default.php
Posted in Zen Cart
Creating new pages for Zen Cart
July 12th, 2008 Posted 2:50 pm
this article is taken from Zen Cart Wiki http://www.zen-cart.com/wiki/index.php/Creating_new_pages
Overview
You may want to add additional pages to your Zen Cart™ store. Here are the basics steps you should follow. We will assume your new page is named myNewPage.
Components of the new page
In order for the Zen Cart™ system to pick up the new page, you will need to include four components:
- A new directory, includes/modules/pages/myNewPage/, containing a file called header_php.php
- A new file in the directory includes/templates/template_default/templates called tpl_myNewPage_default.php
- A new file, includes/extra_datafiles/myNewPage.php, defining your new page’s filename for the Zen Cart™ system
- A new language file, includes/languages/english/myNewPage.php
Naming your files
It’s important that all these new components use the same name for your new page. (The only partial exception is the extra_datafiles file; see below.) Be sure that your new pages directory name, language file name, and template file name use exactly the same name for your new page.
The header_php.php file
At a minimum, this file should contain the following:
<?php // // +----------------------------------------------------------------------+ // |zen-cart Open Source E-commerce | // +----------------------------------------------------------------------+ // | Copyright (c) 2006 The zen-cart developers | // | | // | http://www.zen-cart.com/index.php | // | | // | Portions Copyright (c) 2003 osCommerce | // +----------------------------------------------------------------------+ // | This source file is subject to version 2.0 of the GPL license, | // | that is bundled with this package in the file LICENSE, and is | // | available through the world-wide-web at the following url: | // | http://www.zen-cart.com/license/2_0.txt. | // | If you did not receive a copy of the zen-cart license and are unable | // | to obtain it through the world-wide-web, please send a note to | // | license@zen-cart.com so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // $Id: header_php.php $ // require(DIR_WS_MODULES . 'require_languages.php'); $breadcrumb->add(NAVBAR_TITLE); ?>
Additionally, you can add in whatever processing you need to do on your page to this file. Have a look at the other pages in the includes/modules/pages/ directory to get an idea of what this file is for.
The template file
The new template file, includes/templates/template_default/templates/tpl_myNewPage_default.php, contains the main HTML body for your page. A good starting point for this page is to copy one of the other pages in this directory and adjust it to fit your new page’s desired format.
The extra_datafiles file
This file, includes/extra_datafiles/myNewPage.php, should contain the following line:
<?php define(FILENAME_MYNEWPAGE, 'myNewPage'); ?>
The constant on the left, FILENAME_MYNEWPAGE, is the tag you will use to link to your new page from other locations in your shop. The string on the right, myNewPage, must exactly match the name of your new includes/modules/pages/ directory.
The language file
The language file for your page should contain definitions for all the local text elements on your page; for example:
<?php
define('NAVBAR_TITLE', 'New Page');
define('HEADING_TITLE','My Cool New Page');
?>
Other languages
Posted in Zen Cart
