Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Проблема с отображением текста на сайте


motor721
 Share

Recommended Posts

Всем доброго времени суток!

Решил создать впервые магазин на данном скрипте, версия движка: ocStore v1.5.3.1 последняя скачивал с данного ресурса :)

Проблема заключается в том что на сайте в конце вывода краткого описания на главной странице на окончании появляется квадратики с (?)вопросами :(. Сразу хочу сказать что поиском пользовался и решение данной проблемы не нашёл :(. Шаблон установил ипортный уже пробовал файлы шаблона в кодировку без БОМ сохронять думал в этом проблема?.. Куфон (шрифт) поменял на русский! Подскажите господа где покопаться ещё??.. Ссылку выложить немогу сайта, так как он на локалке (тренеруюсь)., а скрин пожалуйста!

post-3844-0-27796500-1343035668_thumb.jpg

Link to comment
Share on other sites


Это у Вас описание в категориях выводятся со знаком вопроса или в модуле? Нужно найти такие строки в контроллере


'description' => utf8...

. Выложите их сюда
Link to comment
Share on other sites


<?php  
class ControllerCommonHeader extends Controller {
protected function index() {
 $this->data['title'] = $this->document->getTitle();

 if (isset($this->request->server['HTTPS']) && (($this->request->server['HTTPS'] == 'on') || ($this->request->server['HTTPS'] == '1'))) {
  $this->data['base'] = $this->config->get('config_ssl');
 } else {
  $this->data['base'] = $this->config->get('config_url');
 }

 $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->language->load('common/header');

 if (isset($this->request->server['HTTPS']) && (($this->request->server['HTTPS'] == 'on') || ($this->request->server['HTTPS'] == '1'))) {
  $server = HTTPS_IMAGE;
 } else {
  $server = HTTP_IMAGE;
 }

 if ($this->config->get('config_icon') && file_exists(DIR_IMAGE . $this->config->get('config_icon'))) {
  $this->data['icon'] = $server . $this->config->get('config_icon');
 } else {
  $this->data['icon'] = '';
 }

 $this->data['name'] = $this->config->get('config_name');

 if ($this->config->get('config_logo') && file_exists(DIR_IMAGE . $this->config->get('config_logo'))) {
  $this->data['logo'] = $server . $this->config->get('config_logo');
 } else {
  $this->data['logo'] = '';
 }

 $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_shopping_cart'] = $this->language->get('text_shopping_cart');
  $this->data['text_search'] = $this->language->get('text_search');
 $this->data['text_affiliate'] = $this->language->get('text_affiliate');
 $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_account'] = $this->language->get('text_account');
  $this->data['text_checkout'] = $this->language->get('text_checkout');

 $this->data['home'] = $this->url->link('common/home');
 $this->data['wishlist'] = $this->url->link('account/wishlist');
 $this->data['logged'] = $this->customer->isLogged();
 $this->data['account'] = $this->url->link('account/account', '', 'SSL');
 $this->data['affiliate'] = $this->url->link('affiliate/account', '', 'SSL');
 $this->data['shopping_cart'] = $this->url->link('checkout/cart');
 $this->data['checkout'] = $this->url->link('checkout/checkout', '', 'SSL');
 $this->data['text_sitemap'] = $this->language->get('text_sitemap');
 $this->data['sitemap'] = $this->url->link('information/sitemap');
 $this->data['text_contact'] = $this->language->get('text_contact');
 $this->data['contact'] = $this->url->link('information/contact');
 $this->data['text_special'] = $this->language->get('text_special');
 $this->data['special'] = $this->url->link('product/special');
 $this->data['text_newsletter'] = $this->language->get('text_newsletter');
 $this->data['newsletter'] = $this->url->link('account/newsletter', '', 'SSL');

 if (isset($this->request->get['filter_name'])) {
  $this->data['filter_name'] = $this->request->get['filter_name'];
 } else {
  $this->data['filter_name'] = '';
 }

 // 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']) {
   $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'] . ' (' . $product_total . ')',
  '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,
 'column'   => $category['column'] ? $category['column'] : 1,
 'href'	 => $this->url->link('product/category', 'path=' . $category['category_id'])
   );
  }
 }

 $this->children = array(
  'module/language',
  'module/currency',
  '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();
} 
}
?>

Link to comment
Share on other sites


Спасибо, не нужно, если понадобится приобрету

покажите мне файл catalog/controller/module/featured.php

Мне этого файла должно хватить
Link to comment
Share on other sites


