Перейти до вмісту
Пошук в
  • Детальніше...
Шукати результати, які ...
Шукати результати в ...

Recommended Posts

Пытаюсь создать свой шаблон в OpencartCMS 2.3

Проделал такие действия.

Создал папку catalog/view/theme/mytheme

Туда закинул файлы из папки default, в общем стандартные файлы шаблона

В админке по такому же принципу создал файлы

admin/controller/extension/theme/theme_mytheme.php

admin/language/ru-ru/extension/theme/theme_mytheme.php

admin/view/template/extension/theme/theme_mytheme.tpl

Все соответствующие замены сделал. Вот код контроллера:
 

Спойлер

<?php
class ControllerExtensionThemeThemeMytheme extends Controller {
	private $error = array();

	public function index() {
		$this->load->language('extension/theme/theme_mytheme');

		$this->document->setTitle($this->language->get('heading_title'));

		$this->load->model('setting/setting');

		if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
			$this->model_setting_setting->editSetting('theme_mytheme', $this->request->post, $this->request->get['store_id']);

			$this->session->data['success'] = $this->language->get('text_success');

			$this->response->redirect($this->url->link('extension/extension', 'token=' . $this->session->data['token'] . '&type=theme', true));
		}

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

		$data['text_edit'] = $this->language->get('text_edit');
		$data['text_enabled'] = $this->language->get('text_enabled');
		$data['text_disabled'] = $this->language->get('text_disabled');
		$data['text_product'] = $this->language->get('text_product');
		$data['text_image'] = $this->language->get('text_image');
		$data['text_general'] = $this->language->get('text_general');
		
		$data['entry_directory'] = $this->language->get('entry_directory');
		$data['entry_status'] = $this->language->get('entry_status');		
		$data['entry_product_limit'] = $this->language->get('entry_product_limit');
		$data['entry_product_description_length'] = $this->language->get('entry_product_description_length');
		$data['entry_image_category'] = $this->language->get('entry_image_category');
		$data['entry_image_thumb'] = $this->language->get('entry_image_thumb');
		$data['entry_image_popup'] = $this->language->get('entry_image_popup');
		$data['entry_image_product'] = $this->language->get('entry_image_product');
		$data['entry_image_additional'] = $this->language->get('entry_image_additional');
		$data['entry_image_related'] = $this->language->get('entry_image_related');
		$data['entry_image_compare'] = $this->language->get('entry_image_compare');
		$data['entry_image_wishlist'] = $this->language->get('entry_image_wishlist');
		$data['entry_image_cart'] = $this->language->get('entry_image_cart');
		$data['entry_image_location'] = $this->language->get('entry_image_location');
		$data['entry_width'] = $this->language->get('entry_width');
		$data['entry_height'] = $this->language->get('entry_height');
		
		$data['help_product_limit'] = $this->language->get('help_product_limit');
		$data['help_product_description_length'] = $this->language->get('help_product_description_length');
		$data['help_directory'] = $this->language->get('help_directory');

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

		if (isset($this->error['warning'])) {
			$data['error_warning'] = $this->error['warning'];
		} else {
			$data['error_warning'] = '';
		}

		if (isset($this->error['product_limit'])) {
			$data['error_product_limit'] = $this->error['product_limit'];
		} else {
			$data['error_product_limit'] = '';
		}

		if (isset($this->error['product_description_length'])) {
			$data['error_product_description_length'] = $this->error['product_description_length'];
		} else {
			$data['error_product_description_length'] = '';
		}

		if (isset($this->error['image_category'])) {
			$data['error_image_category'] = $this->error['image_category'];
		} else {
			$data['error_image_category'] = '';
		}

		if (isset($this->error['image_thumb'])) {
			$data['error_image_thumb'] = $this->error['image_thumb'];
		} else {
			$data['error_image_thumb'] = '';
		}

		if (isset($this->error['image_popup'])) {
			$data['error_image_popup'] = $this->error['image_popup'];
		} else {
			$data['error_image_popup'] = '';
		}

		if (isset($this->error['image_product'])) {
			$data['error_image_product'] = $this->error['image_product'];
		} else {
			$data['error_image_product'] = '';
		}

		if (isset($this->error['image_additional'])) {
			$data['error_image_additional'] = $this->error['image_additional'];
		} else {
			$data['error_image_additional'] = '';
		}

		if (isset($this->error['image_related'])) {
			$data['error_image_related'] = $this->error['image_related'];
		} else {
			$data['error_image_related'] = '';
		}

