Добрых суток всем. Есть магазин, реализованный на MaxyStore 1.5.5.1. Сделан под заказ с определенными добавлениями. При реализации забыли вывести поиск в шапку. Если не ошибаюсь, в данной версии движка поиск есть. Вопрос: где физически находится модуль поиска и как его настроить в данной версии?
Вам надо просто отредактировать header.tpl, вставить в нужном месте Код: <div id="search"> <div class="button-search"></div> <input type="text" name="filter_name" value="Что желаете найти?" onclick="this.value = '';" onkeydown="this.style.color = '#999999';" /> </div>
В нужном месте - это в каком именно? В частности, мне нужно справа-внизу шапки, где обычно его и располагают.
поставьте справа-внизу шапки, где обычно его и располагают )))) код в студию, ну или в личку пишите, договоримся
Вот код хедера. PHP: <?php class ControllerCommonHeader extends Controller { protected function index() { if(isset($this->request->get['route'])){ $this->data['current_page'] = ''; switch($this->request->get['route']) { case 'information/information': if(isset($this->request->get['information_id'])){ $this->data['current_page'] = $this->url->link('information/information','information_id='. $this->request->get['information_id']); } else { $this->data['current_page'] = 'home'; } break; case 'news/news_category': if(isset($this->request->get['ncat'])){ $this->data['current_page'] = $this->url->link('news/news_category','ncat='. $this->request->get['ncat']); } else { $this->data['current_page'] = 'home'; } break; case 'information/contact': $this->data['current_page'] = $this->url->link('information/contact'); break; default: $this->data['current_page'] = 'home'; } } else { $this->data['current_page'] = 'home'; } // echo $this->data['current_page']; $this->data['title'] = $this->document->getTitle(); if (isset($this->request->server['HTTPS']) && (($this->request->server['HTTPS'] == 'on') || ($this->request->server['HTTPS'] == '1'))) { $server = $this->config->get('config_ssl'); } else { $server = $this->config->get('config_url'); } $this->data['base'] = $server; $this->data['description'] = $this->document->getDescription(); $this->data['keywords'] = $this->document->getKeywords(); $this->data['links'] = $this->document->getLinks(); $this->data['styles'] = $this->document->getStyles(); $this->data['scripts'] = $this->document->getScripts(); $this->data['lang'] = $this->language->get('code'); $this->data['direction'] = $this->language->get('direction'); $this->data['google_analytics'] = html_entity_decode($this->config->get('config_google_analytics'), ENT_QUOTES, 'UTF-8'); $this->data['name'] = $this->config->get('config_name'); $this->data['quick_search'] = $this->config->get('config_quick_search'); if ($this->config->get('config_icon') && file_exists(DIR_IMAGE . $this->config->get('config_icon'))) { $this->data['icon'] = $server . 'image/' . $this->config->get('config_icon'); } else { $this->data['icon'] = ''; } if ($this->config->get('config_logo') && file_exists(DIR_IMAGE . $this->config->get('config_logo'))) { $this->data['logo'] = $server . 'image/' . $this->config->get('config_logo'); } else { $this->data['logo'] = ''; } $this->language->load('common/header'); $this->load->model('catalog/news'); $this->data['text_home'] = $this->language->get('text_home'); $this->data['text_wishlist'] = sprintf($this->language->get('text_wishlist'), (isset($this->session->data['wishlist']) ? count($this->session->data['wishlist']) : 0)); $this->data['text_compare'] = sprintf($this->language->get('text_compare'), (isset($this->session->data['compare']) ? count($this->session->data['compare']) : 0)); $this->data['text_shopping_cart'] = $this->language->get('text_shopping_cart'); $this->data['text_search'] = $this->language->get('text_search'); $this->data['text_login'] = $this->language->get('text_login'); $this->data['text_welcome'] = sprintf($this->language->get('text_welcome'), $this->url->link('account/login', '', 'SSL'), $this->url->link('account/register', '', 'SSL')); $this->data['text_logged'] = sprintf($this->language->get('text_logged'), $this->url->link('account/account', '', 'SSL'), $this->customer->getFirstName(), $this->url->link('account/logout', '', 'SSL')); $this->data['text_welcome_user'] = sprintf($this->language->get('text_welcome_user'), $this->url->link('account/register', '', 'SSL')); if (($this->customer->getFirstName()) || ($this->customer->getLastName())) { $this->data['text_logged_user'] = sprintf($this->language->get('text_logged_user'), $this->customer->getFirstName() . ' ' . $this->customer->getLastName()); } else { $this->data['text_logged_user'] = $this->language->get('text_welcome_no_user'); } $this->data['text_account'] = $this->language->get('text_account'); $this->data['text_checkout'] = $this->language->get('text_checkout'); $this->data['text_all_news'] = sprintf($this->language->get('text_all_news'), $this->config->get('config_news_count') ? ' (' . $this->model_catalog_news->getTotalNews() . ')' : ''); $this->data['all_news_top_menu'] = $this->config->get('config_news_top_menu'); $this->data['text_email'] = $this->language->get('text_email'); $this->data['text_password'] = $this->language->get('text_password'); $this->data['text_forgotten'] = $this->language->get('text_forgotten'); $this->data['text_register'] = $this->language->get('text_register'); $this->data['text_account'] = $this->language->get('text_account'); $this->data['text_logout'] = $this->language->get('text_logout'); $this->data['text_order'] = $this->language->get('text_order'); $this->data['text_contact'] = $this->language->get('text_contact'); $this->data['text_download'] = $this->language->get('text_download'); $this->data['text_edit'] = $this->language->get('text_edit'); $this->data['button_login'] = $this->language->get('button_login'); $this->data['contact'] = $this->url->link('information/contact'); $this->data['home'] = $this->url->link('common/home'); $this->data['wishlist'] = $this->url->link('account/wishlist', '', 'SSL'); $this->data['logged'] = $this->customer->isLogged(); $this->data['account'] = $this->url->link('account/account', '', 'SSL'); $this->data['shopping_cart'] = $this->url->link('checkout/cart'); $this->data['checkout'] = $this->url->link('checkout/checkout', '', 'SSL'); $this->data['all_news'] = $this->url->link('news/all_news', '', 'SSL'); $this->data['action'] = $this->url->link('account/login', '', 'SSL'); $this->data['register'] = $this->url->link('account/register', '', 'SSL'); $this->data['forgotten'] = $this->url->link('account/forgotten', '', 'SSL'); $this->data['logout'] = $this->url->link('account/logout', '', 'SSL'); $this->data['order'] = $this->url->link('account/order', '', 'SSL'); $this->data['download'] = $this->url->link('account/download', '', 'SSL'); $this->data['edit'] = $this->url->link('account/edit', '', 'SSL'); $this->data['compare'] = $this->url->link('product/compare'); if (isset($this->request->post['redirect']) && (strpos($this->request->post['redirect'], $this->config->get('config_url')) !== false || strpos($this->request->post['redirect'], $this->config->get('config_ssl')) !== false)) { $this->data['redirect'] = $this->request->post['redirect']; } elseif (isset($this->session->data['redirect'])) { $this->data['redirect'] = $this->session->data['redirect']; unset($this->session->data['redirect']); } else { $this->data['redirect'] = ''; } if (isset($this->request->post['email'])) { $this->data['email'] = $this->request->post['email']; } else { $this->data['email'] = ''; } if (isset($this->request->post['password'])) { $this->data['password'] = $this->request->post['password']; } else { $this->data['password'] = ''; } // Daniel's robot detector $status = true; if (isset($this->request->server['HTTP_USER_AGENT'])) { $robots = explode("\n", trim($this->config->get('config_robots'))); foreach ($robots as $robot) { if ($robot && strpos($this->request->server['HTTP_USER_AGENT'], trim($robot)) !== false) { $status = false; break; } } } // A dirty hack to try to set a cookie for the multi-store feature $this->load->model('setting/store'); $this->data['stores'] = array(); if ($this->config->get('config_shared') && $status) { $this->data['stores'][] = $server . 'catalog/view/javascript/crossdomain.php?session_id=' . $this->session->getId(); $stores = $this->model_setting_store->getStores(); foreach ($stores as $store) { $this->data['stores'][] = $store['url'] . 'catalog/view/javascript/crossdomain.php?session_id=' . $this->session->getId(); } } // Search if (isset($this->request->get['search'])) { $this->data['search'] = $this->request->get['search']; } else { $this->data['search'] = ''; } // Menu $this->load->model('catalog/category'); $this->load->model('catalog/product'); $this->data['categories'] = array(); $categories = $this->model_catalog_category->getCategories(0); foreach ($categories as $category) { if ($category['top']) { // Level 2 $children_data = array(); $children = $this->model_catalog_category->getCategories($category['category_id']); foreach ($children as $child) { $data = array( 'filter_category_id' => $child['category_id'], 'filter_sub_category' => true ); $product_total = $this->model_catalog_product->getTotalProducts($data); $children_data[] = array( 'name' => $child['name'] . ($this->config->get('config_product_count') ? ' (' . $product_total . ')' : ''), 'category_id' => $child['category_id'], 'href' => $this->url->link('product/category', 'path=' . $category['category_id'] . '_' . $child['category_id']) ); } // Level 1 $this->data['categories'][] = array( 'name' => $category['name'], 'children' => $children_data, 'category_id' => $category['category_id'], 'column' => $category['column'] ? $category['column'] : 1, 'href' => $this->url->link('product/category', 'path=' . $category['category_id']) ); } } // Information $this->load->model('catalog/information'); $this->data['text_information'] = $this->language->get('text_information'); $this->data['informations'] = array(); $informations = $this->model_catalog_information->getInformations(); foreach ($informations as $information) { if ($information['top']) { $this->data['informations'][] = array( 'title' => $information['title'], 'href' => $this->url->link('information/information', 'information_id=' . $information['information_id']) ); } } // Brands $this->load->model('catalog/manufacturer'); $this->load->model('tool/image'); $this->data['manufacturer_top_menu'] = $this->config->get('config_manufacturer_top_menu'); $this->data['manufacturer_image'] = $this->config->get('config_manufacturer_image_top_menu'); $this->data['text_manufacturers'] = $this->language->get('text_manufacturers'); $this->data['manufacturers'] = array(); $manufacturers = $this->model_catalog_manufacturer->getManufacturers(); foreach ($manufacturers as $manufacturer) { if ($manufacturer['image']) { $image = $manufacturer['image']; } else { $image = 'no_image.jpg'; } $this->data['manufacturers'][] = array( 'name' => $manufacturer['name'], 'image' => $this->model_tool_image->resize($image, 20, 20), 'href' => $this->url->link('product/manufacturer/info', 'manufacturer_id=' . $manufacturer['manufacturer_id']) ); } // Contacts $this->data['contacts_display'] = html_entity_decode($this->config->get('config_contacts_display')); $this->data['contacts_address'] = html_entity_decode($this->config->get('config_address')); $this->data['contacts_email'] = html_entity_decode($this->config->get('config_email')); $this->data['contacts_telephone'] = html_entity_decode($this->config->get('config_telephone')); $this->data['contacts_mobile_telephone'] = html_entity_decode($this->config->get('config_mobile_telephone')); $this->data['contacts_fax'] = html_entity_decode($this->config->get('config_fax')); $this->data['text_contact'] = $this->language->get('text_contact'); $this->data['text_address'] = $this->language->get('text_address'); $this->data['text_email_address'] = $this->language->get('text_email_address'); $this->data['text_telephone'] = $this->language->get('text_telephone'); $this->data['text_mobile_telephone'] = $this->language->get('text_mobile_telephone'); $this->data['text_fax'] = $this->language->get('text_fax'); $this->children = array( 'module/language', 'module/currency', 'module/menu', 'module/cart' ); if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/common/header.tpl')) { $this->template = $this->config->get('config_template') . '/template/common/header.tpl'; } else { $this->template = 'default/template/common/header.tpl'; } $this->render(); } }?>
Не контроллера, а /catalog/view/theme/..../common/header.tpl. Там где ... - ваша тема. смотреть в админке - система - настройки - изменить - вкладка Витрина. Строка Шаблон магазина
Тогда вот. PHP: <!DOCTYPE html><html dir="<?php echo $direction; ?>" lang="<?php echo $lang; ?>"><head><meta charset="UTF-8" /><title><?php echo $title; ?></title><base href="<?php echo $base; ?>" /><?php if ($description) { ?><meta name="description" content="<?php echo $description; ?>" /><?php } ?><?php if ($keywords) { ?><meta name="keywords" content="<?php echo $keywords; ?>" /><?php } ?><?php if ($icon) { ?><link href="<?php echo $icon; ?>" rel="icon" /><?php } ?><?php foreach ($links as $link) { ?><link href="<?php echo $link['href']; ?>" rel="<?php echo $link['rel']; ?>" /><?php } ?><link rel="stylesheet" type="text/css" href="catalog/view/theme/default/stylesheet/stylesheet.css" /><link rel="stylesheet" type="text/css" href="catalog/view/theme/default/stylesheet/cloud-zoom.css" /><link rel="stylesheet" type="text/css" href="catalog/view/javascript/jquery/prettyPhoto/prettyPhoto.css" /><link rel="stylesheet" type="text/css" href="catalog/view/javascript/jquery/poshytip/src/tip-twitter/tip-twitter.css" /><?php foreach ($styles as $style) { ?><link rel="<?php echo $style['rel']; ?>" type="text/css" href="<?php echo $style['href']; ?>" media="<?php echo $style['media']; ?>" /><?php } ?><script type="text/javascript" src="catalog/view/javascript/jquery/jquery-1.7.1.min.js"></script><script type="text/javascript" src="catalog/view/javascript/jquery/ui/jquery-ui-1.8.16.custom.min.js"></script><link rel="stylesheet" type="text/css" href="catalog/view/javascript/jquery/ui/themes/ui-lightness/jquery-ui-1.8.16.custom.css" /><script type="text/javascript" src="catalog/view/javascript/common.js"></script><script type="text/javascript" src="catalog/view/javascript/cloud-zoom.1.0.2.js"></script><script type="text/javascript" src="catalog/view/javascript/jquery/prettyPhoto/jquery.prettyPhoto.js"></script><script type="text/javascript" src="catalog/view/javascript/jquery/poshytip/src/jquery.poshytip.min.js"></script><?php if ($quick_search) { ?><script type="text/javascript" src="catalog/view/javascript/quick_search.js"></script><?php } ?><?php foreach ($scripts as $script) { ?><script type="text/javascript" src="<?php echo $script; ?>"></script><?php } ?><!--[if IE 7]><link rel="stylesheet" type="text/css" href="catalog/view/theme/default/stylesheet/ie7.css" /><![endif]--><?php if ($stores) { ?><script type="text/javascript"><!--$(document).ready(function() {<?php foreach ($stores as $store) { ?>$('body').prepend('<iframe src="<?php echo $store; ?>" style="display: none;"></iframe>');<?php } ?>});//--></script><?php } ?><?php echo $google_analytics; ?></head><body> <div id="container"> <div id="header"> <div id="top"> <div id="welcome"> <?php if (!$logged) { ?> <?php echo $text_welcome; ?> <?php } else { ?> <?php echo $text_logged; ?> <?php } ?> </div> <div class="links"><a href="<?php echo $home; ?>"><?php echo $text_home; ?></a><a href="<?php echo $wishlist; ?>" id="wishlist-total"><?php echo $text_wishlist; ?></a><a href="<?php echo $shopping_cart; ?>"><?php echo $text_shopping_cart; ?></a><a href="<?php echo $checkout; ?>"><?php echo $text_checkout; ?></a></div> </div> <?php if (($contacts_display == 'header') || ($contacts_display == 'header_footer')) { ?> <div class="header_information"> <?php if ($contacts_address) { ?> <div class="header_address"><?php echo $contacts_address; ?></div> <?php } ?> <?php if ($contacts_telephone) { ?> <div class="header_telephone"><?php echo $contacts_telephone; ?></div> <?php } ?> <?php if ($contacts_mobile_telephone) { ?> <div class="contact"><span class="contact-data"><?php echo $contacts_mobile_telephone; ?></span></div> <?php } ?> <?php if ($contacts_fax) { ?> <div class="contact"><span class="contact-data"><?php echo $contacts_fax; ?></span></div> <?php } ?> <?php if ($contacts_email) { ?> <div class="header_email"><a href="mailto:<?php echo $contacts_email; ?>"><?php echo $contacts_email; ?></a></div> <?php } ?> </div> <?php } ?> <?php echo $language; ?> <?php // echo $currency; ?> <?php if ($logo) { ?> <div id="logo"><a href="<?php echo $home; ?>"><img src="<?php echo $logo; ?>" title="<?php echo $name; ?>" alt="<?php echo $name; ?>" /></a></div> <?php } ?> <div id="art-flash-container"><object classid="clsid:biggrin:27CDB6E-AE6D-11cf-96B8-444553540000" width="390" height="190" id="art-flash-object"> <param name="movie" value="image/flash.swf" /> <param name="quality" value="high" /> <param name="scale" value="exactfit" /> <param name="wmode" value="transparent" /> <param name="swfliveconnect" value="true" /> <!--[if !IE]>--> <object type="application/x-shockwave-flash" data="image/flash.swf" width="1360" height="340"> <param name="quality" value="high" /> <param name="scale" value="exactfit" /> <param name="wmode" value="transparent" /> <param name="flashvars" value="color1=0xFFFFFF&alpha1=.50&framerate1=14&loop=true" /> <param name="swfliveconnect" value="true" /> <!--<![endif]--> <div class="art-flash-alt"><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></div> <!--[if !IE]>--> </object> <!--<![endif]--></object></div> <?php echo $cart; ?> <!-- div id="search"> <div class="button-search"></div> <input type="text" name="search" placeholder="<?php echo $text_search; ?>" value="<?php echo $search; ?>" /> </div--> </div> <?php if ($informations) { ?> <div class="dropdown-block"> <ul class="top-menu"> <?php foreach ($informations as $information) { ?> <li<?php echo ($information['href'] == $current_page)?' class="active"':''; ?>><a href="<?php echo $information['href']; ?>"><?php echo $information['title']; ?></a></li> <?php } ?> <?php echo $menu; ?> <?php if ($all_news_top_menu == 'top_right') { ?> <li<?php echo ($all_news == $current_page)?' class="active"':''; ?>><a href="<?php echo $all_news; ?>"><?php echo $text_all_news; ?></a></li> <?php } ?> <li<?php echo ($contact == $current_page)?' class="active"':''; ?>><a href="<?php echo $contact; ?>"><?php echo $text_contact; ?></a></li> </ul> </div> <?php } ?> <?php /* if ($categories) { ?> <div id="menu"> <ul> <li><a class="home" href="<?php echo $home; ?>"></a></li> <?php if ($all_news_top_menu == 'top_left') { ?> <li><a href="<?php echo $all_news; ?>"><?php echo $text_all_news; ?></a></li> <?php } ?> <?php foreach ($categories as $category) { ?> <li class="dropdown"><a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a> <?php if ($category['children']) { ?> <div class="dropdown-block"> <?php for ($i = 0; $i < count($category['children']):wink: { ?> <ul> <?php $j = $i + ceil(count($category['children']) / $category['column']); ?> <?php for (; $i < $j; $i++) { ?> <?php if (isset($category['children'][$i])) { ?> <li class="dropdown-level"> <?php $levels_2 = $this->model_catalog_category->getCategories($category['children'][$i]['category_id']); ?> <?php if($levels_2) { ?> <a href="<?php echo $category['children'][$i]['href']; ?>"><?php echo $category['children'][$i]['name']; ?><span class="parent"></span></a> <div class="dropdown-block-level"> <ul> <?php foreach ($levels_2 as $level_2) { ?> <li><a href="<?php echo $this->url->link('product/category', 'path='.$category['category_id'].'_' . $category['children'][$i]['category_id'] . '_' . $level_2['category_id']); ?>"><?php echo $level_2['name']; ?></a></li> <?php } ?> </ul> </div> <?php } else { ?> <a href="<?php echo $category['children'][$i]['href']; ?>"><?php echo $category['children'][$i]['name']; ?></a> <?php } ?> </li> <?php } ?> <?php } ?> </ul> <?php } ?> </div> <?php } ?> </li> <?php } ?> <?php echo $menu; ?> <?php if ($all_news_top_menu == 'top_right') { ?> <li><a href="<?php echo $all_news; ?>"><?php echo $text_all_news; ?></a></li> <?php } ?> </ul> </div> <?php } */ ?> <div class="clear"></div> <div id="notification"></div> <div id="wrapper">
Найдите <!-- div id="search"> <div class="button-search"></div> <input type="text" name="search" placeholder="<?php echo $text_search; ?>" value="<?php echo $search; ?>" /> </div--> Уберите <!-- и -->.
Сделал. Появился поиск, только наползает на тексты с телефоном и адресов почты в шапке. И категории всплывающие почему-то не все в менюшке. ЗЫ. Пробовал вставлять вместо этого фрагмента Ваш код. Тоже наползает, и после ввода какого-то слова в поиске открывается новая страница с нормальным поиском по категориям. И там уже все работает. Значит сам-то поиск где-то сидит и вполне себе функционирует.
Это stylesheet.css ? "Просто" это для Вас, для меня - если можно строчки укажите и что на что менять.
Тут, во-первых, надо видеть, что меняешь - нужна ссылка на сайт. во-вторых, нарисовать тоже можно по-разному
Вот ссылка: www.prima-porte.ru Хотелось бы, чтобы писк был как в обычных дефолтных шаблонах, а располагался между адресом почты и верхним меню.
Между адресом почты и верхним меню еще есть телефон и заголовок. Тут надо доступ по фтп, чтобы все редактировать и сразу смотреть, что получилось. Договаривайтесь с теми, кто делал сайт, ищите фрилансера или пишите в личку, договоримся.