ExtCart HOWTO |
-
Questions
-
1. Changing main page
- 1.1. How to change the "What's New" text?
- 1.2. How to change the "What's New Here?" text on the main page?
- 1.3. How to set page background to an image?
- 1.4. How to change the "Top" link?
- 1.5. How to remove the "requests since ***" text from the main page?
- 1.6. How to edit the "requests since ***" text on the main page?
- 1.7. How to change the text "Welcome Guest..." on the main page?
- 1.8. How to change the footer text on the main page?
- 1.9. How to change the logo image at "Administration => Look and feel => View Settings"?
- 1.10. How to add/remove boxes?
- 1.11. How to remove the "New Products for ..." box?
-
2. Changing other pages
- 2.1. How to stop the price from being displayed in the "New Products for 'Month'" box?
- 2.2. How to change "sort" box at the top of product listing page?
- 2.3. How to remove the "This product was added ..." text on the "Product Info" page?
- 2.4. How to change the "out of stock" mark?
- 2.5. How to change the "Product marked with..." text?
- 3. Creating pages
- 4. Common Information
-
1. Changing main page
Questions
1. Changing main page
1.1. How to change the "What's New" text? ^
If you want to change "What's New" text, e.g. to "News:", you may replace
define('BOX_HEADING_WHATS_NEW', 'What\'s New?');
with
define('BOX_HEADING_WHATS_NEW', 'News:');
in the file
<extcart directory>/includes/languages/english.php
1.2. How to change the "What's New Here?" text on the main page? ^
Replace the text
define('HEADING_TITLE', 'What\'s New Here?');
with whatever you want in the file
<extcart directory>/includes/languages/english/index.php
1.3. How to set page background to an image? ^
Replace
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
with
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0"
background="http://www.your_domain.com/your_image.jpg">
in the file
<extcart directory>/templates/skin_standard/tpl/common_page.tpl
1.4. How to change the "Top" link? ^
Replace
$breadcrumb = new breadcrumb;
$breadcrumb->add(HEADER_TITLE_TOP, HTTP_SERVER);
with
$breadcrumb = new breadcrumb;
$breadcrumb->add(HEADER_TITLE_TOP, "www.your_site.com");
in the file
<extcart directory>/includes/application_top.php
1.5. How to remove the "requests since ***" text from the main page? ^
Replace
<td align="right" class="{$CommonPage_FooterRowStyle}"> {$COUNTER}
with
<td align="right" class="{$CommonPage_FooterRowStyle}">
in the file
<extcart directory>/templates/skin_standard/tpl/common_page.tpl
1.6. How to edit the "requests since ***" text on the main page? ^
You may edit the line
$smarty->assign('COUNTER', $counter_now . ' ' . FOOTER_TEXT_REQUESTS_SINCE . ' ' . $counter_startdate_formatted)
in the file
<extcart directory>/includes/application_top.php
and the line
define('FOOTER_TEXT_REQUESTS_SINCE', 'requests since');'
in the file
<extcart directory>/includes/languages/english.php
1.7. How to change the text "Welcome Guest..." on the main page? ^
Edit the line:
define('TEXT_GREETING_GUEST', 'Welcome <span class="greetUser">Guest!</span>
Would you like to <a class=ContentBoxLink ref="%s"><u>log yourself in</u></a>?
Or would you prefer to <a class=ContentBoxLink href="%s"><u>create an account</u></a>?');
in the file
<extcart directory>/includes/languages/english.php
1.8. How to change the footer text on the main page? ^
Edit the line:
define('FOOTER_TEXT_BODY', 'Copyright © 2004-2005 Pentasoft Corp.<br> Powered by ExtCart
<a class=ContentBoxLink href="http://www.ext-cart.com" target="_blank">Shopping Cart Software</a>');
in the file
<extcart directory>/includes/languages/english.php
1.9. How to change the logo image at "Administration => Look and feel => View Settings"? ^
Just select any file on your local computer (using "Browse" button), and it will be uploaded to the appropriate place on the server. Logo's URL does not depend on the file name. Enter any address you like.
1.10. How to add/remove boxes? ^
Example. To remove "Product Notifications" box, replace
$_data = array( 'visible' => 'TRUE',
with
$_data = array( 'visible' => 'FALSE',
in the file
<extcart directory>/includes/boxes/product_notifications.php.
You can remove/add the following boxes using this procedure:
best_sellers
categories
currencies
information
languages
manufacturer_info
manufacturers
order_history
product_notifications
reviews
search
shopping_cart
specials
tell_a_friend
whats_new
1.11. How to remove the "New Products for ..." box? ^
Mark one of the following two strings as a comment:
$smarty->assign('TEXT_MAIN', TEXT_MAIN);
include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS);
in the file
<extcart directory>/index.php
so that it looks as follows:
$smarty->assign('TEXT_MAIN', TEXT_MAIN);
//include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS);
2. Changing other pages
2.1. How to stop the price from being displayed in the "New Products for 'Month'" box? ^
Remove the line
<BR><SPAN CLASS="{$p_Price}">{$_CONTENT.NewProductsEntries[_cell].Price}</SPAN>
from the file
<extcart directory>/templates/skin_standard/tpl/common/new_products.box.tpl
2.2. How to change "sort" box at the top of product listing page? ^
Example. To limit it to "Product Name" and "Product Price" fields only, you may replace
switch ($column_list[$col])
{
case 'PRODUCT_LIST_MODEL':
$lc_text = TABLE_HEADING_MODEL;
break;
case 'PRODUCT_LIST_NAME':
$lc_text = TABLE_HEADING_PRODUCTS;
break;
case 'PRODUCT_LIST_MANUFACTURER':
$lc_text = TABLE_HEADING_MANUFACTURER;
break;
case 'PRODUCT_LIST_PRICE':
$lc_text = TABLE_HEADING_PRICE;
break;
case 'PRODUCT_LIST_QUANTITY':
$lc_text = TABLE_HEADING_QUANTITY;
break;
case 'PRODUCT_LIST_WEIGHT':
$lc_text = TABLE_HEADING_WEIGHT;
break;
case 'PRODUCT_LIST_IMAGE':
$lc_text = TABLE_HEADING_IMAGE;
break;
case 'PRODUCT_LIST_BUY_NOW':
$lc_text = TABLE_HEADING_BUY_NOW;
break;
}// switch ...
with
switch ($column_list[$col])
{
case 'PRODUCT_LIST_MODEL':
continue 2;
$lc_text = TABLE_HEADING_MODEL;
break;
case 'PRODUCT_LIST_NAME':
$lc_text = TABLE_HEADING_PRODUCTS;
break;
case 'PRODUCT_LIST_MANUFACTURER':
continue 2;
$lc_text = TABLE_HEADING_MANUFACTURER;
break;
case 'PRODUCT_LIST_PRICE':
$lc_text = TABLE_HEADING_PRICE;
break;
case 'PRODUCT_LIST_QUANTITY':
continue 2;
$lc_text = TABLE_HEADING_QUANTITY;
break;
case 'PRODUCT_LIST_WEIGHT':
continue 2;
$lc_text = TABLE_HEADING_WEIGHT;
break;
case 'PRODUCT_LIST_IMAGE':
$lc_text = TABLE_HEADING_IMAGE;
break;
case 'PRODUCT_LIST_BUY_NOW':
$lc_text = TABLE_HEADING_BUY_NOW;
break;
}// switch ...
in the file
<extcart directory>/includes/content/product_listing.php
2.3. How to remove the "This product was added ..." text on the "Product Info" page? ^
Remove the line
<TR><TD CLASS="{$p_ItemNormalText}" ALIGN="center">{$_CONTENT.ProductInfoProductsInfoDateBeginAvailable}
from the file
<extcart directory>/templates/skin_standard/tpl/boxes/product_info.box.tpl
2.4. How to change the "out of stock" mark? ^
Edit the "Mark product out of stock" parameter on the "Administration => Configuration => Stock" page.
2.5. How to change the "Product marked with..." text? ^
Edit
OUT_OF_STOCK_CANT_CHECKOUT,
and
OUT_OF_STOCK_CAN_CHECKOUT
definitions in the file
<extcart directory>/includes/languages/english/shopping_cart.php
3. Creating pages
3.1. How to add a new item (link only) to the "Information" box? ^
If you would like to add some new links to the "Information" box, then replace the line
'<a href="' . ec_href_link(FILENAME_CONTACT_US) . '" class="ColumnBoxLink"> ' . BOX_INFORMATION_CONTACT . '</a>';
with new lines
'<a href="' . ec_href_link(FILENAME_CONTACT_US) . '" class="ColumnBoxLink"> ' . BOX_INFORMATION_CONTACT . '</a><br>' .
'<a href="http://www.ext-cart.com" class="ColumnBoxLink">ExtCart</a>';
in the file
<extcart directory>/includes/boxes/information.php
3.2. How to add a new item to the "Information" box (or how to create a new ExtCart page)? ^
- If you want to create a new ExtCart page like "Conditions of Use" or "Contact Us", then follow the steps described below. For example, let us add a "New Info" link, pointing to http://yousite.com/new_info.php.
- Open the file
<extcart directory>/includes/boxes/information.php
Replace the line
'<a href="' . ec_href_link(FILENAME_CONTACT_US) . '" class="ColumnBoxLink"> ' . BOX_INFORMATION_CONTACT . '</a>';with new lines
'<a href="' . ec_href_link(FILENAME_CONTACT_US) . '" class="ColumnBoxLink"> ' . BOX_INFORMATION_CONTACT . '</a><br>' . '<a href="' . ec_href_link(FILENAME_NEW_INFO) . '" class="ColumnBoxLink"> ' . BOX_INFORMATION_NEW_INFO . '</a>'; - Insert two lines
define('CONTENT_NEW_INFO', 'new_info'); define('FILENAME_NEW_INFO', CONTENT_NEW_INFO . '.php');after the line
define('TEMPLATENAME_STATIC', 'static');in the file
<extcart directory>/includes/filenames.php
- Also insert the line
define('BOX_INFORMATION_NEW_INFO', 'New Info');after the line
define('BOX_INFORMATION_CONTACT', 'Contact Us');in the file
<extcart directory>/includes/languages/english.php
- Copy the file
<extcart directory>/conditions.php
to
<extcart directory>/new_info.php
- Replace
$qry = "SELECT information_value FROM ".TABLE_INFORMATION." WHERE configuration_key= '".CONDITIONS_OF_USE."'";with
$qry = "SELECT information_value FROM ".TABLE_INFORMATION." WHERE configuration_key= '".NEW_INFO."'";then replace
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CONDITIONS); $breadcrumb->add(NAVBAR_TITLE, ec_href_link(FILENAME_CONDITIONS));with
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_NEW_INFO); $breadcrumb->add(NAVBAR_TITLE, ec_href_link(FILENAME_NEW_INFO));in the
<extcart directory>/new_info.php
- Copy the file
<extcart directory>/includes/languages/english/conditions.php
to the file
<extcart directory>/includes/languages/english/new_info.php
- Replace the lines
define('NAVBAR_TITLE', 'Conditions of Use'); define('HEADING_TITLE', 'Conditions of Use');with (for example)
define('NAVBAR_TITLE', 'New Info'); define('HEADING_TITLE', 'New Info');in the file
<extcart directory>/includes/languages/english/new_info.php
- Create a row in the "information" ExtCart database table, as follows:
INSERT INTO information VALUES ('4','NEW_INFO','This is the new info!');For example, you can do it via the phpMyAdmin "SQL" tab.
4. Common Information
4.1. How to change colors and fonts? ^
You have to use the CSS (Cascading Styles Sheet) file. In this sheets you can only change font styles and colors of page elements. If you change one style in the CSS, it will affect all elements on the pages associated with this style. If you wish, you can try changing some styles. For example, if you want to change color of the column box caption, proceed as follows:
- Find your current CSS file. Its path is
<extcart directory>/templates/skin_standard/css_<color>/stylesheet.css
- Open this CSS file in your favorite plain text editor
- Find the string
table.ColumnBox_CaptionStyle {background-color:#E93E27; border: 1px solid #E93E27; width: 100%;}and replace it with
table.ColumnBox_CaptionStyle {background-color:red; border: 1px solid #E93E27; width: 100%;} - Open the customer area in your browser
- The column box header should be red now.
As a further example, you can also change font size for this column box caption:
In the same CSS file find the string
.ColumnBox_BoxHeaderText {font-family: Verdana, Arial, sans-serif; font-size: 9pt; font-weight: bold; color: #F5F5F5; text-align: Center}and change font-size from 9pt to 12pt
.ColumnBox_BoxHeaderText {font-family: Verdana, Arial, sans-serif; font-size: 12pt; font-weight: bold; color: #F5F5F5; text-align: Center}You may check the resultant changes using your browser.
4.2. How to view a customer's password? ^
There is no way to view a customer's password. Only the password hash values are stored in the database, which are "one-way" function results, i.e. you can easily compute the hash if the plaintext password is available, but trying to deduce the plaintext password from the hash using general-purpose hardware would be barely feasible.
4.3. How to set up SSL. ^
Secure Sockets Layer (SSL) and Transport Layer Security (TLS), its successor, are cryptographic protocols which provide secure communications on the Internet. (http://en.wikipedia.org/wiki/Secure_Sockets_Layer) To use SSL cryptographic protocol communications you need an SSL certificate. This may be a "shared" certificate provided by your hosting provider, or your own certificate purchased from a certificate authority. When you get one, contact your hosting provider's support staff for information on the SSL certificate installation. Then you need to install ExtCart, select the "Enable SSL Connections" option and enter the required data, primarily "Secure WWW Address".
4.4. How is the shipping weight calculated? ^
For all shipping modules:
1) total_weight = total weight of all products in the cart
2) shipping_weight =
total_weight + "package Tare weight" or
total_weight * (100% + "Larger packages - percentage increase") if
"package Tare weight" < total_weight * "Larger packages -
percentage increase"
For example, with default settings ("package Tare weight" = 3 lbs., "Larger packages - percentage increase" = 10% = 0.1) for all orders under 30 lbs., the shipping_weight will be (total_weight + 3 lbs.), and for heavier orders (more than 30 lbs.) the shipping_weight will be (total_weight * 1.1), e.g.:
total_weight = 0.5 lbs
shipping_weight = 0.5 + 3.0 = 3.5 lbs
total_weight = 30 lbs.
shipping_weight = 33 lbs.
total_weight = 40 lbs.
shipping_weight = 40 * 1.1 = 44 lbs.
Both "package Tare weight" and "Larger packages - percentage increase" parameters can be set on the "Administrator => Configuration => Shipping/Packaging" page.
4.5. How are zones processed? ^
If you define one or more "zones" through the "Administration => Locations/Taxes => Zones" interface, the customer will be unable to enter his own "zone" for the particular country. He will only be able to select one of the zones that you had specified before. If he enters a zone name that does not exist in the database, he will be prompted to select a correct zone name from the zone list. This list will be unavailable initially, but will be displayed at the time of your second attempt, because the system doesn't know whether the customer will select a country with certain zones defined, or a country without any zones. When the customer has selected a particular country, the system will know whether it needs to display the zone list.
4.6. About PHP, Smarty and CSS site structure as a whole: ^
- Background
Usually system works as follows:
- Your browser requests http://.../x.php
-
x.php is being processed by the php interpreter. The file
<extcart directory>/includes/application_top.php
is included. It does main common work : includes some class definitions, database and html output functions e.g.
<extcart directory>/includes/functions/general.php
, translations of various phrases from
<extcart directory>/includes/languages/english/x.php
- If url contains an 'action' field, such as 'save', 'view', or 'edit', then appropriate action is taken: the system fetches data from the database for the 'view' action, and inserts data into the database for the 'save' action.
- Output data is prepared, usually as smarty variables, e.g.
$CONTENT
$smarty->assign('CONTENT', $_box)You can see smarty data like this:
$smarty->assign('CONTENT', $_box) print_r($_box);You can also activate the debug mode by adding the following line to
<extcart directory>/includes/configure.php
or
<extcart directory>/admin/includes/configure.php
correspondingly:define('EXTCART_DEBUG', 'TRUE');A popup window with brief list of smarty variables will open.NoteSome checks in the debug mode may be automatically omitted, so the debug appearance may vary. - Then the smarty engine is called:
$smarty->display('common_admin_page.tpl');Common page template in its part includes other page templates (for "Administration" area from
<extcart directory>/admin/templates/pages
directory) if necessary, while the page template itself may contain the 'box' templates for 'edit', 'new', 'delete' or other actions. They are located in
<extcart directory>/admin/templates/boxes
- Then the output html code is returned to browser.
- About PHP (.php files). How to modify the LOGIC.
Here is an example showing how to modify the "Administration => Catalog => Categories/Products : Add Product" page.
- How to find a required item, e.g. the handler for some action or the definition of a smarty variable, in .php files?
Use file search. For example, if you need to find where
$_CONTENT.ProductInfoProductsName is defined, search .php files
for 'ProductInfoProductsName'. You will see that
'<extcart directory>/product_info.php'
is the file you look for:
'ProductInfoProductsName' => $products_name,where $products_name comes from
$products_name = $product_info['products_name'];and $product_info is the database query result:
$product_info_query = ec_db_query($qry); $product_info = ec_db_fetch_array($product_info_query); - New product data is inserted into the database in
<extcart directory>/admin/categories.php
after the line
case 'insert_product':You can find it from the "New product preview" admin page: open the html source and search for
"<form"
You will find something like
<form name="insert_product" action="http://.../categories.php?cPath=&action=insert_product"NoteThe "&action=insert_product" GET parameter is significant.
- How to find a required item, e.g. the handler for some action or the definition of a smarty variable, in .php files?
Use file search. For example, if you need to find where
$_CONTENT.ProductInfoProductsName is defined, search .php files
for 'ProductInfoProductsName'. You will see that
- About Smarty (.tpl files). How to modify the VIEW.
The view structure
- You can modify the site's view by editing .tpl template files.
They are almost like .html files, but include some dynamic content, prepared
by PHP at every load. This dynamic content is a set of smarty
variables. For example, there is only one template file for
displaying the product information:
<extcart directory>/templates/skin_standard/tpl/boxes/product_info.box.tpl
By setting different values for such smarty variables, as
{$_CONTENT.ProductInfoProductsDescription}we get different html pages with the same page layout but different content (product name, price, etc). This work is done by PHP automatically. - Example. The invoice template file name is:
<extcart directory>/admin/templates/pages/invoice.tpl
Smarty variables are in curly brackets ('{', '}'), you may move them within the file. You may also add/replace/delete any html text.
- You can modify the site's view by editing .tpl template files.
They are almost like .html files, but include some dynamic content, prepared
by PHP at every load. This dynamic content is a set of smarty
variables. For example, there is only one template file for
displaying the product information:
- About CSS (.css files). How to modify the VIEW.
Fonts and colors
- You have to use the style sheet CSS file. In these sheets you can only change font styles and colors of page elements. If you change one style in the CSS file it will affect all elements on the pages associated with this style. If you wish, you can try changing some styles.
- For Example: You want to change color of the column box
caption:
- Find your current CSS file. Its path is
<extcart directory>/templates/skin_standard/css_<color>/stylesheet.css
- Open this CSS file in your favorite plain text editor.
Find the string
table.ColumnBox_CaptionStyle {background-color:#E93E27; border: 1px solid #E93E27; width: 100%;} - Replace it with
table.ColumnBox_CaptionStyle {background-color:red; border: 1px solid #E93E27; width: 100%;} - Open the customer area in your browser. You should see that the column box header is red now.
- Find your current CSS file. Its path is



