Pages

From Zen Cart(tm) Wiki
Revision as of 16:14, 19 July 2010 by DrByte (talk | contribs) (removed obsolete content)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This is an overview for all pages in Zen Cart™ version 1.2.4. (I did not yet examine version 1.3.0 but I do not think that is very different) For me making this was very useful for understanding and getting an overview of Zen Cart™.


Customising Pages

You can customise the visual aspects and function of many standard pages by visiting the following menus in the Admin utility (especially to hide or display pieces of text):

You can customize the displayed text of many standard pages by visiting the following menus in the Admin utility:

Customising language files

Important Information - Before changing any language file(s) perform the steps below. These steps assume you are using the english language files. If your language differs use that language instead:

  1. Create a folder with the name of your active template in the directory myshop/includes/languages/english/ (e.g. myshop/includes/languages/english/mytemplate)
  2. Copy the file(s) you wish to modify to the directory myshop/includes/languages/english/mytemplate where mytemplate is the name of the template you are using.

(When customising language files for admin pages which are located in myshop/admin/includes/languages/ the same principles apply.)

Customisation Basics

You can customise much of the default text which appears within your site by modifying the language files which are located in the directory myshop/includes/languages/ or myshop/admin/includes/languages/ for admin related text. Within this directory are each of the language packs which included in your Zen Cart™ installation. The default language pack is english.


Within each of the language pack directories there is a set of files which define specific text for each of the various parts in a Zen Cart™ installation. These files define text for not only standard pages but also various sideboxes and installed modules.


Example: the standard page Product Info has a language file called product_info.php in this directory. Here various default text can be modified for the Product Info page.

There is also a general language file for common text that may appear on multiple pages, sideboxes or modules: myshop/includes/languages/english/index.php.

See also: How do I Change the Congratulations Message? | How do I Change the Welcome Guest Message?


Customising template files

Another advanced option is customizing the template files. There is a template file for each page with the almost same name in the directory myshop/includes/templates/template_default/templates. E.g. the page product_info has a template file called tpl_product_info_display.php and tpl_product_info_noproduct.php in this directory. Before changing, copy this file to the directory myshop/includes/templates/mytemplate/templates, where mytemplate is the name of the template you are using.


Creating new pages

You may want to add additional pages to your Zen Cart™ website. For a description of basic steps you should follow, see:


Overview of pages

Frequently Used Pages

Name Description Remarks
index Home Url: www.myshop.com/index.php?main_page=index

Customising: edit define_main_page.php (Define Pages Editor)

index (with category icons) Shows product subcategories icons in the center part of the webpage when choosing a category without products in. Url: www.myshop.com/index.php?main_page=index &cPath=1 (example in default demo shop)
index (with product listing) Shows products listing in the center part of the webpage when choosing a category with products in. Url: www.myshop.com/index.php?main_page=index &cPath=4 (example)
product_info Product details Url: www.myshop.com/index.php?main_page=product_info &products_id=94 (example in default demo shop)
shopping_cart Show shopping cart Url: www.myshop.com/index.php?main_page=shopping_cart
info_shopping_cart Help page Shopping cart Url: www.myshop.com/index.php?main_page=info_shopping_cart

Checkout Pages

Name Description Remarks
checkout_shipping Checkout 1 (shipping) Url: www.myshop.com/index.php?main_page=checkout_shipping
checkout_shipping_address Checkout 1a (shipping address) Url: www.myshop.com/index.php?main_page=checkout_shipping_address
checkout_payment Checkout 2 (payment) Url: www.myshop.com/index.php?main_page=checkout_payment
checkout_payment_address Checkout 2a (payment address) Url: www.myshop.com/index.php?main_page=checkout_payment_address
checkout_confirmation Checkout 3 (ask for confirmation) Url: www.myshop.com/index.php?main_page=checkout_confirmation
checkout_success Checkout 4 (checkout done) Url: www.myshop.com/index.php?main_page=checkout_success


