This change will move the manufacturers dropdown select from the sidebox area into the manufacturers_id pages next to the alpha sorter and categories sorter.
To see an example visit: http://jestcountrystuff.com/index.ph...facturers_id=1
It has been tested on ZenCart Version 1.5.3 with only the UPS module installed
Both Column Left Status and Column Right Status are globally turned off in Admin / Configuration / Layout Settings.
All Admin / Tools / Layout Boxes Controller options are turned off except for the search_header.php.
If you know of an easier way to accoplish this, let me know. Use at your own risk...it works fine for my situation but there is no guarantee it will work for yours :-).
I STRONGLY SUGGEST YOU DO THIS ON A TEST SHOP BEFORE USING ON A LIVE STORE.
Files affected:
includes/templates/YOUR TEMPLATE/templates/tpl_index_product_list.php
Find this:
PHP Code:
. '<label class="inputLabel">' .TEXT_SHOW . '</label>'
and comment it out like so to hide the text "Filter By" on manufacturers page:
PHP Code:
if ($do_filter_list || ($check_for_alpha->RecordCount() > 0 && PRODUCT_LIST_ALPHA_SORTER == 'true')) {
$form = zen_draw_form('filter', zen_href_link(FILENAME_DEFAULT), 'get')/* . '<label class="inputLabel">' .TEXT_SHOW . '</label>'*/;
Find this:
PHP Code:
// draw alpha sorter
require(DIR_WS_MODULES . zen_get_module_directory(FILENAME_PRODUCT_LISTING_ALPHA_SORTER));
and paste this right below it:
PHP Code:
// draw manufacturers select
$myCurrentPage = $_SERVER['REQUEST_URI'];
if (strpos($myCurrentPage, 'manufacturers_id') !== false) {
require(DIR_WS_MODULES . zen_get_module_directory(FILENAME_PRODUCT_LISTING_MANUFACTURERS_SELECT));
echo zen_draw_form('manufacturers_form', zen_href_link(FILENAME_DEFAULT, '', $request_type, false), 'get');
echo zen_draw_hidden_field('main_page', FILENAME_DEFAULT);
echo zen_draw_pull_down_menu('manufacturers_id', $manufacturer_sidebox_array, (isset($_GET['manufacturers_id']) ? $_GET['manufacturers_id'] : ''), 'onchange="this.form.submit();" size="' . MAX_MANUFACTURERS_LIST . '" style="width: auto; margin: auto;"') . zen_hide_session_id();
}
includes/modules/sideboxes/YOUR TEMPLATE/manufacturers.php
Comment this code out...sidebox will be turned off so there is no need for it. Besides, it breaks the purpose of this code if you leave it turned on. If you want to keep your sidebox manufacturer select working, you will have to figure out the coding :-( .
PHP Code:
//require($template->get_template_dir('tpl_manufacturers_select.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_manufacturers_select.php');
//$title = '<label>' . BOX_HEADING_MANUFACTURERS . '</label>';
//$title_link = false;
//require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
includes/filenames.php THIS IS A CORE FILE SO MAKE SURE YOU NOTE YOUR CHANGES FOR YOUR NEXT UPGRADE!
Add this and change YOUR TEMPLATE to whatever your custom template is named
PHP Code:
define('FILENAME_PRODUCT_LISTING_MANUFACTURERS_SELECT', 'sideboxes/YOUR TEMPLATE/manufacturers.php'); //MIKE ADDED
includes/english/YOUR TEMPLATE/english.php
Add this definition:
PHP Code:
define('PULL_DOWN_ALL_MANUFACTURERS','All Manufacturers'); //MIKE
includes/languages/english/YOUR TEMPLATE/index.php
Add or change this definition:
PHP Code:
define('TEXT_ALL_MANUFACTURERS', 'Category Manufacturers'); //was All Manufacturers
includes/languages/english/YOUR TEMPLATE/header.php
Add these definitions:
PHP Code:
define('HEADER_TITLE_CATALOG_BREADCRUMB', 'Categories'); // MIKE ADDED
define('MFG_HEADER_TITLE_CATALOG', 'Manufacturers'); // MIKE ADDED
includes/init_includes/init_add_crumbs.php CORE FILE MAKE NOTES FOR NEXT UPGRADE
Comment out this:
PHP Code:
/*MIKE - $breadcrumb->add(HEADER_TITLE_CATALOG, zen_href_link(FILENAME_DEFAULT));*/
Add this just above the line you just commented out:
PHP Code:
//MIKE
$myCurrentPage = $_SERVER['REQUEST_URI'];
if (strpos($myCurrentPage, 'manufacturers_id') !== false) {
$breadcrumb->add(MFG_HEADER_TITLE_CATALOG);
} else {
$breadcrumb->add(HEADER_TITLE_CATALOG_BREADCRUMB, zen_href_link(FILENAME_DEFAULT));
}
These changes will also automatically change the top level bread crumb to read as "Categories" or "Manufacturers" where appropriate.
I hope this is useful to someone else.
Happy selling!
Bookmarks