Jump to content
  • разработка интернет магазинов на opencart
  • доработка интернет магазинов на opencart

Opencart Версия 1.5.5.1.2 редактирование option_list.tpl - нужна помощь


Recommended Posts

Opencart Версия 1.5.5.1.2

Решил добавить 1 столбец в бд для вывода дополнительного поля в option_list.tpl

Зналит ик...

Добавлено в файл option_list.tpl

<div style="width:500px;"><hr>Спецификация:<br>
   <?php echo ($product['spec']);?><br><hr>
   </div>

 

Добавлено в файл order.php (контроллер)

if (isset($this->request->post['spec'])) {
              $this->data['spec'] = $this->request->post['spec'];
        } elseif (!empty($order_info)) { 
            $this->data['spec'] = $order_info['spec'];
        } else {
              $this->data['spec'] = '';
        }
'spec'         => $product['spec'],

 

Добавлено в файл order.php (могдель)

spec = '" . $this->db->escape($order_product['spec']) . "'");

В 2-х месих

 

Создан столбец в 2-х иблицах oc_order_product и oc_product

Название столбца spec

 

 

 

Не могу понять, почему при оформлении заказа у меня не обновляется поле в столбэто spec, оно осиётся пустым, хотя я спецификацию заполнял и она есть в иблиэто oc_order_product

Прошу помощи

 

P.S. spec есть в массиве 

<pre><?php print_r($product) ?></pre>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

    [image] => data/nov/IMG_0985.JPG
    [spec] => 
    [option] => Array
        (
        )

    [quantity] => 1
    [price] => 2250 руб.
    [total] => 2250 руб.

 

Edited by gorodetskiy
Link to comment
Share on other sites


вы хоть в логах посмотрите. ответ им бугдет, а не на форуме.

платно то бугдет по этоне хорошей книги. Но книга то полезнее

Link to comment
Share on other sites

20 часов назад, nikifalex сказал:

вы хоть в логах посмотрите. ответ им бугдет, а не на форуме.

платно то бугдет по этоне хорошей книги. Но книга то полезнее

В логах тишь, да гладь )))

Сейчас не до книг, сроки)

Link to comment
Share on other sites


42 минуты назад, gorodetskiy сказал:

В логах тишь, да гладь )))

Сейчас не до книг, сроки)

    public function getOrderProducts($order_id) {
        $query = $this->db->query("SELECT op.*, p.image, pd.description, p.spec FROM `" . DB_PREFIX . "order_product` op LEFT JOIN `" . DB_PREFIX . "product` p ON (p.product_id = op.product_id) LEFT JOIN `".DB_PREFIX."product_description` pd ON pd.product_id = op.product_id WHERE order_id = '" . (int)$order_id . "'");
        return $query->rows;
    }
Вот и решение проблемы)

 

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.