		if (isset($this->error['image_compare'])) {
			$data['error_image_compare'] = $this->error['image_compare'];
		} else {
			$data['error_image_compare'] = '';
		}

		if (isset($this->error['image_wishlist'])) {
			$data['error_image_wishlist'] = $this->error['image_wishlist'];
		} else {
			$data['error_image_wishlist'] = '';
		}

		if (isset($this->error['image_cart'])) {
			$data['error_image_cart'] = $this->error['image_cart'];
		} else {
			$data['error_image_cart'] = '';
		}

		if (isset($this->error['image_location'])) {
			$data['error_image_location'] = $this->error['image_location'];
		} else {
			$data['error_image_location'] = '';
		}
		
		$data['breadcrumbs'] = array();

		$data['breadcrumbs'][] = array(
			'text' => $this->language->get('text_home'),
			'href' => $this->url->link('common/dashboard', 'token=' . $this->session->data['token'], true)
		);

		$data['breadcrumbs'][] = array(
			'text' => $this->language->get('text_extension'),
			'href' => $this->url->link('extension/extension', 'token=' . $this->session->data['token'] . '&type=theme', true)
		);

		$data['breadcrumbs'][] = array(
			'text' => $this->language->get('heading_title'),
			'href' => $this->url->link('extension/theme/theme_mytheme', 'token=' . $this->session->data['token'] . '&store_id=' . $this->request->get['store_id'], true)
		);

		$data['action'] = $this->url->link('extension/theme/theme_mytheme', 'token=' . $this->session->data['token'] . '&store_id=' . $this->request->get['store_id'], true);

		$data['cancel'] = $this->url->link('extension/extension', 'token=' . $this->session->data['token'] . '&type=theme', true);

		if (isset($this->request->get['store_id']) && ($this->request->server['REQUEST_METHOD'] != 'POST')) {
			$setting_info = $this->model_setting_setting->getSetting('theme_mytheme', $this->request->get['store_id']);
		}
		
		if (isset($this->request->post['theme_mytheme_directory'])) {
			$data['theme_mytheme_directory'] = $this->request->post['theme_mytheme_directory'];
		} elseif (isset($setting_info['theme_mytheme_directory'])) {
			$data['theme_mytheme_directory'] = $setting_info['theme_mytheme_directory'];
		} else {
			$data['theme_mytheme_directory'] = 'default';
		}		

		$data['directories'] = array();

		$directories = glob(DIR_CATALOG . 'view/theme/*', GLOB_ONLYDIR);

		foreach ($directories as $directory) {
			$data['directories'][] = basename($directory);
		}

		if (isset($this->request->post['theme_mytheme_product_limit'])) {
			$data['theme_mytheme_product_limit'] = $this->request->post['theme_mytheme_product_limit'];
		} elseif (isset($setting_info['theme_mytheme_product_limit'])) {
			$data['theme_mytheme_product_limit'] = $setting_info['theme_mytheme_product_limit'];
		} else {
			$data['theme_mytheme_product_limit'] = 15;
		}		
		
		if (isset($this->request->post['theme_mytheme_status'])) {
			$data['theme_mytheme_status'] = $this->request->post['theme_mytheme_status'];
		} elseif (isset($setting_info['theme_mytheme_status'])) {
			$data['theme_mytheme_status'] = $this->config->get('theme_mytheme_status');
		} else {
			$data['theme_mytheme_status'] = '';
		}
		
		if (isset($this->request->post['theme_mytheme_product_description_length'])) {
			$data['theme_mytheme_product_description_length'] = $this->request->post['theme_mytheme_product_description_length'];
		} elseif (isset($setting_info['theme_mytheme_product_description_length'])) {
			$data['theme_mytheme_product_description_length'] = $this->config->get('theme_mytheme_product_description_length');
		} else {
			$data['theme_mytheme_product_description_length'] = 100;
		}
		
		if (isset($this->request->post['theme_mytheme_image_category_width'])) {
			$data['theme_mytheme_image_category_width'] = $this->request->post['theme_mytheme_image_category_width'];
		} elseif (isset($setting_info['theme_mytheme_image_category_width'])) {
			$data['theme_mytheme_image_category_width'] = $this->config->get('theme_mytheme_image_category_width');
		} else {
			$data['theme_mytheme_image_category_width'] = 80;		
		}
		
		if (isset($this->request->post['theme_mytheme_image_category_height'])) {
			$data['theme_mytheme_image_category_height'] = $this->request->post['theme_mytheme_image_category_height'];
		} elseif (isset($setting_info['theme_mytheme_image_category_height'])) {
			$data['theme_mytheme_image_category_height'] = $this->config->get('theme_mytheme_image_category_height');
		} else {
			$data['theme_mytheme_image_category_height'] = 80;
		}
		