<?php
class ControllerModuleFeatured extends Controller {
protected function index($setting) {
 $this->language->load('module/featured');
   $this->data['heading_title'] = $this->language->get('heading_title');

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

 $this->load->model('catalog/product');

 $this->load->model('tool/image');
 $this->data['products'] = array();
 $products = explode(',', $this->config->get('featured_product')); 
 if (empty($setting['limit'])) {
  $setting['limit'] = 5;
 }

 $products = array_slice($products, 0, (int)$setting['limit']);

 foreach ($products as $product_id) {
  $product_info = $this->model_catalog_product->getProduct($product_id);

  if ($product_info) {
   if ($product_info['image']) {
 $image = $this->model_tool_image->resize($product_info['image'], $setting['image_width'], $setting['image_height']);
   } else {
 $image = false;
   }
   if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) {
 $price = $this->currency->format($this->tax->calculate($product_info['price'], $product_info['tax_class_id'], $this->config->get('config_tax')));
   } else {
 $price = false;
   }

   if ((float)$product_info['special']) {
 $special = $this->currency->format($this->tax->calculate($product_info['special'], $product_info['tax_class_id'], $this->config->get('config_tax')));
   } else {
 $special = false;
   }

   if ($this->config->get('config_review_status')) {
 $rating = $product_info['rating'];
   } else {
 $rating = false;
   }

   $this->data['products'][] = array(
 'product_id' => $product_info['product_id'],
 'thumb'	 => $image,
 'description'    => $product_info['description'],
 'name'	  => $product_info['name'],
 'price'	 => $price,
 'special'   => $special,
 'rating'	 => $rating,
 'reviews'    => sprintf($this->language->get('text_reviews'), (int)$product_info['reviews']),
 'href'	  => $this->url->link('product/product', 'product_id=' . $product_info['product_id']),
   );
  }
 }
 if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/module/featured.tpl')) {
  $this->template = $this->config->get('config_template') . '/template/module/featured.tpl';
 } else {
  $this->template = 'default/template/module/featured.tpl';
 }
 $this->render();
}
}
?>

Link to comment
Share on other sites


Хм......странно этот контролер в котором все файлы, неимеют возможность преобразовать без БОМ а в ANSI только....нельзя сохронить в другой кодировке странно..

Link to comment
Share on other sites


<div id="featured-products">
<?php foreach ($products as $product) { ?>
<div class="box-container">
 <div class="box-preloader">
  <div class="boxgrid captionfull">
 <a class="box-image" href="<?php echo $product['href']; ?>" style="background-image:url('<?php echo $product['thumb']; ?>'); background-position:center center;">
	  <span class="box-title"><?php if( strlen( $product['name'] ) < 23 ) { echo $product['name']; } else { echo substr( $product['name'],0,21 )."..."; } ?></span>
	 <span class="cover boxcaption">
<span class="boxcaption-child">
  <?php echo mb_substr(strip_tags(html_entity_decode($product['description'])), 0, 90)."..." ?><br /><br />
	  <span class="box-price<?php if ($product['special']) { ?>-sale<?php } ?>">
	  <?php if (!$product['special']) { ?>
	  <span class="box-price-amount"><?php echo $product['price']; ?></span>
	  <?php } else { ?>
	  <span class="box-price-amount"><?php echo $product['special']; ?></span>
	  <?php } ?>
	 </span><!-- box-price ends-->

 </span>
	  </span>		
 </a><!--box-image ends-->
  </div><!--boxgrid captionfull ends-->
<div class="box-bottom">
	  <span class="box-add-to-cart"><a onclick="addToCart('<?php echo $product['product_id']; ?>');"> </a></span>
	  <div class="box-rating"><img class="rating-stars" src="catalog/view/theme/eliteshop/image/stars-<?php echo $product['rating'] . 'a.png'; ?>" alt="Rating" /></div>		 
<div class="clear"></div>
</div><!--box-bottom ends-->
 </div><!--box-preloader -->
</div><!--box-container ends-->
<?php } ?>
<div class="clear"></div>
</div><!--featured-products ends-->

Link to comment
Share on other sites


Дружище немогу знать кто ты такой!!, но могу сделать вывод ты или программист или талантлевый кодер!! СПАСИБО!! Всё работает!!

Ещё проблемка когда шторки открываются то там в превью на белом фоне когда мышь подводишь тоже самое квадратики, наверно этот кусок файла тоже надо кудато запихать?

Link to comment
Share on other sites


Попробуйте вместо

<?php echo mb_substr(strip_tags(html_entity_decode($product['description'])), 0, 90)."..." ?>
вставить

<?php echo mb_substr(strip_tags(html_entity_decode($product['description'], ENT_QUOTES, 'UTF-8')), 0,90, 'UTF-8') . '...'?>
  • +1 2
Link to comment
Share on other sites


Спасибо друг!!!!!!!!!!!!! Всё работает!

Попробуйте вместо

<?php echo mb_substr(strip_tags(html_entity_decode($product['description'])), 0, 90)."..." ?>
вставить

<?php echo mb_substr(strip_tags(html_entity_decode($product['description'], ENT_QUOTES, 'UTF-8')), 0,90, 'UTF-8') . '...'?>
Спасибо!!
Link to comment
Share on other sites


  • 3 months later...

сегодня столкнулся вот с такой проблемой:

при переходе например: http://x-el.ru/index.php?route=product/product&product_id=1 кракозябры, (д/б товар не найден)

по категориям все норм: http://x-el.ru/index.php?route=product/category&path=79 все нормально отображается

что это может быть?

заранее, Спасибо!

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.