Jump to content
Sign in to follow this  
frostaken

Ошибка на главной странице и страницах товаров.

Recommended Posts

Здравствуйте. Помогите, пожалуйста, разобраться, в чем проблема.

 

У меня на главной странице после установки шаблона возникает проблема: появляется такая надпись. Как от неё избавиться - не понимаю.

 

Notice: Undefined variable: icon in /var/www/u0159630/public_html/shock-boom.ru/catalog/view/theme/rhea/template/common/header.tpl on line 20 Notice: Undefined variable: google_analytics in /var/www/u0159630/public_html/shock-boom.ru/catalog/view/theme/rhea/template/common/header.tpl on line 39

 

Во втором спойлере прикладываю код из файла header.php

 

<?php
class ControllerCommonHeader extends Controller {
public function index() {
$data['title'] = $this->document->getTitle();
 
if ($this->request->server['HTTPS']) {
$data['base'] = HTTPS_SERVER;
} else {
$data['base'] = HTTP_SERVER;
}
 
$data['description'] = $this->document->getDescription();
$data['keywords'] = $this->document->getKeywords();
$data['links'] = $this->document->getLinks();
$data['styles'] = $this->document->getStyles();
$data['scripts'] = $this->document->getScripts();
$data['code'] = $this->language->get('code');
$data['lang'] = $this->language->get('lang');
$data['direction'] = $this->language->get('direction');
 
$this->load->language('common/header');
 
$data['heading_title'] = $this->language->get('heading_title');
 
$data['text_order'] = $this->language->get('text_order');
$data['text_processing_status'] = $this->language->get('text_processing_status');
$data['text_complete_status'] = $this->language->get('text_complete_status');
$data['text_return'] = $this->language->get('text_return');
$data['text_customer'] = $this->language->get('text_customer');
$data['text_online'] = $this->language->get('text_online');
$data['text_approval'] = $this->language->get('text_approval');
$data['text_product'] = $this->language->get('text_product');
$data['text_stock'] = $this->language->get('text_stock');
$data['text_review'] = $this->language->get('text_review');
$data['text_affiliate'] = $this->language->get('text_affiliate');
$data['text_store'] = $this->language->get('text_store');
$data['text_front'] = $this->language->get('text_front');
$data['text_help'] = $this->language->get('text_help');
$data['text_homepage'] = $this->language->get('text_homepage');
$data['text_documentation'] = $this->language->get('text_documentation');
$data['text_support'] = $this->language->get('text_support');
$data['text_logged'] = sprintf($this->language->get('text_logged'), $this->user->getUserName());
$data['text_logout'] = $this->language->get('text_logout');
 
if (!isset($this->request->get['token']) || !isset($this->session->data['token']) || ($this->request->get['token'] != $this->session->data['token'])) {
$data['logged'] = '';
 
$data['home'] = $this->url->link('common/dashboard', '', 'SSL');
} else {
$data['logged'] = true;
 
$data['home'] = $this->url->link('common/dashboard', 'token=' . $this->session->data['token'], 'SSL');
$data['logout'] = $this->url->link('common/logout', 'token=' . $this->session->data['token'], 'SSL');
 
// Orders
$this->load->model('sale/order');
 
// Processing Orders
$data['processing_status_total'] = $this->model_sale_order->getTotalOrders(array('filter_order_status' => implode(',', $this->config->get('config_processing_status'))));
$data['processing_status'] = $this->url->link('sale/order', 'token=' . $this->session->data['token'] . '&filter_order_status=' . implode(',', $this->config->get('config_processing_status')), 'SSL');
 
// Complete Orders
$data['complete_status_total'] = $this->model_sale_order->getTotalOrders(array('filter_order_status' => implode(',', $this->config->get('config_complete_status'))));
$data['complete_status'] = $this->url->link('sale/order', 'token=' . $this->session->data['token'] . '&filter_order_status=' . implode(',', $this->config->get('config_complete_status')), 'SSL');
 
// Returns
$this->load->model('sale/return');
 
$return_total = $this->model_sale_return->getTotalReturns(array('filter_return_status_id' => $this->config->get('config_return_status_id')));
 
$data['return_total'] = $return_total;
 
$data['return'] = $this->url->link('sale/return', 'token=' . $this->session->data['token'], 'SSL');
 
// Customers
$this->load->model('report/customer');
 
$data['online_total'] = $this->model_report_customer->getTotalCustomersOnline();
 
$data['online'] = $this->url->link('report/customer_online', 'token=' . $this->session->data['token'], 'SSL');
 
$this->load->model('customer/customer');
 
$customer_total = $this->model_customer_customer->getTotalCustomers(array('filter_approved' => false));
 
$data['customer_total'] = $customer_total;
$data['customer_approval'] = $this->url->link('customer/customer', 'token=' . $this->session->data['token'] . '&filter_approved=0', 'SSL');
 
// Products
$this->load->model('catalog/product');
 
$product_total = $this->model_catalog_product->getTotalProducts(array('filter_quantity' => 0));
 
$data['product_total'] = $product_total;
 
$data['product'] = $this->url->link('catalog/product', 'token=' . $this->session->data['token'] . '&filter_quantity=0', 'SSL');
 
// Reviews
$this->load->model('catalog/review');
 
$review_total = $this->model_catalog_review->getTotalReviews(array('filter_status' => false));
 
$data['review_total'] = $review_total;
 
$data['review'] = $this->url->link('catalog/review', 'token=' . $this->session->data['token'] . '&filter_status=0', 'SSL');
 
// Affliate
$this->load->model('marketing/affiliate');
 
$affiliate_total = $this->model_marketing_affiliate->getTotalAffiliates(array('filter_approved' => false));
 
$data['affiliate_total'] = $affiliate_total;
$data['affiliate_approval'] = $this->url->link('marketing/affiliate', 'token=' . $this->session->data['token'] . '&filter_approved=1', 'SSL');
 
$data['alerts'] = $customer_total + $product_total + $review_total + $return_total + $affiliate_total;
 
// Online Stores
$data['stores'] = array();
 
$data['stores'][] = array(
'name' => $this->config->get('config_name'),
'href' => HTTP_CATALOG
);
 
$this->load->model('setting/store');
 
$results = $this->model_setting_store->getStores();
 
foreach ($results as $result) {
$data['stores'][] = array(
'name' => $result['name'],
'href' => $result['url']
);
}
}
 
return $this->load->view('common/header.tpl', $data);
}
}

 
Заранее спасибо за ответ.

 