		if (isset($this->request->post['theme_mytheme_image_thumb_width'])) {
			$data['theme_mytheme_image_thumb_width'] = $this->request->post['theme_mytheme_image_thumb_width'];
		} elseif (isset($setting_info['theme_mytheme_image_thumb_width'])) {
			$data['theme_mytheme_image_thumb_width'] = $this->config->get('theme_mytheme_image_thumb_width');
		} else {
			$data['theme_mytheme_image_thumb_width'] = 228;
		}
		
		if (isset($this->request->post['theme_mytheme_image_thumb_height'])) {
			$data['theme_mytheme_image_thumb_height'] = $this->request->post['theme_mytheme_image_thumb_height'];
		} elseif (isset($setting_info['theme_mytheme_image_thumb_height'])) {
			$data['theme_mytheme_image_thumb_height'] = $this->config->get('theme_mytheme_image_thumb_height');
		} else {
			$data['theme_mytheme_image_thumb_height'] = 228;		
		}
		
		if (isset($this->request->post['theme_mytheme_image_popup_width'])) {
			$data['theme_mytheme_image_popup_width'] = $this->request->post['theme_mytheme_image_popup_width'];
		} elseif (isset($setting_info['theme_mytheme_image_popup_width'])) {
			$data['theme_mytheme_image_popup_width'] = $this->config->get('theme_mytheme_image_popup_width');
		} else {
			$data['theme_mytheme_image_popup_width'] = 500;
		}
		
		if (isset($this->request->post['theme_mytheme_image_popup_height'])) {
			$data['theme_mytheme_image_popup_height'] = $this->request->post['theme_mytheme_image_popup_height'];
		} elseif (isset($setting_info['theme_mytheme_image_popup_height'])) {
			$data['theme_mytheme_image_popup_height'] = $this->config->get('theme_mytheme_image_popup_height');
		} else {
			$data['theme_mytheme_image_popup_height'] = 500;
		}
		
		if (isset($this->request->post['theme_mytheme_image_product_width'])) {
			$data['theme_mytheme_image_product_width'] = $this->request->post['theme_mytheme_image_product_width'];
		} elseif (isset($setting_info['theme_mytheme_image_product_width'])) {
			$data['theme_mytheme_image_product_width'] = $this->config->get('theme_mytheme_image_product_width');
		} else {
			$data['theme_mytheme_image_product_width'] = 228;
		}
		
		if (isset($this->request->post['theme_mytheme_image_product_height'])) {
			$data['theme_mytheme_image_product_height'] = $this->request->post['theme_mytheme_image_product_height'];
		} elseif (isset($setting_info['theme_mytheme_image_product_height'])) {
			$data['theme_mytheme_image_product_height'] = $this->config->get('theme_mytheme_image_product_height');
		} else {
			$data['theme_mytheme_image_product_height'] = 228;
		}
		
		if (isset($this->request->post['theme_mytheme_image_additional_width'])) {
			$data['theme_mytheme_image_additional_width'] = $this->request->post['theme_mytheme_image_additional_width'];
		} elseif (isset($setting_info['theme_mytheme_image_additional_width'])) {
			$data['theme_mytheme_image_additional_width'] = $this->config->get('theme_mytheme_image_additional_width');
		} else {
			$data['theme_mytheme_image_additional_width'] = 74;
		}
		
		if (isset($this->request->post['theme_mytheme_image_additional_height'])) {
			$data['theme_mytheme_image_additional_height'] = $this->request->post['theme_mytheme_image_additional_height'];
		} elseif (isset($setting_info['theme_mytheme_image_additional_height'])) {
			$data['theme_mytheme_image_additional_height'] = $this->config->get('theme_mytheme_image_additional_height');
		} else {
			$data['theme_mytheme_image_additional_height'] = 74;
		}
		
		if (isset($this->request->post['theme_mytheme_image_related_width'])) {
			$data['theme_mytheme_image_related_width'] = $this->request->post['theme_mytheme_image_related_width'];
		} elseif (isset($setting_info['theme_mytheme_image_related_width'])) {
			$data['theme_mytheme_image_related_width'] = $this->config->get('theme_mytheme_image_related_width');
		} else {
			$data['theme_mytheme_image_related_width'] = 80;
		}
		
