Opencart 1.5.1.3 (backend): Продажи - Заказы - Товары: показ колонки SKU в списке товаров

- Posted in Uncategorized by

admin: Продажи - Заказы - Товары: добавлена колонка SKU

Выводится ТЕКУЩЕЕ значение SKU из базы. То есть если продали товар, затем SKU изменился - старый не сохраняется в отличие от названия товара, модели, цены и прочего. То есть при просмотре старых заказов могут быть неточности: вы увидите состояние SKU не на тот момент (когда был сделан заказ), а на нынешний.

commit 3b5e001193b5e9c3c64ee9886455c6a1761aaba8
Author: Ruslan Brest <rb@labtodo.com>
Date:   Fri Nov 11 13:21:33 2011 +0200
    [+] admin: Продажи - Заказы - Товары: добавлена колонка SKU
    
    Выводится ТЕКУЩЕЕ значение SKU из базы. То есть если продали товар, затем SKU изменился - старый не сохраняется
    в отличие от названия товара, модели, цены и прочего
diff --git a/upload/admin/controller/sale/order.php b/upload/admin/controller/sale/order.php
index 2a2178a..dbc181f 100644
--- a/upload/admin/controller/sale/order.php
+++ b/upload/admin/controller/sale/order.php
@@ -1111,6 +1111,7 @@ class ControllerSaleOrder extends Controller {
            $this->data['text_credit_remove'] = $this->language->get('text_credit_remove');
            
            $this->data['column_product'] = $this->language->get('column_product');
+           $this->data['column_sku']     = $this->language->get('column_sku');
            $this->data['column_model'] = $this->language->get('column_model');
            $this->data['column_quantity'] = $this->language->get('column_quantity');
            $this->data['column_price'] = $this->language->get('column_price');
@@ -1320,6 +1321,7 @@ class ControllerSaleOrder extends Controller {
                    'order_product_id' => $product['order_product_id'],
                    'product_id'       => $product['product_id'],
                    'name'             => $product['name'],
+                   'sku'              => $product['sku'],
                    'model'            => $product['model'],
                    'option'           => $option_data,
                    'quantity'         => $product['quantity'],
diff --git a/upload/admin/language/english/sale/order.php b/upload/admin/language/english/sale/order.php
index fe25149..fe4b35b 100644
--- a/upload/admin/language/english/sale/order.php
+++ b/upload/admin/language/english/sale/order.php
@@ -65,6 +65,7 @@ $_['column_date_added']       = 'Date Added';
 $_['column_date_modified']    = 'Date Modified';
 $_['column_total']            = 'Total';
 $_['column_product']          = 'Product';
+$_['column_sku']              = 'SKU';
 $_['column_model']            = 'Model';
 $_['column_quantity']         = 'Quantity';
 $_['column_price']            = 'Unit Price';
diff --git a/upload/admin/language/russian/sale/order.php b/upload/admin/language/russian/sale/order.php
index a8f4724..3efb7d1 100644
--- a/upload/admin/language/russian/sale/order.php
+++ b/upload/admin/language/russian/sale/order.php
@@ -65,6 +65,7 @@ $_['column_date_added']     = 'Дата добавления';
 $_['column_date_modified']    = 'Дата изменения';
 $_['column_total']          = 'Итого';
 $_['column_product']        = 'Товар';
+$_['column_sku']            = 'Артикул';
 $_['column_model']          = 'Модель';
 $_['column_quantity']       = 'Количество';
 $_['column_price']          = 'Цена за единицу';
diff --git a/upload/admin/model/sale/order.php b/upload/admin/model/sale/order.php
index 22483c2..8a4a449 100644
--- a/upload/admin/model/sale/order.php
+++ b/upload/admin/model/sale/order.php
@@ -365,7 +365,7 @@ class ModelSaleOrder extends Model {
    }
    
    public function getOrderProducts($order_id) {
-       $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "order_product WHERE order_id = '" . (int)$order_id . "'");
+       $query = $this->db->query("SELECT op.*,p.sku FROM " . DB_PREFIX . "order_product op LEFT JOIN ".DB_PREFIX."product p ON (op.product_id = p.product_id)  WHERE order_id = '" . (int)$order_id . "'");
        
        return $query->rows;
    }
diff --git a/upload/admin/view/template/sale/order_info.tpl b/upload/admin/view/template/sale/order_info.tpl
index e5d04fe..3c3f13b 100644
--- a/upload/admin/view/template/sale/order_info.tpl
+++ b/upload/admin/view/template/sale/order_info.tpl
@@ -252,6 +252,7 @@
         <table id="product" class="list">
           <thead>
             <tr>
+              <td class="left"><?php echo $column_sku; ?></td>
               <td class="left"><?php echo $column_product; ?></td>
               <td class="left"><?php echo $column_model; ?></td>
               <td class="right"><?php echo $column_quantity; ?></td>
@@ -262,6 +263,7 @@
           <?php foreach ($products as $product) { ?>
           <tbody id="product-row<?php echo $product['order_product_id']; ?>">
             <tr>
+              <td class="left"><?php echo $product['sku']; ?></td>
               <td class="left"><?php if ($product['product_id']) { ?>
                 <a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a>
                 <?php } else { ?>
@@ -285,7 +287,7 @@
           <?php foreach ($totals as $totals) { ?>
           <tbody id="totals">
             <tr>
-              <td colspan="4" class="right"><?php echo $totals['title']; ?>:</td>
+              <td colspan="5" class="right"><?php echo $totals['title']; ?>:</td>
               <td class="right"><?php echo $totals['text']; ?></td>
             </tr>
           </tbody>

(oc1513)(admin) Ссылка на просмотр товара в магазине при просмотре заказа в админке

- Posted in Uncategorized by

При просмотре заказа в админке ссылка на заказываемый товар ведёт на редактирование товара. Мне показалось гораздо более удобным иметь здесь прямую ссылку на страницу товара в магазине.

В некоторых магазинах менеджер-продажник всё равно не имеет прав на редактирование товаров.

Есть здесь один момент: у нас ВСЕ товары имеют SEO Keyword, поэтому не делались никакие проверки. Гораздо более универсальным и более простым решением будет использовать ссылку HTTP_CATALOG . 'index.php?route=product/product&product_id=' . $product['product_id'].

В таком случае указанный код надо подставить в контроллере на место 'href_catalog', а запрос к базе в модели вообще не модифицировать.

commit da02db89ca4be51a282cb49cd58a3160cc4bf747
Author: Ruslan Brest <rb@labtodo.com>
Date:   Tue Feb 28 02:37:40 2012 +0200
    [+] backend: view order - link to frontend (product page)
diff --git a/upload/admin/controller/sale/order.php b/upload/admin/controller/sale/order.php
index 871c36f..029ba41 100644
--- a/upload/admin/controller/sale/order.php
+++ b/upload/admin/controller/sale/order.php
@@ -1327,7 +1327,8 @@ class ControllerSaleOrder extends Controller {
                    'quantity'         => $product['quantity'],
                    'price'            => $this->currency->format($product['price'], $order_info['currency_code'], $order_info['currency_value']),
                    'total'            => $this->currency->format($product['total'], $order_info['currency_code'], $order_info['currency_value']),
-                   'href'             => $this->url->link('catalog/product/update', 'token=' . $this->session->data['token'] . '&product_id=' . $product['product_id'], 'SSL')
+                   'href'             => $this->url->link('catalog/product/update', 'token=' . $this->session->data['token'] . '&product_id=' . $product['product_id'], 'SSL'),
+                   'href_catalog'     => HTTP_CATALOG . $product['keyword']
                );
            }
 
diff --git a/upload/admin/model/sale/order.php b/upload/admin/model/sale/order.php
index b580167..c702009 100644
--- a/upload/admin/model/sale/order.php
+++ b/upload/admin/model/sale/order.php
@@ -365,7 +365,8 @@ class ModelSaleOrder extends Model {
    }
 
    public function getOrderProducts($order_id) {
-       $query = $this->db->query("SELECT op.*,p.sku FROM " . DB_PREFIX . "order_product op LEFT JOIN ".DB_PREFIX."product p ON (op.product_id = p.product_id)  WHERE order_id = '" . (int)$order_id . "'");
+       //$query = $this->db->query("SELECT op.*,p.sku FROM " . DB_PREFIX . "order_product op LEFT JOIN ".DB_PREFIX."product p ON (op.product_id = p.product_id)  WHERE order_id = '" . (int)$order_id . "'");
+       $query = $this->db->query("SELECT op.*,p.sku,ua.* FROM " . DB_PREFIX . "order_product op LEFT JOIN ".DB_PREFIX."product p ON (op.product_id = p.product_id) LEFT JOIN ".DB_PREFIX."url_alias ua ON CONCAT('product_id=', op.product_id) = ua.query WHERE order_id = '" . (int)$order_id . "'");
 
        return $query->rows;
    }
diff --git a/upload/admin/view/image/url-icon.gif b/upload/admin/view/image/url-icon.gif
new file mode 100644
index 0000000..8165dc9
Binary files /dev/null and b/upload/admin/view/image/url-icon.gif differ
diff --git a/upload/admin/view/template/sale/order_info.tpl b/upload/admin/view/template/sale/order_info.tpl
index 673b599..55be799 100644
--- a/upload/admin/view/template/sale/order_info.tpl
+++ b/upload/admin/view/template/sale/order_info.tpl
@@ -269,6 +269,7 @@
               <td class="left"><?php echo $product['sku']; ?></td>
               <td class="left"><?php if ($product['product_id']) { ?>
                 <a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a>
+                <a href="<?php echo $product['href_catalog']; ?>" target="_blank"><img src="view/image/url-icon.gif" width="13" height="13" /></a>
                 <?php } else { ?>
                 <?php echo $product['name']; ?>
                 <?php } ?>

Opencart 1.5.1.3 (backend): улучшение поиска в фильтрах &#45; не только с начала строки или по полному совпадению (имя, email, IP, опции, атрибуты)

- Posted in Uncategorized by

Админка: улучшение поиска в фильтрах - не только с начала строки или по полному совпадению (имя, email, IP, опции, атрибуты).

Для тех, кто хочет искать не только по имени, но и фамилии покупателей, а также по части IP-адреса и почтовому домену, и т.д. и и т.п.

commit 860f41a57c7506331c4fef9d50d3ef8cb65ffa22
Author: Ruslan Brest <rb@labtodo.com>
Date:   Tue Feb 21 19:12:04 2012 +0200
    [!] backend: улучшение поиска в фильтрах - не только с начала строки или по полному совпадению (имя, email, IP, опции, атрибуты)
diff --git a/upload/admin/model/catalog/option.php b/upload/admin/model/catalog/option.php
index a5b65f8..29f25dc 100644
--- a/upload/admin/model/catalog/option.php
+++ b/upload/admin/model/catalog/option.php
@@ -72,7 +72,7 @@ class ModelCatalogOption extends Model {
        $sql = "SELECT * FROM `" . DB_PREFIX . "option` o LEFT JOIN " . DB_PREFIX . "option_description od ON (o.option_id = od.option_id) WHERE od.language_id = '" . (int)$this->config->get('config_language_id') . "'";
 
        if (isset($data['filter_name']) && !is_null($data['filter_name'])) {
-           $sql .= " AND LCASE(od.name) LIKE '" . $this->db->escape(utf8_strtolower($data['filter_name'])) . "%'";
+           $sql .= " AND LCASE(od.name) LIKE '%" . $this->db->escape(utf8_strtolower($data['filter_name'])) . "%'";
        }
 
        $sort_data = array(
diff --git a/upload/admin/model/catalog/product.php b/upload/admin/model/catalog/product.php
index f11247a..b83b224 100644
--- a/upload/admin/model/catalog/product.php
+++ b/upload/admin/model/catalog/product.php
@@ -346,11 +346,11 @@ class ModelCatalogProduct extends Model {
            $sql .= " WHERE pd.language_id = '" . (int)$this->config->get('config_language_id') . "'";
 
            if (!empty($data['filter_name'])) {
-               $sql .= " AND LCASE(pd.name) LIKE '" . $this->db->escape(utf8_strtolower($data['filter_name'])) . "%'";
+               $sql .= " AND LCASE(pd.name) LIKE '%" . $this->db->escape(utf8_strtolower($data['filter_name'])) . "%'";
            }
 
            if (!empty($data['filter_model'])) {
-               $sql .= " AND LCASE(p.model) LIKE '" . $this->db->escape(utf8_strtolower($data['filter_model'])) . "%'";
+               $sql .= " AND LCASE(p.model) LIKE '%" . $this->db->escape(utf8_strtolower($data['filter_model'])) . "%'";
            }
            if (!empty($data['filter_sku'])) {
                $sql .= " AND LCASE(p.sku) LIKE '%" . $this->db->escape(utf8_strtolower($data['filter_sku'])) . "%'";
diff --git a/upload/admin/model/sale/affiliate.php b/upload/admin/model/sale/affiliate.php
index 2d3809d..da3911a 100644
--- a/upload/admin/model/sale/affiliate.php
+++ b/upload/admin/model/sale/affiliate.php
@@ -35,11 +35,11 @@ class ModelSaleAffiliate extends Model {
        $implode = array();
 
        if (!empty($data['filter_name'])) {
-           $implode[] = "LCASE(CONCAT(a.firstname, ' ', a.lastname)) LIKE '" . $this->db->escape(utf8_strtolower($data['filter_name'])) . "%'";
+           $implode[] = "LCASE(CONCAT(a.firstname, ' ', a.lastname)) LIKE '%" . $this->db->escape(utf8_strtolower($data['filter_name'])) . "%'";
        }
 
        if (!empty($data['filter_email'])) {
-           $implode[] = "a.email = '" . $this->db->escape($data['filter_email']) . "'";
+           $implode[] = "a.email = '%" . $this->db->escape($data['filter_email']) . "'";
        }
 
        if (!empty($data['filter_code'])) {
diff --git a/upload/admin/model/sale/customer.php b/upload/admin/model/sale/customer.php
index 495d086..1c742b5 100644
--- a/upload/admin/model/sale/customer.php
+++ b/upload/admin/model/sale/customer.php
@@ -77,11 +77,11 @@ class ModelSaleCustomer extends Model {
        $implode = array();
 
        if (!empty($data['filter_name'])) {
-           $implode[] = "LCASE(CONCAT(c.firstname, ' ', c.lastname)) LIKE '" . $this->db->escape(utf8_strtolower($data['filter_name'])) . "%'";
+           $implode[] = "LCASE(CONCAT(c.firstname, ' ', c.lastname)) LIKE '%" . $this->db->escape(mb_strtolower($data['filter_name'], 'UTF-8')) . "%'";
        }
 
        if (!empty($data['filter_email'])) {
-           $implode[] = "LCASE(c.email) LIKE '" . $this->db->escape(utf8_strtolower($data['filter_email'])) . "%'";
+           $implode[] = "LCASE(c.email) LIKE '%" . $this->db->escape(utf8_strtolower($data['filter_email'])) . "%'";
        }
 
        if (!empty($data['filter_customer_group_id'])) {
@@ -97,7 +97,7 @@ class ModelSaleCustomer extends Model {
        }
 
        if (!empty($data['filter_ip'])) {
-           $implode[] = "c.customer_id IN (SELECT customer_id FROM " . DB_PREFIX . "customer_ip WHERE ip = '" . $this->db->escape($data['filter_ip']) . "')";
+           $implode[] = "c.customer_id IN (SELECT customer_id FROM " . DB_PREFIX . "customer_ip WHERE ip LIKE '%" . $this->db->escape($data['filter_ip']) . "%')";
        }
 
        if (!empty($data['filter_date_added'])) {

oc1513-backend-better-filter-search.diff_.zip 14

Opencart 1.5.x: удобный вид email&#45;уведомлений админу о заказе

- Posted in Uncategorized by

Формируемое в Опенкарт v1.5.x письмо-уведомление для администрации магазина о новом заказе выглядит криво-косо и неудобно для обработки поступивших заказов: не хватает информации о покупателе, а та информация, что есть, сложна для восприятия.

Можно сделать удобнее.

Формирование и отсылка писем происходит в файле catalog/model/checkout/order.php

Тексты частей писем находятся в папке catalog/language/russian/mail -- из содержащихся там фраз формируются письма.

commit 132d70db7615ff44fa658459db298af0e5ff62e3
Author: Ruslan Brest <rb@labtodo.com>
Date:   Fri Feb 24 11:54:40 2012 +0200
    [+] better admin alert email on new order
diff --git a/upload/catalog/language/russian/mail/order.php b/upload/catalog/language/russian/mail/order.php
index f42838d..8bb86a5 100644
--- a/upload/catalog/language/russian/mail/order.php
+++ b/upload/catalog/language/russian/mail/order.php
@@ -2,7 +2,7 @@
 // Text
 $_['text_new_subject']          = '%s - заказ %s';
 $_['text_new_greeting']         = 'Благодарим за интерес к товарам %s. Ваш заказ получен и поступит в обработку после подтверждения оплаты.';
-$_['text_new_received']         = 'Вы получили заказ.';
+$_['text_new_received']         = 'Вы получили заказ';
 $_['text_new_link']            = 'Для просмотра Вашего заказа перейдите по ссылке:';
 $_['text_new_order_detail']     = 'Детализация заказа';
 $_['text_new_instruction']      = 'Инструкции';
diff --git a/upload/catalog/model/checkout/order.php b/upload/catalog/model/checkout/order.php
index 6a187c2..360ea4d 100644
--- a/upload/catalog/model/checkout/order.php
+++ b/upload/catalog/model/checkout/order.php
@@ -440,14 +440,24 @@ class ModelCheckoutOrder extends Model {
                $subject = sprintf($language->get('text_new_subject'), html_entity_decode($this->config->get('config_name'), ENT_QUOTES, 'UTF-8'), $order_id);
 
                // Text
-               $text  = $language->get('text_new_received') . "\n\n";
-               $text .= $language->get('text_new_order_id') . ' ' . $order_id . "\n";
-               $text .= $language->get('text_new_date_added') . ' ' . date($language->get('date_format_short'), strtotime($order_info['date_added'])) . "\n";
-               $text .= $language->get('text_new_order_status') . ' ' . $order_status . "\n\n";
+               $text  = $language->get('text_new_received') . ' #'.$order_id . ' ('.date($language->get('date_format_short'), strtotime($order_info['date_added'])).')' . "\n";
+               // $text .= $language->get('text_new_order_id') . ' ' . $order_id . "\n";
+               // $text .= $language->get('text_new_date_added') . ' ' . date($language->get('date_format_short'), strtotime($order_info['date_added'])) . "\n";
+               $text .= $language->get('text_new_order_status') . ' ' . strip_tags($order_status) . "\n\n";
+
+               if( !empty($order_info['payment_method']) ) $text .= 'payment method: ' . $order_info['payment_method'] . "\n";
+               // $text .= 'shipping method: ' . $order_info['shipping_method'] . "\n";
+               if( !empty($order_info['email']) )     $text .= 'email: ' . $order_info['email'] . "\n";
+               if( !empty($order_info['telephone']) ) $text .= 'telephone: ' . $order_info['telephone'] . ", ";
+               $text .= 'IP: http://geoiptool.com/en/?IP=' . $order_info['ip'] . "\n\n";
+
                $text .= $language->get('text_new_products') . "\n";
 
                foreach ($order_product_query->rows as $result) {
-                   $text .= $result['quantity'] . 'x ' . $result['name'] . ' (' . $result['model'] . ') ' . html_entity_decode($this->currency->format($result['total'], $order_info['currency_code'], $order_info['currency_value']), ENT_NOQUOTES, 'UTF-8') . "\n";
+                   $text .= '  ';
+                   $text .= html_entity_decode($this->currency->format($result['total'], $order_info['currency_code'], $order_info['currency_value']), ENT_NOQUOTES, 'UTF-8');
+                   $text .= ' = ';
+                   $text .= $result['quantity'] . ' x ' . $result['name'] . ' (' . $result['model'] . ")\n";
 
                    $order_option_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "order_option WHERE order_id = '" . (int)$order_id . "' AND order_product_id = '" . $result['order_product_id'] . "'");
 
@@ -457,10 +467,10 @@ class ModelCheckoutOrder extends Model {
                }
 
                $text .= "\n";
-
                $text .= $language->get('text_new_order_total') . "\n";
 
                foreach ($order_total_query->rows as $result) {
+                   $text .= '  ';
                    $text .= $result['title'] . ' ' . html_entity_decode($result['text'], ENT_NOQUOTES, 'UTF-8') . "\n";
                }

oc1513-admin-email-neworder.diff 145

Opencart 1.5.1.3: добавляем главную страницу в sitemap.xml

- Posted in Uncategorized by

Оказывается, в sitemap.xml (Google sitemap) нет ссылки на главную страницу сайта. Добавляем несколько строк в catalog/controller/feed/google_sitemap.php:

commit acf2aa3f70fdb171846ffe81b74f2682cce8e639
Author: Ruslan Brest <rb@labtodo.com>
Date:   Wed Feb 22 13:09:20 2012 +0200
    [+] Add home page address to sitemap.xml
diff --git a/upload/catalog/controller/feed/google_sitemap.php b/upload/catalog/controller/feed/google_sitemap.php
index 3d6d475..7a3f750 100644
--- a/upload/catalog/controller/feed/google_sitemap.php
+++ b/upload/catalog/controller/feed/google_sitemap.php
@@ -5,6 +5,12 @@ class ControllerFeedGoogleSitemap extends Controller {
         $output  = '<?xml version="1.0" encoding="UTF-8"?>';
         $output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">';
 
+       $output .= '<url>';
+       $output .= '<loc>' . HTTP_SERVER . '</loc>';
+       $output .= '<changefreq>weekly</changefreq>';
+       $output .= '<priority>1.0</priority>';
+       $output .= '</url>';
+
         $this->load->model('catalog/product');
 
         $products = $this->model_catalog_product->getProducts();

Opencart 1.5.1.3: выдача HTTP/404 для товаров, которые отключены администратором

- Posted in Uncategorized by

В Опенкарт, если товар отключен, а внешняя ссылка на него где-то сохранилась, при переходе по ней будет отдан HTTP код 200 (OK) вместо более правильного 404 (Not Found).

Эту ситуацию исправляет одна строчка, см. патч ниже.

Спасибо: molotochek, см. http://opencartforum.ru/topic/418-%d0%bd%d0%b5-%d1%80%d0%b0%d0%b1%d0%be%d1%82%d0%b0%d0%b5%d1%82-404/page__view__findpost__p__46795

commit 6ef5a39e9e82c4e82901ce47d5304313867afb83
Author: Ruslan Brest <rb@labtodo.com>
Date:   Tue Feb 21 17:03:00 2012 +0200
    [!] HTTP/200 => HTTP/404 для товаров, которые отключены администратором
    и других страниц с ненайденными сущностями
    
    by: molotochek
    http://opencartforum.ru/topic/418-%d0%bd%d0%b5-%d1%80%d0%b0%d0%b1%d0%be%d1%82%d0%b0%d0%b5%d1%82-404/page__view__findpost__p__46795
diff --git a/upload/catalog/controller/product/product.php b/upload/catalog/controller/product/product.php
index c39ad77..c5579db 100644
--- a/upload/catalog/controller/product/product.php
+++ b/upload/catalog/controller/product/product.php
@@ -414,15 +414,13 @@ class ControllerProductProduct extends Controller {
            );
 
            $this->document->setTitle($this->language->get('text_error'));
-
            $this->data['heading_title'] = $this->language->get('text_error');
-
            $this->data['text_error'] = $this->language->get('text_error');
-
            $this->data['button_continue'] = $this->language->get('button_continue');
-
            $this->data['continue'] = $this->url->link('common/home');
 
+           $this->response->addHeader($this->request->server['SERVER_PROTOCOL'] . '/1.1 404 Not Found');
+
            if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/error/not_found.tpl')) {
                $this->template = $this->config->get('config_template') . '/template/error/not_found.tpl';
            } else {
diff --git a/upload/catalog/controller/account/download.php b/upload/catalog/controller/account/download.php
index 7b736d2..4cb0a0d 100644
--- a/upload/catalog/controller/account/download.php
+++ b/upload/catalog/controller/account/download.php
@@ -120,12 +120,11 @@ class ControllerAccountDownload extends Controller {
            $this->response->setOutput($this->render());
        } else {
            $this->data['heading_title'] = $this->language->get('heading_title');
-
            $this->data['text_error'] = $this->language->get('text_empty');
-
            $this->data['button_continue'] = $this->language->get('button_continue');
-
            $this->data['continue'] = $this->url->link('account/account', '', 'SSL');
+           
+           $this->response->addHeader($this->request->server['SERVER_PROTOCOL'] . '/1.1 404 Not Found');
 
            if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/error/not_found.tpl')) {
                $this->template = $this->config->get('config_template') . '/template/error/not_found.tpl';
diff --git a/upload/catalog/controller/account/order.php b/upload/catalog/controller/account/order.php
index cb49bef..5006970 100644
--- a/upload/catalog/controller/account/order.php
+++ b/upload/catalog/controller/account/order.php
@@ -434,6 +434,8 @@ class ControllerAccountOrder extends Controller {
            );
 
            $this->data['continue'] = $this->url->link('account/order', '', 'SSL');
+           
+           $this->response->addHeader($this->request->server['SERVER_PROTOCOL'] . '/1.1 404 Not Found');
 
            if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/error/not_found.tpl')) {
                $this->template = $this->config->get('config_template') . '/template/error/not_found.tpl';
diff --git a/upload/catalog/controller/account/return.php b/upload/catalog/controller/account/return.php
index 1575ff0..b9add37 100644
--- a/upload/catalog/controller/account/return.php
+++ b/upload/catalog/controller/account/return.php
@@ -283,12 +283,11 @@ class ControllerAccountReturn extends Controller {
            );
 
            $this->data['heading_title'] = $this->language->get('text_return');
-
            $this->data['text_error'] = $this->language->get('text_error');
-
            $this->data['button_continue'] = $this->language->get('button_continue');
-
            $this->data['continue'] = $this->url->link('account/return', '', 'SSL');
+           
+           $this->response->addHeader($this->request->server['SERVER_PROTOCOL'] . '/1.1 404 Not Found');
 
            if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/error/not_found.tpl')) {
                $this->template = $this->config->get('config_template') . '/template/error/not_found.tpl';
diff --git a/upload/catalog/controller/checkout/cart.php b/upload/catalog/controller/checkout/cart.php
index afc8660..964c180 100644
--- a/upload/catalog/controller/checkout/cart.php
+++ b/upload/catalog/controller/checkout/cart.php
@@ -277,12 +277,11 @@ class ControllerCheckoutCart extends Controller {
            $this->response->setOutput($this->render());
        } else {
            $this->data['heading_title'] = $this->language->get('heading_title');
-
            $this->data['text_error'] = $this->language->get('text_empty');
-
            $this->data['button_continue'] = $this->language->get('button_continue');
-
            $this->data['continue'] = $this->url->link('common/home');
+           
+           $this->response->addHeader($this->request->server['SERVER_PROTOCOL'] . '/1.1 404 Not Found');
 
            if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/error/not_found.tpl')) {
                $this->template = $this->config->get('config_template') . '/template/error/not_found.tpl';
diff --git a/upload/catalog/controller/error/not_found.php b/upload/catalog/controller/error/not_found.php
index 251a745..ab0758a 100644
--- a/upload/catalog/controller/error/not_found.php
+++ b/upload/catalog/controller/error/not_found.php
@@ -22,15 +22,12 @@ class ControllerErrorNotFound extends Controller {
        }
 
        $this->data['heading_title'] = $this->language->get('heading_title');
-
        $this->data['text_error'] = $this->language->get('text_error');
-
        $this->data['button_continue'] = $this->language->get('button_continue');
+       $this->data['continue'] = $this->url->link('common/home');
 
        $this->response->addHeader($this->request->server['SERVER_PROTOCOL'] . '/1.1 404 Not Found');
 
-       $this->data['continue'] = $this->url->link('common/home');
-
        if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/error/not_found.tpl')) {
            $this->template = $this->config->get('config_template') . '/template/error/not_found.tpl';
        } else {
diff --git a/upload/catalog/controller/information/information.php b/upload/catalog/controller/information/information.php
index e3b52ce..38df1c7 100644
--- a/upload/catalog/controller/information/information.php
+++ b/upload/catalog/controller/information/information.php
@@ -62,14 +62,12 @@ class ControllerInformationInformation extends Controller {
            );
 
            $this->document->setTitle($this->language->get('text_error'));
-
            $this->data['heading_title'] = $this->language->get('text_error');
-
            $this->data['text_error'] = $this->language->get('text_error');
-
            $this->data['button_continue'] = $this->language->get('button_continue');
-
            $this->data['continue'] = $this->url->link('common/home');
+           
+           $this->response->addHeader($this->request->server['SERVER_PROTOCOL'] . '/1.1 404 Not Found');
 
            if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/error/not_found.tpl')) {
                $this->template = $this->config->get('config_template') . '/template/error/not_found.tpl';
diff --git a/upload/catalog/controller/product/category.php b/upload/catalog/controller/product/category.php
index f30cb53..4ffea91 100644
--- a/upload/catalog/controller/product/category.php
+++ b/upload/catalog/controller/product/category.php
@@ -379,14 +379,12 @@ class ControllerProductCategory extends Controller {
            );
 
            $this->document->setTitle($this->language->get('text_error'));
-
            $this->data['heading_title'] = $this->language->get('text_error');
-
            $this->data['text_error'] = $this->language->get('text_error');
-
            $this->data['button_continue'] = $this->language->get('button_continue');
-
            $this->data['continue'] = $this->url->link('common/home');
+           
+           $this->response->addHeader($this->request->server['SERVER_PROTOCOL'] . '/1.1 404 Not Found');
 
            if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/error/not_found.tpl')) {
                $this->template = $this->config->get('config_template') . '/template/error/not_found.tpl';
diff --git a/upload/catalog/controller/product/manufacturer.php b/upload/catalog/controller/product/manufacturer.php
index 7dd5359..3ce6a78 100644
--- a/upload/catalog/controller/product/manufacturer.php
+++ b/upload/catalog/controller/product/manufacturer.php
@@ -414,14 +414,12 @@ class ControllerProductManufacturer extends Controller {
            );
 
            $this->document->setTitle($this->language->get('text_error'));
-
            $this->data['heading_title'] = $this->language->get('text_error');
-
            $this->data['text_error'] = $this->language->get('text_error');
-
            $this->data['button_continue'] = $this->language->get('button_continue');
-
            $this->data['continue'] = $this->url->link('common/home');
+           
+           $this->response->addHeader($this->request->server['SERVER_PROTOCOL'] . '/1.1 404 Not Found');
 
            if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/error/not_found.tpl')) {
                $this->template = $this->config->get('config_template') . '/template/error/not_found.tpl';
diff --git a/upload/catalog/controller/product/shoppica.php b/upload/catalog/controller/product/shoppica.php
index cf31414..0eb7eb0 100644
--- a/upload/catalog/controller/product/shoppica.php
+++ b/upload/catalog/controller/product/shoppica.php
@@ -338,6 +338,8 @@ class ControllerProductShoppica extends Controller
         $this->data['button_continue'] = $this->language->get('button_continue');
 
         $this->data['continue'] = HTTP_SERVER . 'index.php?route=common/home';
+        
+        $this->response->addHeader($this->request->server['SERVER_PROTOCOL'] . '/1.1 404 Not Found');
 
         if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/error/not_found.tpl')) {
             $this->template = $this->config->get('config_template') . '/template/error/not_found.tpl';
diff --git a/upload/catalog/model/checkout/order.php b/upload/catalog/model/checkout/order.php
index 8e8d414..afeb625 100644
--- a/upload/catalog/model/checkout/order.php
+++ b/upload/catalog/model/checkout/order.php
@@ -566,4 +566,4 @@ class ModelCheckoutOrder extends Model {
        }
    }
 }
-?>
+?>
\ No newline at end of file

Quickcheckout: контроль суммы заказа (не менее чем)

- Posted in Uncategorized by

Небольшое изменение для формы быстрого заказа (quickcheckout), которое можно использовать для контроля общей суммы заказа:

Для тех, кому хочется подобного:

Файл: catalog/view/theme/default/template/checkout/quickcheckout_confirm.tpl

найти:

<div class="payment"><?php echo $payment; ?></div>

заменить на:

<?php if($total['value'] < 1000) { ?>
       <div class="warning">Сумма заказа должна быть не менее 1000 руб.!</div>
<?php } else { ?>
       <div class="payment"><?php echo $payment; ?></div>
<?php } ?>