Search Pages

Name Description Remarks
advanced_search Advanced search Url: www.myshop.com/index.php?main_page=advanced_search
advanced_search_result Advanced search result Url: www.myshop.com/index.php?main_page=advanced_search_result &search_in_description=1&keyword=geit (example)
popup_search_help Help page Advanced search Url: www.myshop.com/index.php?main_page=popup_search_help


More Catalog Pages

Name Description Remarks
products_all Show all products Url: www.myshop.com/index.php?main_page=products_all
products_new Show new products Url: www.myshop.com/index.php?main_page=products_new
specials Show special products Url: www.myshop.com/index.php?main_page=specials
featured_products Show featured products Url: www.myshop.com/index.php?main_page=featured_products


Information Pages

Name Description Remarks
conditions Conditions Url: www.myshop.com/index.php?main_page=conditions

Customising: edit define_conditions.php (Define Pages Editor)

cookie_usage Cookie usage Url: www.myshop.com/index.php?main_page=cookie_usage
privacy Privacy Statement Url: www.myshop.com/index.php?main_page=privacy
shippinginfo Help page Shipping Url: www.myshop.com/index.php?main_page=shippinginfo

Customising: edit define_shippinginfo.php (Define Pages Editor)

contact_us Contact page Url: www.myshop.com/index.php?main_page=contact_us

Customising: edit define_contact_us.php (Define Pages Editor)

Login Pages

Name Description Remarks
login Login Url: www.myshop.com/index.php?main_page=login
logoff Logout Url: www.myshop.com/index.php?main_page=logoff
password_forgotten Password forgotten Url: www.myshop.com/index.php?main_page=password_forgotten
create_account Create account Url: www.myshop.com/index.php?main_page=create_account
create_account_success Message Account created Url: www.myshop.com/index.php?main_page=create_account_success


Personal Pages

Name Description Remarks
account Personal Home Page Url: www.myshop.com/index.php?main_page=account
account_edit My Account Information Url: www.myshop.com/index.php?main_page=account_edit
account_history My Orders Url: www.myshop.com/index.php?main_page=account_history
account_history_info My Orders Details Url: www.myshop.com/index.php?main_page=account_history_info &order_id=1 (example)
account_newsletters Subscribe Newletter Url: www.myshop.com/index.php?main_page=account_newsletters
unsubscribe Unsubscribe Newletter Url: www.myshop.com/index.php?main_page=unsubscribe
account_notifications  ? Url: www.myshop.com/index.php?main_page=account_notifications
account_password Change Password Url: www.myshop.com/index.php?main_page=account_password
address_book My Address Book Url: www.myshop.com/index.php?main_page=address_book
address_book_process My Address Book ? Url: www.myshop.com/index.php?main_page=address_book_process


Other pages