		if (isset($this->request->post['theme_mytheme_image_related_height'])) {
			$data['theme_mytheme_image_related_height'] = $this->request->post['theme_mytheme_image_related_height'];
		} elseif (isset($setting_info['theme_mytheme_image_related_height'])) {
			$data['theme_mytheme_image_related_height'] = $this->config->get('theme_mytheme_image_related_height');
		} else {
			$data['theme_mytheme_image_related_height'] = 80;
		}
		
		if (isset($this->request->post['theme_mytheme_image_compare_width'])) {
			$data['theme_mytheme_image_compare_width'] = $this->request->post['theme_mytheme_image_compare_width'];
		} elseif (isset($setting_info['theme_mytheme_image_compare_width'])) {
			$data['theme_mytheme_image_compare_width'] = $this->config->get('theme_mytheme_image_compare_width');
		} else {
			$data['theme_mytheme_image_compare_width'] = 90;
		}
		
		if (isset($this->request->post['theme_mytheme_image_compare_height'])) {
			$data['theme_mytheme_image_compare_height'] = $this->request->post['theme_mytheme_image_compare_height'];
		} elseif (isset($setting_info['theme_mytheme_image_compare_height'])) {
			$data['theme_mytheme_image_compare_height'] = $this->config->get('theme_mytheme_image_compare_height');
		} else {
			$data['theme_mytheme_image_compare_height'] = 90;
		}
		
		if (isset($this->request->post['theme_mytheme_image_wishlist_width'])) {
			$data['theme_mytheme_image_wishlist_width'] = $this->request->post['theme_mytheme_image_wishlist_width'];
		} elseif (isset($setting_info['theme_mytheme_image_wishlist_width'])) {
			$data['theme_mytheme_image_wishlist_width'] = $this->config->get('theme_mytheme_image_wishlist_width');
		} else {
			$data['theme_mytheme_image_wishlist_width'] = 47;
		}
		
		if (isset($this->request->post['theme_mytheme_image_wishlist_height'])) {
			$data['theme_mytheme_image_wishlist_height'] = $this->request->post['theme_mytheme_image_wishlist_height'];
		} elseif (isset($setting_info['theme_mytheme_image_wishlist_height'])) {
			$data['theme_mytheme_image_wishlist_height'] = $this->config->get('theme_mytheme_image_wishlist_height');
		} else {
			$data['theme_mytheme_image_wishlist_height'] = 47;
		}
		
		if (isset($this->request->post['theme_mytheme_image_cart_width'])) {
			$data['theme_mytheme_image_cart_width'] = $this->request->post['theme_mytheme_image_cart_width'];
		} elseif (isset($setting_info['theme_mytheme_image_cart_width'])) {
			$data['theme_mytheme_image_cart_width'] = $this->config->get('theme_mytheme_image_cart_width');
		} else {
			$data['theme_mytheme_image_cart_width'] = 47;
		}
		
		if (isset($this->request->post['theme_mytheme_image_cart_height'])) {
			$data['theme_mytheme_image_cart_height'] = $this->request->post['theme_mytheme_image_cart_height'];
		} elseif (isset($setting_info['theme_mytheme_image_cart_height'])) {
			$data['theme_mytheme_image_cart_height'] = $this->config->get('theme_mytheme_image_cart_height');
		} else {
			$data['theme_mytheme_image_cart_height'] = 47;
		}
		
		if (isset($this->request->post['theme_mytheme_image_location_width'])) {
			$data['theme_mytheme_image_location_width'] = $this->request->post['theme_mytheme_image_location_width'];
		} elseif (isset($setting_info['theme_mytheme_image_location_width'])) {
			$data['theme_mytheme_image_location_width'] = $this->config->get('theme_mytheme_image_location_width');
		} else {
			$data['theme_mytheme_image_location_width'] = 268;
		}
		
		if (isset($this->request->post['theme_mytheme_image_location_height'])) {
			$data['theme_mytheme_image_location_height'] = $this->request->post['theme_mytheme_image_location_height'];
		} elseif (isset($setting_info['theme_mytheme_image_location_height'])) {
			$data['theme_mytheme_image_location_height'] = $this->config->get('theme_mytheme_image_location_height');
		} else {
			$data['theme_mytheme_image_location_height'] = 50;
		}
		
		$data['header'] = $this->load->controller('common/header');
		$data['column_left'] = $this->load->controller('common/column_left');
		$data['footer'] = $this->load->controller('common/footer');

