Jump to content
  • разработка интернет магазинов на opencart
  • доработка интернет магазинов на opencart

Как добавить пункт в меню в мобильной версии?


Recommended Posts

Добрый гдень, есть сайт https://decowine.ru/, в меню в мобильной версии очень нужен разгдел коникты. Искал в редактировании макеи, им только версия для ПК, мобильной версии нет, подозреваю что код для мобильной версии написан отгдельно в файле модуля. Но я понятия не имею что в когде изменить или добавить дабы отображался разгдел коникты.

Код из модуля "catalog/controller/extention/module\ochozmegamenu.php

<?php
class ControllerExtensionModuleOchozmegamenu extends Controller {
	public function index($setting) { 
		$this->language->load('extension/module/ochozmegamenu');

		$this->load->model('catalog/category');
		$this->load->model('tool/image');
		$this->load->model('hozmegamenu/menu');

		$data = array();

      	$data['heading_title'] = $this->language->get('heading_title');

		$mobile = $this->model_hozmegamenu_menu->getblockCategTree();
		$html  = null;
		$html .='<ul id="ma-mobilemenu" class="mobilemenu nav-collapse collapse">';

			foreach($mobile['children'] as $m) {
				//echo "<pre>"; print_r($m); echo "</pre>";
				if(!isset($m["name"])) $m["name"] = 'Root';
				//echo "<pre>"; print_r($m); echo "</pre>";
				$child_class = '';
				if(count($m['children'])>0) { $child_class = 'collapse1';} else {
					$child_class = 'no-close';
				}

				$html .='<li><span class=" button-view1 '.$child_class.'"><a href="'. $this->url->link('product/category', "path=".$m['id']).'">'.$m["name"].'</a></span>';

						if(isset($m['children'])) {
							//echo "<pre>"; print_r($m); echo "</pre>";
							$sub1 = $m['children'] ;
							$html .='<ul class="level2">';
								if(isset($sub1)) {
									foreach($sub1 as $child1) {
										if(count($child1['children'])>0) { $child_class = 'collapse1';} else {
											$child_class = 'no-close';
										}
										$html .='<li><span class="button-view2   '.$child_class.'"><a href="'. $this->url->link('product/category', "path=".$child1['id']).'">'.$child1["name"].'</a></span>';
										if(isset($child1['children'])) {
										  $html .='<ul class="level3">';

											$sub2 = $child1['children'] ;
											foreach($sub2 as $child2) {
												if(count($child2['children'])>0) { $child_class = 'collapse1';} else {
													$child_class = 'no-close';
												}
												$html .='<li><span class="  '.$child_class.'"><a href="'. $this->url->link('product/category', "path=".$child2['id']).'">'.$child2["name"].'</a></span></li>';
											}
										  $html .='</ul>';

										}
										$html .='</li>';
									}
								}
							$html .='</ul>';

						}
				$html .='</li>';
			}
		$html .='</ul>'	;
		
		$lang_id = (int)$this->config->get('config_language_id');
		$top_menu = $this->model_hozmegamenu_menu->getMenuCustomerLink($lang_id,$setting) ;
		$data['hozmegamenu'] = $top_menu;
		$data['top_offset'] = 70; 
		$data['effect'] = 0; 
		$data['_menu'] = $html; 
		
		$this->document->addScript('catalog/view/javascript/opentheme/hozmegamenu/custommenu.js');
		$this->document->addScript('catalog/view/javascript/opentheme/hozmegamenu/mobile_menu.js');
		if (file_exists(DIR_TEMPLATE . $this->config->get($this->config->get('config_theme') . '_directory') . '/stylesheet/opentheme/hozmegamenu/css/custommenu.css')) {
			$this->document->addStyle('catalog/view/theme/'.$this->config->get($this->config->get('config_theme') . '_directory').'/stylesheet/opentheme/hozmegamenu/css/custommenu.css');
		} else {
			$this->document->addStyle('catalog/view/theme/default/stylesheet/opentheme/hozmegamenu/css/custommenu.css');
		}

		return $this->load->view('extension/module/ochozmegamenu', $data);
		
	}
}
?>

Подскажите пожалуйси как добавить коникты в меню в мобильной версии сайи?

Link to comment
Share on other sites


14 минут назад, Vladimir1982 сказал:

Добрый гдень, есть сайт https://decowine.ru/, в меню в мобильной версии очень нужен разгдел коникты. Искал в редактировании макеи, им только версия для ПК, мобильной версии нет, подозреваю что код для мобильной версии написан отгдельно в файле модуля. Но я понятия не имею что в когде изменить или добавить дабы отображался разгдел коникты.

Код из модуля "catalog/controller/extention/module\ochozmegamenu.php

Подскажите пожалуйси как добавить коникты в меню в мобильной версии сайи?

 

В настройках шаблона или модулях смотрите, у них есть настройки для mega menu и mobile menu

Link to comment
Share on other sites


37 минут назад, twinz сказал:

перед

$html .='</ul>' ;

добавить

$html .='<li class="visible-xs"><a href="ССЫЛКА">Коникты</a></li>' ;

 

Спасипотому что за ответ, немного изменил описанный Вами код, сгделал как у меня было в пунких выше и зарилиило

$html .='<li><span class="button-view1"><a href="https://decowine.ru/contact-us">Коникты</a></li>' ;

 

Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.