ALTER TABLE `products_description` ADD `products_tutorials` TEXT NOT NULL ;
==== Admin mods ====
You can edit the new tabs from the product info page, or you can create your own helper file to edit them all at once. Here's how to add the fields to individual product pages.
Just like in the Tariff mod, add the new sql field to **admin/includes/modules/product/collect_info.php**
Line 12 replace
$parameters = array('products_name' => '',
'products_description' => '',
with
$parameters = array('products_name' => '',
'products_description' => '',
'products_tutorials' => '',
Line 59 replace
$product = $db->Execute("select pd.products_name, pd.products_description, pd.products_url,
with
$product = $db->Execute("select pd.products_name, pd.products_description, pd.products_tutorials, pd.products_url,
In the same file, make sure to add the corresponding HTML input fields at the bottom.
in admin/includes/modules/update_product.php
add this line in two places, under
zen_db_perform(TABLE_PRODUCTS_DESCRIPTION, $sql_data_array, 'update', "products_id = '" . (int)$products_id . "' and language_id = '" . (int)$language_id . "'");
place
zen_db_perform(TABLE_PRODUCTS_DESCRIPTION, array( 'products_tutorials' => $products_tutorials), 'update', "products_id = '" . (int)$products_id . "'");
Once you've made the code changes, try putting some things in the "tutorials" field and make sure they appear in your database!
==== Product Page Mods ====
in **includes/modules/pages/product_info/header.php**
Add after line 36
$selectql = $db->Execute("SELECT products_tutorials FROM products_description WHERE products_id = " . (int)$_GET['products_id']);
$tabs = array();
$tabs[] = 'Description';
if($selectql->fields['products_tutorials'] != '') {
$tutorials = $selectql->fields['products_tutorials'];
$tabs[] = 'Tutorials';}
Now add the Tabs into your **includes/templates/YOUR_TEMPLATE/templates/tpl_product_info_display.php** (You've probably made extensive changes to this file already, so these line numbers will probably be way off)
Replace Line 94(?)
With
==== Javascript and CSS ====
Depending on what your template looks like, the CSS and JS might need to be totally custom. Here's how ours looks (you can always view it on any of our product pages as well).
Place this either inline in **tpl_product_info_display.php** or place it in the header by placing it in **includes/modules/pages/product_info/jscript_main.php**
Our CSS rules are as follows
.tab {
border-top: 1px solid #E2E2E2;
border-left: 1px solid #E2E2E2;
border-right: 1px solid #E2E2E2;
border-bottom: 1px solid #E2E2E2;
margin-left: 10px;
display: inline;
background-color: #EEE;
font-weight: bold;
padding: 5px;
}
.selected_tab
{
margin-left:15px; border-bottom: 1px solid #FFFFFF; background-color: #FFF
}