		$this->response->setOutput($this->load->view('extension/theme/theme_mytheme', $data));
	}

	protected function validate() {
		if (!$this->user->hasPermission('modify', 'extension/theme/theme_mytheme')) {
			$this->error['warning'] = $this->language->get('error_permission');
		}

		if (!$this->request->post['theme_mytheme_product_limit']) {
			$this->error['product_limit'] = $this->language->get('error_limit');
		}

		if (!$this->request->post['theme_mytheme_product_description_length']) {
			$this->error['product_description_length'] = $this->language->get('error_limit');
		}

		if (!$this->request->post['theme_mytheme_image_category_width'] || !$this->request->post['theme_mytheme_image_category_height']) {
			$this->error['image_category'] = $this->language->get('error_image_category');
		}

		if (!$this->request->post['theme_mytheme_image_thumb_width'] || !$this->request->post['theme_mytheme_image_thumb_height']) {
			$this->error['image_thumb'] = $this->language->get('error_image_thumb');
		}

		if (!$this->request->post['theme_mytheme_image_popup_width'] || !$this->request->post['theme_mytheme_image_popup_height']) {
			$this->error['image_popup'] = $this->language->get('error_image_popup');
		}

		if (!$this->request->post['theme_mytheme_image_product_width'] || !$this->request->post['theme_mytheme_image_product_height']) {
			$this->error['image_product'] = $this->language->get('error_image_product');
		}

		if (!$this->request->post['theme_mytheme_image_additional_width'] || !$this->request->post['theme_mytheme_image_additional_height']) {
			$this->error['image_additional'] = $this->language->get('error_image_additional');
		}

		if (!$this->request->post['theme_mytheme_image_related_width'] || !$this->request->post['theme_mytheme_image_related_height']) {
			$this->error['image_related'] = $this->language->get('error_image_related');
		}

		if (!$this->request->post['theme_mytheme_image_compare_width'] || !$this->request->post['theme_mytheme_image_compare_height']) {
			$this->error['image_compare'] = $this->language->get('error_image_compare');
		}

		if (!$this->request->post['theme_mytheme_image_wishlist_width'] || !$this->request->post['theme_mytheme_image_wishlist_height']) {
			$this->error['image_wishlist'] = $this->language->get('error_image_wishlist');
		}

		if (!$this->request->post['theme_mytheme_image_cart_width'] || !$this->request->post['theme_mytheme_image_cart_height']) {
			$this->error['image_cart'] = $this->language->get('error_image_cart');
		}

		if (!$this->request->post['theme_mytheme_image_location_width'] || !$this->request->post['theme_mytheme_image_location_height']) {
			$this->error['image_location'] = $this->language->get('error_image_location');
		}

		return !$this->error;
	}
}

 

А вот код tpl файла

Спойлер

 