Share this post


Link to post
Share on other sites

А что говорит тех. поддержка темы ?

$data['icon'] - не видно в контроллере

В модификаторах темы есть ?

Share this post


Link to post
Share on other sites

как вариант - в catalog\view\theme\rhea\template\common\header.tpl

 

найти и удалить

 <?php if ($icon) { ?>
<link href="<?php echo $icon; ?>" rel="icon" />
<?php } ?>

 

чуть ниже убрать еще эту строку

<?php echo $google_analytics; ?>

Share this post


Link to post
Share on other sites

А что говорит тех. поддержка темы ?

$data['icon'] - не видно в контроллере

В модификаторах темы есть ?

 

Ни слова не понял, если честно :-( Это мой первый опыт, поэтому я пока таких штук, о которых Вы говорите даже не понимаю. Но в любом случае спасибо, что отозвались.

 

 

Вот это интересно. Спасибо.

 

как вариант - в catalog\view\theme\rhea\template\common\header.tpl

 

найти и удалить

 <?php if ($icon) { ?>

<link href="<?php echo $icon; ?>" rel="icon" />

<?php } ?>

 

чуть ниже убрать еще эту строку

<?php echo $google_analytics; ?>

 

Попробую, отпишусь. Спасибо.

Share this post


Link to post
Share on other sites

как вариант - в catalog\view\theme\rhea\template\common\header.tpl

 

найти и удалить

 <?php if ($icon) { ?>

<link href="<?php echo $icon; ?>" rel="icon" />

<?php } ?>

 

чуть ниже убрать еще эту строку

<?php echo $google_analytics; ?>

 

 

Вот это помогло. Спасибо большое!

Share this post


Link to post
Share on other sites

Чтобы не вылазила ошибка про analytics, нужно заменить строку 

<?php echo $google_analytics; ?>

на 

<?php foreach ($analytics as $analytic) { ?>
<?php echo $analytic; ?>
<?php } ?>

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
You are posting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×

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.