Leaderboard
Popular Content
Showing content with the highest reputation on 07/16/2011 in Posts
-
Решение 1) Добавим функцию формирования списка новостей в контроллер ..\catalog\controller\information\sitemap.php protected function getNews() { $output = ''; $results = $this->model_catalog_news->getNews(); if ($results) { $output .= '<ul><li><a href="' . $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=information/news">' ). $this->language->get("text_news") . '</a></li><ul>'; } foreach ($results as $result) { $new_id = $result['news_id']; $output .= '<li>'; $output .= '<a href="' . $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=information/news&news_id=' . $new_id) . '">' . $result['title'] . '</a>'; $output .= '</li>'; } if ($results) { $output .= '</ul></ul>'; } return $output; } 2) Вызываем её из того же контроллера, предварительно загрузив модель "новостей" $this->load->model('catalog/news'); $this->data['news'] = $this->getNews(); Это можно сделать, например, перед строкой $this->load->model('catalog/category'); 3) Добавляем в конец файла локализации ..\catalog\language\russian\information\sitemap.php строку $_['text_news'] = 'Все новости'; 4) Добавляем сформированный список в нужном месте шаблона карты сайта ..\catalog\view\theme\default\template\information\sitemap.tpl <?php echo $news; ?>Если руководствоваться рисунком, то это сделать перед тегами </td> </tr> </table> После приведенных манипуляций на карте сайта отображается список новостей :rolleyes:2 points
-
1 point
-
Спасибо за исполнение! Все отлично работает не считая одной ошибки во 2 пункте, а именно, вместо $this->load->model('catalog/news'); $this->data['news'] = $this->getNews(); следует добавить $this->load->model('catalog/news'); $this->load->model('tool/seo_url'); $this->data['news'] = $this->getNews(); ;)1 point
-
1 point
-
попробуйте это http://www.opencart.com/index.php?route=extension/extension/info&extension_id=2557&filter_search=Adsense&filter_license=0&sort=e.date_modified&order=DESC есть и другие , но платные по 10-20 дол1 point
-
По поводу валюты. Сначала ее нужно добавить: System - Localisation - Currensies. Кнопка Insert. Затем в System - Settings - (выбрать магазин) - Local.1 point
-
Есть подозрение, что модуль Статьи добавляет класс, у которого width:100% и text-align:center, и который наследуется модулями Производители и Корзина. А вообще в лечении по фотографии я новичок ;)1 point
-
это же надо было так нописать,я вообще ничего не понял)) гугл технологиями находим Ваш шаблон http://***/shablony/198-opencart-templates-yoocart002.html что значит блоки в правой части?Вообще-то поставить в админке в блоке который Вам нужен поставить позицию "справа" ,но т.к. шаблон у Вас без правой части то нужно css исправлять, поставить ширину блока с контентом пикселей на 200 меньше. CR2 HTML а это что такое?1 point
-
А я ничего и не предлагал. Я дал наводку. Предлагать более, после вашего ответа в личку у меня нет желанияПо коду можно понять что и чего. А если д...б как дерево, родишься баобабом Владимир Семёнович...1 point
-
1. Чтобы убрать вылидацию : Находите файл \www\catalog\controller\account\create.php Находите в районе 320 ой строки: private function validate() { if ((strlen(utf8_decode($this->request->post['firstname'])) < 1) || (strlen(utf8_decode($this->request->post['firstname'])) > 32)) { $this->error['firstname'] = $this->language->get('error_firstname'); } if ((strlen(utf8_decode($this->request->post['lastname'])) < 1) || (strlen(utf8_decode($this->request->post['lastname'])) > 32)) { $this->error['lastname'] = $this->language->get('error_lastname'); } if ((strlen(utf8_decode($this->request->post['email'])) > 96) || (!preg_match(EMAIL_PATTERN, $this->request->post['email']))) { $this->error['email'] = $this->language->get('error_email'); } if ($this->model_account_customer->getTotalCustomersByEmail($this->request->post['email'])) { $this->error['warning'] = $this->language->get('error_exists'); } if ((strlen(utf8_decode($this->request->post['telephone'])) < 3) || (strlen(utf8_decode($this->request->post['telephone'])) > 32)) { $this->error['telephone'] = $this->language->get('error_telephone'); } if ((strlen(utf8_decode($this->request->post['address_1'])) < 3) || (strlen(utf8_decode($this->request->post['address_1'])) > 128)) { $this->error['address_1'] = $this->language->get('error_address_1'); } if ((strlen(utf8_decode($this->request->post['city'])) < 3) || (strlen(utf8_decode($this->request->post['city'])) > 128)) { $this->error['city'] = $this->language->get('error_city'); } $this->load->model('localisation/country'); $country_info = $this->model_localisation_country->getCountry($this->request->post['country_id']); if ($country_info && $country_info['postcode_required']) { if ((strlen(utf8_decode($this->request->post['postcode'])) < 2) || (strlen(utf8_decode($this->request->post['postcode'])) > 10)) { $this->error['postcode'] = $this->language->get('error_postcode'); } } if ($this->request->post['country_id'] == 'FALSE') { $this->error['country'] = $this->language->get('error_country'); } if ($this->request->post['zone_id'] == 'FALSE') { $this->error['zone'] = $this->language->get('error_zone'); } if ((strlen(utf8_decode($this->request->post['password'])) < 4) || (strlen(utf8_decode($this->request->post['password'])) > 20)) { $this->error['password'] = $this->language->get('error_password'); } if ($this->request->post['confirm'] != $this->request->post['password']) { $this->error['confirm'] = $this->language->get('error_confirm'); } if ($this->config->get('config_account_id')) { $this->load->model('catalog/information'); $information_info = $this->model_catalog_information->getInformation($this->config->get('config_account_id')); if ($information_info) { if (!isset($this->request->post['agree'])) { $this->error['warning'] = sprintf($this->language->get('error_agree'), $information_info['title']); } } } if (!$this->error) { return TRUE; } else { return FALSE; } } Здесь можно снять обязательное заполнение какого-то поля, просто закомментировав его, например, чтобы не заполнять фамилию, надо поменять if ((strlen(utf8_decode($this->request->post['firstname'])) < 1) || (strlen(utf8_decode($this->request->post['firstname'])) > 32)) { $this->error['firstname'] = $this->language->get('error_firstname'); }на /* if ((strlen(utf8_decode($this->request->post['firstname'])) < 1) || (strlen(utf8_decode($this->request->post['firstname'])) > 32)) { $this->error['firstname'] = $this->language->get('error_firstname'); } */ Так проделываем для всех полей, которые нам не нужны(т.е. просто комментим их). 2. Чтобы поле не показывалось в форме регистрации: Находите файл \www\catalog\view\theme\default\template\account\create.tpl (default - ваша тема, может быть другой) В строках, которые хотим убрать, добавляем style="display:none" пример(убираем фамилию): меняем <tr> <td><span class="required">*</span> <?php echo $entry_lastname; ?></td> <td><input type="text" name="lastname" value="<?php echo $lastname; ?>" /> <?php if ($error_lastname) { ?> <span class="error"><?php echo $error_lastname; ?></span> <?php } ?></td> </tr>на <tr style="display:none"> <td><span class="required">*</span> <?php echo $entry_lastname; ?></td> <td><input type="text" name="lastname" value="<?php echo $lastname; ?>" /> <?php if ($error_lastname) { ?> <span class="error"><?php echo $error_lastname; ?></span> <?php } ?></td> </tr> 3. Ставим мне плюсик :rolleyes:1 point
-
Спасибо. Модуль полезный . Подправил для версии 1.4.9.opencart-1-4-9Google-Adsense.zip1 point
-
Верстка под open cart ничем не отличается от другой любой верстки. Верстальщика можете найти на фрилансе но даже если изначальна верстка сделана под ие с 6 по 9, и хром, и оперу, и фаерфокс - то не факт что после привязки дизайна к CMS верстка будет прямой. Неправильно прикрученные модули и прочие проблемы этого типа.-1 points
-
Неправда. Если косяк верстки так пусть верстальщик и исправляет а программист прикручивает. Не нужно путать эти две разных по сути профессии.-1 points