<?php echo $header; ?><?php echo $column_left; ?>
<div id="content">
  <div class="page-header">
    <div class="container-fluid">
      <div class="pull-right">
        <button type="submit" form="form-theme-mytheme" data-toggle="tooltip" title="<?php echo $button_save; ?>" class="btn btn-primary"><i class="fa fa-save"></i></button>
        <a href="<?php echo $cancel; ?>" data-toggle="tooltip" title="<?php echo $button_cancel; ?>" class="btn btn-default"><i class="fa fa-reply"></i></a></div>
      <h1><?php echo $heading_title; ?></h1>
      <ul class="breadcrumb">
        <?php foreach ($breadcrumbs as $breadcrumb) { ?>
        <li><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a></li>
        <?php } ?>
      </ul>
    </div>
  </div>
  <div class="container-fluid">
    <?php if ($error_warning) { ?>
    <div class="alert alert-danger"><i class="fa fa-exclamation-circle"></i> <?php echo $error_warning; ?>
      <button type="button" class="close" data-dismiss="alert">&times;</button>
    </div>
    <?php } ?>
    <div class="panel panel-default">
      <div class="panel-heading">
        <h3 class="panel-title"><i class="fa fa-pencil"></i> <?php echo $text_edit; ?></h3>
      </div>
      <div class="panel-body">
        <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" id="form-theme-mytheme" class="form-horizontal">
          <fieldset>
            <legend><?php echo $text_general; ?></legend>
            <div class="form-group">
              <label class="col-sm-2 control-label" for="input-directory"><span data-toggle="tooltip" title="<?php echo $help_directory; ?>"><?php echo $entry_directory; ?></span></label>
              <div class="col-sm-10">
                <select name="theme_mytheme_directory" id="input-directory" class="form-control">
                  <?php foreach ($directories as $directory) { ?>
                  <?php if ($directory == $theme_mytheme_directory) { ?>
                  <option value="<?php echo $directory; ?>" selected="selected"><?php echo $directory; ?></option>
                  <?php } else { ?>
                  <option value="<?php echo $directory; ?>"><?php echo $directory; ?></option>
                  <?php } ?>
                  <?php } ?>
                </select>
              </div>
            </div>
            <div class="form-group">
              <label class="col-sm-2 control-label" for="input-status"><?php echo $entry_status; ?></label>
              <div class="col-sm-10">
                <select name="theme_mytheme_status" id="input-status" class="form-control">
                  <?php if ($theme_mytheme_status) { ?>
                  <option value="1" selected="selected"><?php echo $text_enabled; ?></option>
                  <option value="0"><?php echo $text_disabled; ?></option>
                  <?php } else { ?>
                  <option value="1"><?php echo $text_enabled; ?></option>
                  <option value="0" selected="selected"><?php echo $text_disabled; ?></option>
                  <?php } ?>
                </select>
              </div>
            </div>
          </fieldset>
          <fieldset>
            <legend><?php echo $text_product; ?></legend>
            <div class="form-group required">
              <label class="col-sm-2 control-label" for="input-catalog-limit"><span data-toggle="tooltip" title="<?php echo $help_product_limit; ?>"><?php echo $entry_product_limit; ?></span></label>
              <div class="col-sm-10">
                <input type="text" name="theme_mytheme_product_limit" value="<?php echo $theme_mytheme_product_limit; ?>" placeholder="<?php echo $entry_product_limit; ?>" id="input-catalog-limit" class="form-control" />
                <?php if ($error_product_limit) { ?>
                <div class="text-danger"><?php echo $error_product_limit; ?></div>
                <?php } ?>
              </div>
            </div>
            <div class="form-group required">
              <label class="col-sm-2 control-label" for="input-description-limit"><span data-toggle="tooltip" title="<?php echo $help_product_description_length; ?>"><?php echo $entry_product_description_length; ?></span></label>
              <div class="col-sm-10">
                <input type="text" name="theme_mytheme_product_description_length" value="<?php echo $theme_mytheme_product_description_length; ?>" placeholder="<?php echo $entry_product_description_length; ?>" id="input-description-limit" class="form-control" />
                <?php if ($error_product_description_length) { ?>
                <div class="text-danger"><?php echo $error_product_description_length; ?></div>
                <?php } ?>
              </div>
            </div>
          </fieldset>
          <fieldset>
            <legend><?php echo $text_image; ?></legend>
            <div class="form-group required">
              <label class="col-sm-2 control-label" for="input-image-category-width"><?php echo $entry_image_category; ?></label>
              <div class="col-sm-10">
                <div class="row">
                  <div class="col-sm-6">
                    <input type="text" name="theme_mytheme_image_category_width" value="<?php echo $theme_mytheme_image_category_width; ?>" placeholder="<?php echo $entry_width; ?>" id="input-image-category-width" class="form-control" />
                  </div>
                  <div class="col-sm-6">
                    <input type="text" name="theme_mytheme_image_category_height" value="<?php echo $theme_mytheme_image_category_height; ?>" placeholder="<?php echo $entry_height; ?>" class="form-control" />
                  </div>
                </div>
                <?php if ($error_image_category) { ?>
                <div class="text-danger"><?php echo $error_image_category; ?></div>
                <?php } ?>
              </div>
            </div>
            <div class="form-group required">
              <label class="col-sm-2 control-label" for="input-image-thumb-width"><?php echo $entry_image_thumb; ?></label>
              <div class="col-sm-10">
                <div class="row">
                  <div class="col-sm-6">
                    <input type="text" name="theme_mytheme_image_thumb_width" value="<?php echo $theme_mytheme_image_thumb_width; ?>" placeholder="<?php echo $entry_width; ?>" id="input-image-thumb-width" class="form-control" />
                  </div>
                  <div class="col-sm-6">
                    <input type="text" name="theme_mytheme_image_thumb_height" value="<?php echo $theme_mytheme_image_thumb_height; ?>" placeholder="<?php echo $entry_height; ?>" class="form-control" />
                  </div>
                </div>
                <?php if ($error_image_thumb) { ?>
                <div class="text-danger"><?php echo $error_image_thumb; ?></div>
                <?php } ?>
              </div>
            </div>
            <div class="form-group required">
              <label class="col-sm-2 control-label" for="input-image-popup-width"><?php echo $entry_image_popup; ?></label>
              <div class="col-sm-10">
                <div class="row">
                  <div class="col-sm-6">
                    <input type="text" name="theme_mytheme_image_popup_width" value="<?php echo $theme_mytheme_image_popup_width; ?>" placeholder="<?php echo $entry_width; ?>" id="input-image-popup-width" class="form-control" />
                  </div>
                  <div class="col-sm-6">
                    <input type="text" name="theme_mytheme_image_popup_height" value="<?php echo $theme_mytheme_image_popup_height; ?>" placeholder="<?php echo $entry_height; ?>" class="form-control" />
                  </div>
                </div>
                <?php if ($error_image_popup) { ?>
                <div class="text-danger"><?php echo $error_image_popup; ?></div>
                <?php } ?>
              </div>
            </div>
            <div class="form-group required">
              <label class="col-sm-2 control-label" for="input-image-product-width"><?php echo $entry_image_product; ?></label>
              <div class="col-sm-10">
                <div class="row">
                  <div class="col-sm-6">
                    <input type="text" name="theme_mytheme_image_product_width" value="<?php echo $theme_mytheme_image_product_width; ?>" placeholder="<?php echo $entry_width; ?>" id="input-image-product-width" class="form-control" />
                  </div>
                  <div class="col-sm-6">
                    <input type="text" name="theme_mytheme_image_product_height" value="<?php echo $theme_mytheme_image_product_height; ?>" placeholder="<?php echo $entry_height; ?>" class="form-control" />
                  </div>
                </div>
                <?php if ($error_image_product) { ?>
                <div class="text-danger"><?php echo $error_image_product; ?></div>
                <?php } ?>
              </div>
            </div>
            <div class="form-group required">
              <label class="col-sm-2 control-label" for="input-image-additional-width"><?php echo $entry_image_additional; ?></label>
              <div class="col-sm-10">
                <div class="row">
                  <div class="col-sm-6">
                    <input type="text" name="theme_mytheme_image_additional_width" value="<?php echo $theme_mytheme_image_additional_width; ?>" placeholder="<?php echo $entry_width; ?>" id="input-image-additional-width" class="form-control" />
                  </div>
                  <div class="col-sm-6">
                    <input type="text" name="theme_mytheme_image_additional_height" value="<?php echo $theme_mytheme_image_additional_height; ?>" placeholder="<?php echo $entry_height; ?>" class="form-control" />
                  </div>
                </div>
                <?php if ($error_image_additional) { ?>
                <div class="text-danger"><?php echo $error_image_additional; ?></div>
                <?php } ?>
              </div>
            </div>
            <div class="form-group required">
              <label class="col-sm-2 control-label" for="input-image-related"><?php echo $entry_image_related; ?></label>
              <div class="col-sm-10">
                <div class="row">
                  <div class="col-sm-6">
                    <input type="text" name="theme_mytheme_image_related_width" value="<?php echo $theme_mytheme_image_related_width; ?>" placeholder="<?php echo $entry_width; ?>" id="input-image-related" class="form-control" />
                  </div>
                  <div class="col-sm-6">
                    <input type="text" name="theme_mytheme_image_related_height" value="<?php echo $theme_mytheme_image_related_height; ?>" placeholder="<?php echo $entry_height; ?>" class="form-control" />
                  </div>
                </div>
                <?php if ($error_image_related) { ?>
                <div class="text-danger"><?php echo $error_image_related; ?></div>
                <?php } ?>
              </div>
            </div>
            <div class="form-group required">
              <label class="col-sm-2 control-label" for="input-image-compare"><?php echo $entry_image_compare; ?></label>
              <div class="col-sm-10">
                <div class="row">
                  <div class="col-sm-6">
                    <input type="text" name="theme_mytheme_image_compare_width" value="<?php echo $theme_mytheme_image_compare_width; ?>" placeholder="<?php echo $entry_width; ?>" id="input-image-compare" class="form-control" />
                  </div>
                  <div class="col-sm-6">
                    <input type="text" name="theme_mytheme_image_compare_height" value="<?php echo $theme_mytheme_image_compare_height; ?>" placeholder="<?php echo $entry_height; ?>" class="form-control" />
                  </div>
                </div>
                <?php if ($error_image_compare) { ?>
                <div class="text-danger"><?php echo $error_image_compare; ?></div>
                <?php } ?>
              </div>
            </div>
            <div class="form-group required">
              <label class="col-sm-2 control-label" for="input-image-wishlist"><?php echo $entry_image_wishlist; ?></label>
              <div class="col-sm-10">
                <div class="row">
                  <div class="col-sm-6">
                    <input type="text" name="theme_mytheme_image_wishlist_width" value="<?php echo $theme_mytheme_image_wishlist_width; ?>" placeholder="<?php echo $entry_width; ?>" id="input-image-wishlist" class="form-control" />
                  </div>
                  <div class="col-sm-6">
                    <input type="text" name="theme_mytheme_image_wishlist_height" value="<?php echo $theme_mytheme_image_wishlist_height; ?>" placeholder="<?php echo $entry_height; ?>" class="form-control" />
                  </div>
                </div>
                <?php if ($error_image_wishlist) { ?>
                <div class="text-danger"><?php echo $error_image_wishlist; ?></div>
                <?php } ?>
              </div>
            </div>
            <div class="form-group required">
              <label class="col-sm-2 control-label" for="input-image-cart"><?php echo $entry_image_cart; ?></label>
              <div class="col-sm-10">
                <div class="row">
                  <div class="col-sm-6">
                    <input type="text" name="theme_mytheme_image_cart_width" value="<?php echo $theme_mytheme_image_cart_width; ?>" placeholder="<?php echo $entry_width; ?>" id="input-image-cart" class="form-control" />
                  </div>
                  <div class="col-sm-6">
                    <input type="text" name="theme_mytheme_image_cart_height" value="<?php echo $theme_mytheme_image_cart_height; ?>" placeholder="<?php echo $entry_height; ?>" class="form-control" />
                  </div>
                </div>
                <?php if ($error_image_cart) { ?>
                <div class="text-danger"><?php echo $error_image_cart; ?></div>
                <?php } ?>
              </div>
            </div>
            <div class="form-group required">
              <label class="col-sm-2 control-label" for="input-image-location"><?php echo $entry_image_location; ?></label>
              <div class="col-sm-10">
                <div class="row">
                  <div class="col-sm-6">
                    <input type="text" name="theme_mytheme_image_location_width" value="<?php echo $theme_mytheme_image_location_width; ?>" placeholder="<?php echo $entry_width; ?>" id="input-image-location" class="form-control" />
                  </div>
                  <div class="col-sm-6">
                    <input type="text" name="theme_mytheme_image_location_height" value="<?php echo $theme_mytheme_image_location_height; ?>" placeholder="<?php echo $entry_height; ?>" class="form-control" />
                  </div>
                </div>
                <?php if ($error_image_location) { ?>
                <div class="text-danger"><?php echo $error_image_location; ?></div>
                <?php } ?>
              </div>
            </div>
          </fieldset>
        </form>
      </div>
    </div>
  </div>