Name Description Remarks
tell_a_friend Tell a frined Url: www.myshop.com/index.php?main_page=tell_a_friend &products_id=94 (example)
product_reviews Reviews Url: www.myshop.com/index.php?main_page=product_reviews &products_id=94 (example)
product_reviews_info Reviews Url: www.myshop.com/index.php?main_page=product_reviews_info &products_id=94 (example)
product_reviews_write Login Url: www.myshop.com/index.php?main_page=product_reviews_write &products_id=94 (example)
reviews Reviews Url: www.myshop.com/index.php?main_page=reviews &products_id=94 (example)
popup_shipping_estimator popup_shipping_estimator Url: www.myshop.com/index.php?main_page=popup_shipping_estimator
page_2 Extra Information Page Url: www.myshop.com/index.php?main_page=page_2
page_3 Extra Information Page Url: www.myshop.com/index.php?main_page=page_3
page_4 Extra Information Page Url: www.myshop.com/index.php?main_page=page_4
customers_authorization  ? Url: www.myshop.com/index.php?main_page=customers_authorization
gv_redeem  ? Url: www.myshop.com/index.php?main_page=gv_redeem
gv_send  ? Url: www.myshop.com/index.php?main_page=gv_send
gv_faq  ? Url: www.myshop.com/index.php?main_page=gv_faq
checkout_process Login Time Out Url: www.myshop.com/index.php?main_page=checkout_process
time_out Login Time Out Url: www.myshop.com/index.php?main_page=time_out
document_general_info document_product_info Url: www.myshop.com/index.php?main_page=document_general_info
document_product_info  ? Url: www.myshop.com/index.php?main_page=document_product_info
download  ? Url: www.myshop.com/index.php?main_page=download
down_for_maintenance down_for_maintenance Url: www.myshop.com/index.php?main_page=down_for_maintenance
popup_attributes_qty_prices popup_attributes_qty_prices Url: www.myshop.com/index.php?main_page=popup_attributes_qty_prices
popup_coupon_help popup_coupon_help Url: www.myshop.com/index.php?main_page=popup_coupon_help
popup_cvv_help Help for Visa, Mastercard, Discover 3 Digit Card Verification Number Url: www.myshop.com/index.php?main_page=popup_cvv_help
popup_image  ? Url: www.myshop.com/index.php?main_page=popup_image
popup_image_additional  ? Url: www.myshop.com/index.php?main_page=popup_image_additional
product_free_shipping_info  ? Url: www.myshop.com/index.php?main_page=product_free_shipping_info
product_music_info  ? Url: www.myshop.com/index.php?main_page=product_music_info
redirect Reviews Url: www.myshop.com/index.php?main_page=redirect
ssl_check Security Check Url: www.myshop.com/index.php?main_page=ssl_check

Developers info

Every page has a page name. To find out this name you need to evaluate the $_GET['main_page'] (or $current_page_base) variable. There are several php-files related to one page. At least there is a module file, a template file and a language file. The filenames are following strict naming convention in order to work within the Zencart php framework.

Module header

Each page has a module header file in which some variables could be set for a specific page. This will be parsed before <html> is send to the browser. The name of this file is:

  • includes\modules\pages\PAGENAME\header_php.php

Templates

Each page has a template file in which the html-related code is in. The name of this file is (where PAGENAME is the name of the page):

  • tpl_PAGENAME_default.php (default name for most pages)
  • tpl_PAGENAME_info.php (for the detail product info pages)
  • tpl_index_categories.php (for a with categories)
  • tpl_index_product_list.php (for a page with a product list)

These files resides in:

  • includes\templates\template_default\templates\tpl_PAGENAME_default.php

or when using YOUR_TEMPLATE as template selection you could override it:

  • includes\templates\YOUR_TEMPLATE\templates\tpl_PAGENAME_default.php

Main_template_vars

A page could have an optional main_template_vars file. In this file some variables could be set for a specific page. An important variable is $tpl_page_body. When this variable is set another template file could be used when needed. For example the index page uses the tpl_index_default.php template file which is in fact the home page. When the customer chooses a specific category (e.g. computers, dvd, games) they still view the index page but with another template file: tpl_index_categories.php. To find out which non default template a page uses look in:

  • includes\modules\pages\PAGENAME\main_template_vars.php

Languages

Each page has for each language his own language file. In this files are all text related defines for a specific page and language. This file is:

  • includes\languages\YOUR_LANGUAGE\PAGENAME.php

or when using YOUR_TEMPLATE as template selection you could override it:

  • includes\languages\YOUR_LANGUAGE\YOUR_TEMPLATE\PAGENAME.php, e.g.
  • includes\languages\english\default\site_map.php

There is also a global language file which can be found outside the YOUR_LANGUAGE folder. This file is:

  • includes\languages\YOUR_LANGUAGE.php

or when using YOUR_TEMPLATE as template selection you could override it:

  • includes\languages\YOUR_TEMPLATE\YOUR_LANGUAGE.php, e.g.
  • includes\languages\default\english.php