Common view variables
Notando eCommerce template engine is based on
Smarty template engine. To access data, such as product information or user details, template variables are used. There are variables specific for each page and common variables, accessable at all webshop pages. You can see the list of avaiable common view variables below. Other variables described at page descriptions they belongs to. (see at Pages, Blocks and View parts sections)
In order to add some variable into your template write the following:
Common view variables list
- $this — object, instance of Zend_View
- $layout — object, instance of Zend_Layout. Applicable only for layout templates.
-
$company_info
— object, company information
stdClass => { login => string cpr_number => string company_name => string currency => string language => string address1 => string address2 => string city => string zip => string country => string area => string email => string phone => string gsm => string web => string } -
$user
— object, instance of UserModel, currently logged in user information
UserModel => { cpr_number => string name => string address_id => string address1 => string address2 => string zip => string city => string country => string country_name => string phone => string email => string person => string language => string currency_id => string currency_name => string, isLoggedIn() => function() } - $languages — array of strings, available languages list including theme specific translations.
- $language — string, currently selected language
- $enable_wishlist — boolean, set true if wishlist is enabled for current company
- $wishlist_fb_api_key — string, wishlist application facebook api key
- $wishlist_fb_app_address — string, wishlist application facebook application address
- $wishlist_server — string, wishlist application server
- $header_logo — string, company logo URL
- $custom_logo — boolean, set true if company has custom logo uploaded
- $currency_name — string, selected currency name
- $display_style — string, currently selected list style (list or grid). To change current display style add list_style GET parameter to request
- $page_title — string, page title (or null if title is not set)
- $_errors — array of strings, errors (or null if errors are not set)
- $_status_messages — array of strings, status messages e.g. 'Order sucessfully created' (or null if messages are not set)
Please notice, to render errors or status messages in your template you can use view variables or include corresponding file as it is described in view part
Pages
Pages or page content blocks — are templates representing page main content. For more easy-to-use naming of pages terms 'action' and 'controller' are used.
Action — is name of program part producing a separate content part. Related actions grouped under controller. For exapmle, we can talk about 'news_list' or 'view_order' actions page content. In layout structure page content block placed in content structural block as you can see at this example.
Which exactly page content block will be rendered in content structural block depends on webshop page url. , which is placed as 'controllers/category/products.phtml' in folder stucture.
Listed below pages description includes:
- template path — path in folder structure, where page template is stored. Please notice, this path is not absolute, use theme_template smarty modifier if include template files to let the system make correct path
- request parameters — avaiable parameters coming in GET request, you can use them when make links on this page
- template variables — template variables avaiable at the page. They assigned by webshop engine and you can use them in your design. There are some features when work with template variables during common view parts including. They are described here
- included templates — another templates used inside of the page for default theme. List of all allowed page template variables is all variables the page has itself and all variables of the page included templates
Default theme page templates list:
| Action | Description |
controller: cart |
|
| add |
Add product to carttemplate path: controllers/cart/add.phtml
For general products product will be added (or not added) into cart, also
status or error message will be produced and user will be redirected back.
Request parameters:
Included templates:
|
| checkout |
Checkout pagetemplate path: controllers/cart/checkout.phtml At this page user review order and select payment method. For non logged in user status message with login request will be shown. If shipping required set to true in backoffice - user will be redirected back to cart/view and asked to select shipping method. Template variables:
Included templates: |
| history |
Orders historytemplate path: controllers/cart/history.phtml This page used to show list of paid and unpaid orders. Template variables:
|
| view-order |
View Ordertemplate path: controllers/cart/view-order.phtml View order from orders history. Request patameters:
Template variables:
|
| view |
Cart view pagetemplate path: controllers/cart/view.phtml At this page user can view cart, change products quantity, select shipping method and process to checkout. Template variables:
Included templates: |
controller: category |
|
| products |
Category products listtemplate path: controllers/category/products.phtml At this page user can view list of products under some category. Template variables:
Included templates:
|
controller: content |
|
| about-us |
About us pagetemplate path: controllers/content/about-us.phtml This page used to show information about company. If no custom information provided will be shown information based on company registration information. Template variables:
|
| news-list |
News listtemplate path: controllers/content/news-list.phtml This page used to show list of content with type news in user's language. Included templates: |
| news-view |
News contenttemplate path: controllers/content/news-view.phtml This page used to show content with type news in user's language. Included templates: |
| static-pages-list |
Static pages listtemplate path: controllers/content/pages-list.phtml This page used to show list of content with type static-pages in user's language. Included templates: |
| static-pages-view |
Static page contenttemplate path: controllers/content/pages-view.phtml This page used to show content with type static-pages in user's language. Included templates: |
| show |
Static page rendertemplate path: controllers/content/show.phtml This page used to show content by group_id or shortcut in user's language.
To access special page by it's shortcut you may use url
/page/:shortcut
Request parameters:
Included templates: |
controller: index |
|
| index |
Main store pagetemplate path: controllers/index/index.phtml This is home page of the store. Included specials:
|
controller: login |
|
| index |
Login formtemplate path: controllers/login/index.phtml Template variables:
|
| remind-password |
Remind password formtemplate path: controllers/login/remind-password.phtml This page used to render remind password form. |
controller: payment |
|
| cancel-request |
Cancel offer request pagetemplate path: controllers/payment/cancel-request.phtml This page used to show order cancel confirmation dialog. Request parameters:
Template variables:
|
| cancel |
Cancel offer pagetemplate path: controllers/payment/cancel.phtml This page used to show order canceling status. Request parameters:
Template variables:
|
| confirm |
Payment confirmation pagetemplate path: controllers/payment/confirm.phtml This page used to show payment confirmation. Here is the best place to say thank you. Request parameters:
Template variables:
Included specials:
|
| pay-later |
Pay later pagetemplate path: controllers/payment/pay-later.phtml At this page user may select payment method and process to payment page. Request parameters:
Template variables:
|
| pay |
Payment pagetemplate path: controllers/payment/pay.phtml This page used to render payment processor template and may vary for different payment processors. If payment processor does not selected or payment processor failed user will be redirected to /cart/checkout page. Request parameters:
Template variables:
|
controller: product |
|
| details |
Product pagetemplate path: controllers/product/details.phtml This page used to show product details. If product is a metacategory then attribute selection form will be shown. Request parameters:
Template varables:
Included templates:
|
| search-by-name |
Product search resultstemplate path: controllers/product/search-by-name.phtml At this page user can view results of product search. Template variables:
Included templates:
|
| compare |
Compare productstemplate path: controllers/product/compare.phtml At this page user can view compared products Template variables:
Included templates: |
| with-attribute |
Product search by attributetemplate path: controllers/product/with-attribute.phtml
At this page user can view products filtered by some attribute. Template variables:
Included templates:
|
controller: user |
|
| manage-address |
User address booktemplate path: controllers/user/manage-address.phtml This page used to show and manage user addresses. Request parameters:
Template variables:
Included templates:
|
| profile |
User profile pagetemplate path: controllers/user/profile.phtml This page used to show user profile. Template variables:
Included templates:
|
| registration |
New user registration pagetemplate path: controllers/user/registration.phtml Template variables:
Included templates:
|
Blocks
Blocks, or content blocks — are self-contained blocks representing some page functionality such as: category list, top menu, product cart, etc. Main pages functionality are described in page content blocks above. The listed below content blocks mostly includes auxiliary data.
Another difference between page content block and content block is — to include the last one into layout you must write proper rules in blocks.xml file. See how use them in block definition section. Blocks also can be loaded directly form URL '/blocks/controller_name/action_name' you may use this method to update some template part by means AJAX or to view some content block as separate part during developing. If block loaded with XmlHttpRequest only rendered block template as HTML without layout will be returned as result. The block list describes block properties such as template variables, request parameters etc. What they mean details are here.
Content blocks list
| Action | Description |
controller: cart |
|
| short |
Minicart
template path: blocks/cart/short.phtml This block used to show minicart. Template variables:
|
controller: category |
|
| breadcrumbs |
Category breadcrumbs
template path: blocks/category/breadcrumbs.phtml This block used to show path to current category or product throw categories. Request parameters:
Template variables:
|
| menu-header-categories |
Menu with header categories only
template path: blocks/category/menu-header-categories.phtml This block used to render header categories as menu. Request parameters:
Template variables:
|
| menu-tree |
Categories menu
template path: blocks/category/menu-tree.phtml This block used to render categories as menu with rendering path to selected category as tree. Request parameters:
Template variables:
|
| subcategories |
Category subcategories
template path: blocks/category/subcategories.phtml This block used to render category subcategories. Request parameters:
Template variables:
|
controller: content |
|
| footer-menu-links |
Footer menu links
template path: blocks/content/footer-menu-links.phtml This block used to render footer menu links. Block parameters:
Template variables:
|
| get |
Render static content
template path: blocks/content/get.phtml This block used to render some static content by given group or shortcut. Block parameters:
Template variables:
|
| google-analytics |
Google analytics
template path: blocks/content/google-analytics.phtml This block used to add google analytics. Template variables:
|
| header |
Page header
template path: blocks/content/header.phtml This block used to render header content. |
| languages |
Languages
template path: blocks/content/languages.phtml This block used to render store available languages. For rendering it use common templete variables. |
| news |
News
template path: blocks/content/news.phtml This block used to render news. Block parameters:
Template variables:
|
| promo |
Promotional
template path: blocks/content/promo.phtml This block used to render some promotional content. |
| top-menu-links |
Top menu links
template path: blocks/content/top-menu-links.phtml This block used to render top menu links. Block parameters:
Template variables:
|
| useful-links |
News
template path: blocks/content/useful-links.phtml This block used to render useful links. Block parameters:
Template variables:
|
controller: currency |
|
| select |
Currency selection block
template path: blocks/currency/select.phtml This block used to currency select form. Template variables:
|
controller: filter |
|
| form |
Product filter form
template path: blocks/filter/form.phtml This block used to render product filter form in some category. Filter form will consists of name, price and category attributes fields. Template variables:
|
| search-by-name |
Quick search
template path: blocks/filter/search-by-name.phtml This block used to render product quick search form. Template variables:
|
| custom |
Custom product filter
template path: blocks/filter/custom.phtml
This block used to render list of values of choosen attributes.
Use this block when you need to create menu like "Brand" or "Size"
To do this create in your administrative interface Attribute "Brand" with type set and assign it to some categories. Then create some products in those categories and set "Brand" attribute value. To create menu (for example in left structural block) that will show list of Brands add next line into your structural_block <content_block position="0"> <![CDATA[filter/custom?filterBy=Brand]]> </content_block> Block parameters:
Template variables:
|
controller: product |
|
| new-grid |
New products
template path: blocks/product/new-grid.phtml This block used to render latest added products. Block parameters:
Template variables:
Included templates: |
| popular-grid |
Popular products
template path: blocks/product/popular-grid.phtml This block used to render on promotional products. Block parameters:
Template variables:
Included templates: |
| recent |
Recently viewed products
template path: blocks/product/recent.phtml This block used to render recently viewed products. Block parameters:
Template variables:
Included templates: |
| compare-list |
Products compare list
template path: blocks/product/compare-list.phtml This block used to render products compare list. Template variables:
|
controller: user |
|
| login-box |
Login links/User information
template path: blocks/user/login-box.phtml This block used to render Sing in or Sign up links for new users and greatings for existing. |
| login-form |
Login form
template path: blocks/user/login-form.phtml This block used to render user login form. Included templates: |
View parts
Common view parts — are default theme common content blocks, which can be used as auxilary tool in your layouts. To add some view part into page, your should directly include it:
Remember that common view part templates are created for cases when you do not want to change view that they provide.