</div>
<?php echo $footer; ?>

Затем через админку зашел в Расширения-расширения-шаблоны-установил свой шаблон. Включил его и выбрал нужную директорию из списка.
Затем зашел в система-настройки-вкладка магазин- выбрал свой шаблон.
Обновил кеш модификаторов.

Вроде ms все правильно, но изменения которые делаю в новых файлах шаблона никак не отображаются. То есть по факту ничего не поменялось, по прежнему используются файлы из директории default. 

Подскажите что я сделал не так или может что упустил.

Надіслати
Поділитися на інших сайтах


А в коде обновленного сайта в хедере пути ведут к файлам новой темы?

P.S.: Админовскую тему можно было и не трогать. Совсем, достаточно фронт переписать.

Надіслати
Поділитися на інших сайтах


7 минут назад, zlatoff сказал:

А в коде обновленного сайта в хедере пути ведут к файлам новой темы?

P.S.: Админовскую тему можно было и не трогать. Совсем, достаточно фронт переписать.

В файле header.tpl изменил путь к stylesheet.css и все. А где еще нужно менять путь?

Надіслати
Поділитися на інших сайтах


Получается изменить шаблон только есть в настройках дефолтного шаблона выбрать директорию нового шаблона. А вот почему не работает если сделать так как описал выше непонятно...

Надіслати
Поділитися на інших сайтах


Можешь в контроллере прописать

для css 

$this->document->addStyle('тут путь к файлу css');

для js

$this->document->addScript('catalog/view/javascript/jquery/jquery.min.js');

 

Надіслати
Поділитися на інших сайтах

Створіть аккаунт або увійдіть для коментування

Ви повинні бути користувачем, щоб залишити коментар

Створити обліковий запис

Зареєструйтеся для отримання облікового запису. Це просто!

Зареєструвати аккаунт

Вхід

Уже зареєстровані? Увійдіть тут.

Вхід зараз

×
×
  • Створити...

Important Information

На нашому сайті використовуються файли cookie і відбувається обробка деяких персональних даних користувачів, щоб поліпшити користувальницький інтерфейс. Щоб дізнатися для чого і які персональні дані ми обробляємо перейдіть за посиланням . Якщо Ви натиснете «Я даю згоду», це означає, що Ви розумієте і приймаєте всі умови, зазначені в цьому Повідомленні про конфіденційність.