Alexandr59 Posted September 1, 2018 Share Posted September 1, 2018 (edited) Привет! Версия ocStore 2.3.0.2.2 Как вывести колонку артикул в таблице с заказом на странице корзины? Где можно определить переменную $sku ? Разбираюсь по порядку, сначала заголовок таблицы. Заголовок таблицы: <td class="text-center"><?php echo $column_image; ?></td> <td class="text-left"><?php echo $column_name; ?></td> <td class="text-left"><?php echo $column_model; ?></td> <td class="text-left"><?php echo $column_quantity; ?></td> <td class="text-right"><?php echo $column_price; ?></td> <td class="text-right"><?php echo $column_total; ?></td> Насколько понял, у артикула переменная $sku. И чтобы вывести название Артикул, требуется добавить такую колонку: <td class="text-left"><?php echo $sku; ?></td> Либо эту <td class="text-left"><?php echo $column_sku; ?></td> Но они не работают. Оба результата выдают: Notice: Undefined variable: column_sku in ... Что в переводе на наш язык - Переменная не определенная. Иду в catalog/controller/product/product.php контроллер и пытаюсь определить переменную там: $data['sku'] = $product_info['sku']; Но ошибка остается. что делать? Также безуспешно пытаюсь в строке с товаром вывести его артикул таким кодом <td class="text-left"> <?php if($sku): ?> Артикул: <?=$sku;?> <?php endif; ?> </td> Edited September 1, 2018 by Alexandr59 Link to comment Share on other sites More sharing options...
fanatic Posted September 1, 2018 Share Posted September 1, 2018 5 минут назад, Alexandr59 сказал: Иду в catalog/controller/product/product.php контроллер и пытаюсь определить переменную там: вы же хотите вывести в корзине, при чем контроллер продукта? Link to comment Share on other sites More sharing options... Alexandr59 Posted September 1, 2018 Author Share Posted September 1, 2018 1 минуту назад, fanatic сказал: вы же хотите вывести в корзине, при чем контроллер продукта? Перечитал мануалов. Еще больше запутался( Поскольку переменная не определена, ее нужно где-то определить. Как это можно сделать? Link to comment Share on other sites More sharing options... Tank Posted September 1, 2018 Share Posted September 1, 2018 <?php echo $product['sku']; ?> же не? Link to comment Share on other sites More sharing options... Alexandr59 Posted September 1, 2018 Author Share Posted September 1, 2018 3 минуты назад, Tank сказал: <?php echo $product['sku']; ?> же не? Выдает ошибку Notice: Undefined variable: product Link to comment Share on other sites More sharing options... Tank Posted September 1, 2018 Share Posted September 1, 2018 Так в контроллере корзины подцепите его Link to comment Share on other sites More sharing options... fanatic Posted September 1, 2018 Share Posted September 1, 2018 2 минуты назад, Tank сказал: Так в контроллере корзины подцепите его а перед этим в getProducts Link to comment Share on other sites More sharing options... fanatic Posted September 1, 2018 Share Posted September 1, 2018 sustem/library/cart/cart.php метод getProducts $product_data[] = array( 'cart_id' => $cart['cart_id'], 'product_id' => $product_query->row['product_id'], 'name' => $product_query->row['name'], 'model' => $product_query->row['model'], 'shipping' => $product_query->row['shipping'], 'image' => $product_query->row['image'], 'option' => $option_data, 'download' => $download_data, 'quantity' => $cart['quantity'], 'minimum' => $product_query->row['minimum'], 'subtract' => $product_query->row['subtract'], 'stock' => $stock, 'price' => ($price + $option_price), 'total' => ($price + $option_price) * $cart['quantity'], 'reward' => $reward * $cart['quantity'], 'points' => ($product_query->row['points'] ? ($product_query->row['points'] + $option_points) * $cart['quantity'] : 0), 'tax_class_id' => $product_query->row['tax_class_id'], 'weight' => ($product_query->row['weight'] + $option_weight) * $cart['quantity'], 'weight_class_id' => $product_query->row['weight_class_id'], 'length' => $product_query->row['length'], 'width' => $product_query->row['width'], 'height' => $product_query->row['height'], 'length_class_id' => $product_query->row['length_class_id'], 'recurring' => $recurring, 'sku' => $product_query->row['sku']// добавить ); catalog/controller/checkout/cart.php $data['products'][] = array( 'cart_id' => $product['cart_id'], 'thumb' => $image, 'name' => $product['name'], 'model' => $product['model'], 'option' => $option_data, 'recurring' => $recurring, 'quantity' => $product['quantity'], 'stock' => $product['stock'] ? true : !(!$this->config->get('config_stock_checkout') || $this->config->get('config_stock_warning')), 'reward' => ($product['reward'] ? sprintf($this->language->get('text_points'), $product['reward']) : ''), 'price' => $price, 'total' => $total, 'href' => $this->url->link('product/product', 'product_id=' . $product['product_id']), 'sku' => $product['sku'] // добавить ); шаблон <td class="text-center">Артикул</td> <td><?php echo $product['sku']; ?></td> с переменными локализации, надеюсь разберетесь сами 1 Link to comment Share on other sites More sharing options... Alexandr59 Posted September 1, 2018 Author Share Posted September 1, 2018 Спасибо всем ответившим! Тема закрыта Link to comment Share on other sites More sharing options... 3 yr Tom locked this topic This topic is now closed to further replies. Share More sharing options... Followers 0 Go to topic listing Similar Content [Решено] Убрать поднятие страницы вверх при добавлении товара в корзину By igorfelix, April 5, 2013 вверх страницы корзина 14 replies 7,542 views weblab1 8 hours ago Как вывести URL языка в language.tpl By Djoser, Monday at 04:47 PM 0 replies 83 views Djoser Monday at 04:47 PM SKU (артикул) в письмо админу или в админку в заказе. By Alexidi76, February 1, 2016 артикул 8 replies 1,343 views Ozzyy June 4 Артикул для Опций в "Опциях"🤷♂️ By sithfrozen, April 26 3 replies 225 views sithfrozen April 26 Вывести среднюю оценку отзывов By Predators, November 10, 2019 8 replies 518 views mss June 16 Recently Browsing 0 members No registered users viewing this page. Последние темы Последние дополнения Последние новости All Activity Home Opencart 2.x Opencart 2.x: General questions [Решено] Как вывести колонку Артикул в таблице в корзине? Покупателям Оплата дополнений физическими лицами Оплата дополнений юридическими лицами Политика возвратов Разработчикам Регламент размещения дополнений Регламент продаж и поддержки дополнений Виртуальный аккаунт автора Политика продвижения объявлений API каталога дополнений Урегулирование споров по авторским правам Полезная информация Публичная оферта Политика возвратов Политика конфиденциальности Платежная политика Политика Передачи Персональных Данных Политика прозрачности Последние дополнения Обновление курса валют Приватбанк, Монобанк, НБУ для Opencart/Ocstore By bogdan281989 Deluxe - адаптивный, универсальный шаблон By aridius Кнопка view в списках (товар, категория, производитель, статья) By chukcha Автоматическое заполнение URL для 4.0 By chukcha Шаблон Nice (Free Edition) для OpenCart 3 By SergeTkach × Existing user? Sign In Sign Up Shopping section Back Purchased extensions Invoices Whishlist Alternative Contacts Forums ocStore Back Official site Demo ocStore 3.0.3.2 Demo ocStore 2.3.0.2.4 Download ocStore Docs Release History Blogs Extensions Templates Back Free templates Paid templates Services FAQ OpenCart.Pro Back Demo Buy Compare Hosting for OpenCart × 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. I accept
Alexandr59 Posted September 1, 2018 Author Share Posted September 1, 2018 1 минуту назад, fanatic сказал: вы же хотите вывести в корзине, при чем контроллер продукта? Перечитал мануалов. Еще больше запутался( Поскольку переменная не определена, ее нужно где-то определить. Как это можно сделать? Link to comment Share on other sites More sharing options...
Tank Posted September 1, 2018 Share Posted September 1, 2018 <?php echo $product['sku']; ?> же не? Link to comment Share on other sites More sharing options... Alexandr59 Posted September 1, 2018 Author Share Posted September 1, 2018 3 минуты назад, Tank сказал: <?php echo $product['sku']; ?> же не? Выдает ошибку Notice: Undefined variable: product Link to comment Share on other sites More sharing options... Tank Posted September 1, 2018 Share Posted September 1, 2018 Так в контроллере корзины подцепите его Link to comment Share on other sites More sharing options... fanatic Posted September 1, 2018 Share Posted September 1, 2018 2 минуты назад, Tank сказал: Так в контроллере корзины подцепите его а перед этим в getProducts Link to comment Share on other sites More sharing options... fanatic Posted September 1, 2018 Share Posted September 1, 2018 sustem/library/cart/cart.php метод getProducts $product_data[] = array( 'cart_id' => $cart['cart_id'], 'product_id' => $product_query->row['product_id'], 'name' => $product_query->row['name'], 'model' => $product_query->row['model'], 'shipping' => $product_query->row['shipping'], 'image' => $product_query->row['image'], 'option' => $option_data, 'download' => $download_data, 'quantity' => $cart['quantity'], 'minimum' => $product_query->row['minimum'], 'subtract' => $product_query->row['subtract'], 'stock' => $stock, 'price' => ($price + $option_price), 'total' => ($price + $option_price) * $cart['quantity'], 'reward' => $reward * $cart['quantity'], 'points' => ($product_query->row['points'] ? ($product_query->row['points'] + $option_points) * $cart['quantity'] : 0), 'tax_class_id' => $product_query->row['tax_class_id'], 'weight' => ($product_query->row['weight'] + $option_weight) * $cart['quantity'], 'weight_class_id' => $product_query->row['weight_class_id'], 'length' => $product_query->row['length'], 'width' => $product_query->row['width'], 'height' => $product_query->row['height'], 'length_class_id' => $product_query->row['length_class_id'], 'recurring' => $recurring, 'sku' => $product_query->row['sku']// добавить ); catalog/controller/checkout/cart.php $data['products'][] = array( 'cart_id' => $product['cart_id'], 'thumb' => $image, 'name' => $product['name'], 'model' => $product['model'], 'option' => $option_data, 'recurring' => $recurring, 'quantity' => $product['quantity'], 'stock' => $product['stock'] ? true : !(!$this->config->get('config_stock_checkout') || $this->config->get('config_stock_warning')), 'reward' => ($product['reward'] ? sprintf($this->language->get('text_points'), $product['reward']) : ''), 'price' => $price, 'total' => $total, 'href' => $this->url->link('product/product', 'product_id=' . $product['product_id']), 'sku' => $product['sku'] // добавить ); шаблон <td class="text-center">Артикул</td> <td><?php echo $product['sku']; ?></td> с переменными локализации, надеюсь разберетесь сами 1 Link to comment Share on other sites More sharing options... Alexandr59 Posted September 1, 2018 Author Share Posted September 1, 2018 Спасибо всем ответившим! Тема закрыта Link to comment Share on other sites More sharing options... 3 yr Tom locked this topic This topic is now closed to further replies. Share More sharing options... Followers 0 Go to topic listing Similar Content [Решено] Убрать поднятие страницы вверх при добавлении товара в корзину By igorfelix, April 5, 2013 вверх страницы корзина 14 replies 7,542 views weblab1 8 hours ago Как вывести URL языка в language.tpl By Djoser, Monday at 04:47 PM 0 replies 83 views Djoser Monday at 04:47 PM SKU (артикул) в письмо админу или в админку в заказе. By Alexidi76, February 1, 2016 артикул 8 replies 1,343 views Ozzyy June 4 Артикул для Опций в "Опциях"🤷♂️ By sithfrozen, April 26 3 replies 225 views sithfrozen April 26 Вывести среднюю оценку отзывов By Predators, November 10, 2019 8 replies 518 views mss June 16 Recently Browsing 0 members No registered users viewing this page. Последние темы Последние дополнения Последние новости All Activity Home Opencart 2.x Opencart 2.x: General questions [Решено] Как вывести колонку Артикул в таблице в корзине? Покупателям Оплата дополнений физическими лицами Оплата дополнений юридическими лицами Политика возвратов Разработчикам Регламент размещения дополнений Регламент продаж и поддержки дополнений Виртуальный аккаунт автора Политика продвижения объявлений API каталога дополнений Урегулирование споров по авторским правам Полезная информация Публичная оферта Политика возвратов Политика конфиденциальности Платежная политика Политика Передачи Персональных Данных Политика прозрачности Последние дополнения Обновление курса валют Приватбанк, Монобанк, НБУ для Opencart/Ocstore By bogdan281989 Deluxe - адаптивный, универсальный шаблон By aridius Кнопка view в списках (товар, категория, производитель, статья) By chukcha Автоматическое заполнение URL для 4.0 By chukcha Шаблон Nice (Free Edition) для OpenCart 3 By SergeTkach
Alexandr59 Posted September 1, 2018 Author Share Posted September 1, 2018 3 минуты назад, Tank сказал: <?php echo $product['sku']; ?> же не? Выдает ошибку Notice: Undefined variable: product Link to comment Share on other sites More sharing options...
Tank Posted September 1, 2018 Share Posted September 1, 2018 Так в контроллере корзины подцепите его Link to comment Share on other sites More sharing options... fanatic Posted September 1, 2018 Share Posted September 1, 2018 2 минуты назад, Tank сказал: Так в контроллере корзины подцепите его а перед этим в getProducts Link to comment Share on other sites More sharing options... fanatic Posted September 1, 2018 Share Posted September 1, 2018 sustem/library/cart/cart.php метод getProducts $product_data[] = array( 'cart_id' => $cart['cart_id'], 'product_id' => $product_query->row['product_id'], 'name' => $product_query->row['name'], 'model' => $product_query->row['model'], 'shipping' => $product_query->row['shipping'], 'image' => $product_query->row['image'], 'option' => $option_data, 'download' => $download_data, 'quantity' => $cart['quantity'], 'minimum' => $product_query->row['minimum'], 'subtract' => $product_query->row['subtract'], 'stock' => $stock, 'price' => ($price + $option_price), 'total' => ($price + $option_price) * $cart['quantity'], 'reward' => $reward * $cart['quantity'], 'points' => ($product_query->row['points'] ? ($product_query->row['points'] + $option_points) * $cart['quantity'] : 0), 'tax_class_id' => $product_query->row['tax_class_id'], 'weight' => ($product_query->row['weight'] + $option_weight) * $cart['quantity'], 'weight_class_id' => $product_query->row['weight_class_id'], 'length' => $product_query->row['length'], 'width' => $product_query->row['width'], 'height' => $product_query->row['height'], 'length_class_id' => $product_query->row['length_class_id'], 'recurring' => $recurring, 'sku' => $product_query->row['sku']// добавить ); catalog/controller/checkout/cart.php $data['products'][] = array( 'cart_id' => $product['cart_id'], 'thumb' => $image, 'name' => $product['name'], 'model' => $product['model'], 'option' => $option_data, 'recurring' => $recurring, 'quantity' => $product['quantity'], 'stock' => $product['stock'] ? true : !(!$this->config->get('config_stock_checkout') || $this->config->get('config_stock_warning')), 'reward' => ($product['reward'] ? sprintf($this->language->get('text_points'), $product['reward']) : ''), 'price' => $price, 'total' => $total, 'href' => $this->url->link('product/product', 'product_id=' . $product['product_id']), 'sku' => $product['sku'] // добавить ); шаблон <td class="text-center">Артикул</td> <td><?php echo $product['sku']; ?></td> с переменными локализации, надеюсь разберетесь сами 1 Link to comment Share on other sites More sharing options... Alexandr59 Posted September 1, 2018 Author Share Posted September 1, 2018 Спасибо всем ответившим! Тема закрыта Link to comment Share on other sites More sharing options... 3 yr Tom locked this topic This topic is now closed to further replies. Share More sharing options... Followers 0 Go to topic listing Similar Content [Решено] Убрать поднятие страницы вверх при добавлении товара в корзину By igorfelix, April 5, 2013 вверх страницы корзина 14 replies 7,542 views weblab1 8 hours ago Как вывести URL языка в language.tpl By Djoser, Monday at 04:47 PM 0 replies 83 views Djoser Monday at 04:47 PM SKU (артикул) в письмо админу или в админку в заказе. By Alexidi76, February 1, 2016 артикул 8 replies 1,343 views Ozzyy June 4 Артикул для Опций в "Опциях"🤷♂️ By sithfrozen, April 26 3 replies 225 views sithfrozen April 26 Вывести среднюю оценку отзывов By Predators, November 10, 2019 8 replies 518 views mss June 16 Recently Browsing 0 members No registered users viewing this page. Последние темы Последние дополнения Последние новости All Activity Home Opencart 2.x Opencart 2.x: General questions [Решено] Как вывести колонку Артикул в таблице в корзине?
fanatic Posted September 1, 2018 Share Posted September 1, 2018 2 минуты назад, Tank сказал: Так в контроллере корзины подцепите его а перед этим в getProducts Link to comment Share on other sites More sharing options... fanatic Posted September 1, 2018 Share Posted September 1, 2018 sustem/library/cart/cart.php метод getProducts $product_data[] = array( 'cart_id' => $cart['cart_id'], 'product_id' => $product_query->row['product_id'], 'name' => $product_query->row['name'], 'model' => $product_query->row['model'], 'shipping' => $product_query->row['shipping'], 'image' => $product_query->row['image'], 'option' => $option_data, 'download' => $download_data, 'quantity' => $cart['quantity'], 'minimum' => $product_query->row['minimum'], 'subtract' => $product_query->row['subtract'], 'stock' => $stock, 'price' => ($price + $option_price), 'total' => ($price + $option_price) * $cart['quantity'], 'reward' => $reward * $cart['quantity'], 'points' => ($product_query->row['points'] ? ($product_query->row['points'] + $option_points) * $cart['quantity'] : 0), 'tax_class_id' => $product_query->row['tax_class_id'], 'weight' => ($product_query->row['weight'] + $option_weight) * $cart['quantity'], 'weight_class_id' => $product_query->row['weight_class_id'], 'length' => $product_query->row['length'], 'width' => $product_query->row['width'], 'height' => $product_query->row['height'], 'length_class_id' => $product_query->row['length_class_id'], 'recurring' => $recurring, 'sku' => $product_query->row['sku']// добавить ); catalog/controller/checkout/cart.php $data['products'][] = array( 'cart_id' => $product['cart_id'], 'thumb' => $image, 'name' => $product['name'], 'model' => $product['model'], 'option' => $option_data, 'recurring' => $recurring, 'quantity' => $product['quantity'], 'stock' => $product['stock'] ? true : !(!$this->config->get('config_stock_checkout') || $this->config->get('config_stock_warning')), 'reward' => ($product['reward'] ? sprintf($this->language->get('text_points'), $product['reward']) : ''), 'price' => $price, 'total' => $total, 'href' => $this->url->link('product/product', 'product_id=' . $product['product_id']), 'sku' => $product['sku'] // добавить ); шаблон <td class="text-center">Артикул</td> <td><?php echo $product['sku']; ?></td> с переменными локализации, надеюсь разберетесь сами 1 Link to comment Share on other sites More sharing options... Alexandr59 Posted September 1, 2018 Author Share Posted September 1, 2018 Спасибо всем ответившим! Тема закрыта Link to comment Share on other sites More sharing options... 3 yr Tom locked this topic This topic is now closed to further replies. Share More sharing options... Followers 0 Go to topic listing Similar Content [Решено] Убрать поднятие страницы вверх при добавлении товара в корзину By igorfelix, April 5, 2013 вверх страницы корзина 14 replies 7,542 views weblab1 8 hours ago Как вывести URL языка в language.tpl By Djoser, Monday at 04:47 PM 0 replies 83 views Djoser Monday at 04:47 PM SKU (артикул) в письмо админу или в админку в заказе. By Alexidi76, February 1, 2016 артикул 8 replies 1,343 views Ozzyy June 4 Артикул для Опций в "Опциях"🤷♂️ By sithfrozen, April 26 3 replies 225 views sithfrozen April 26 Вывести среднюю оценку отзывов By Predators, November 10, 2019 8 replies 518 views mss June 16 Recently Browsing 0 members No registered users viewing this page.
fanatic Posted September 1, 2018 Share Posted September 1, 2018 sustem/library/cart/cart.php метод getProducts $product_data[] = array( 'cart_id' => $cart['cart_id'], 'product_id' => $product_query->row['product_id'], 'name' => $product_query->row['name'], 'model' => $product_query->row['model'], 'shipping' => $product_query->row['shipping'], 'image' => $product_query->row['image'], 'option' => $option_data, 'download' => $download_data, 'quantity' => $cart['quantity'], 'minimum' => $product_query->row['minimum'], 'subtract' => $product_query->row['subtract'], 'stock' => $stock, 'price' => ($price + $option_price), 'total' => ($price + $option_price) * $cart['quantity'], 'reward' => $reward * $cart['quantity'], 'points' => ($product_query->row['points'] ? ($product_query->row['points'] + $option_points) * $cart['quantity'] : 0), 'tax_class_id' => $product_query->row['tax_class_id'], 'weight' => ($product_query->row['weight'] + $option_weight) * $cart['quantity'], 'weight_class_id' => $product_query->row['weight_class_id'], 'length' => $product_query->row['length'], 'width' => $product_query->row['width'], 'height' => $product_query->row['height'], 'length_class_id' => $product_query->row['length_class_id'], 'recurring' => $recurring, 'sku' => $product_query->row['sku']// добавить ); catalog/controller/checkout/cart.php $data['products'][] = array( 'cart_id' => $product['cart_id'], 'thumb' => $image, 'name' => $product['name'], 'model' => $product['model'], 'option' => $option_data, 'recurring' => $recurring, 'quantity' => $product['quantity'], 'stock' => $product['stock'] ? true : !(!$this->config->get('config_stock_checkout') || $this->config->get('config_stock_warning')), 'reward' => ($product['reward'] ? sprintf($this->language->get('text_points'), $product['reward']) : ''), 'price' => $price, 'total' => $total, 'href' => $this->url->link('product/product', 'product_id=' . $product['product_id']), 'sku' => $product['sku'] // добавить ); шаблон <td class="text-center">Артикул</td> <td><?php echo $product['sku']; ?></td> с переменными локализации, надеюсь разберетесь сами 1 Link to comment Share on other sites More sharing options... Alexandr59 Posted September 1, 2018 Author Share Posted September 1, 2018 Спасибо всем ответившим! Тема закрыта Link to comment Share on other sites More sharing options... 3 yr Tom locked this topic This topic is now closed to further replies. Share More sharing options... Followers 0
Alexandr59 Posted September 1, 2018 Author Share Posted September 1, 2018 Спасибо всем ответившим! Тема закрыта Link to comment Share on other sites More sharing options...
Recommended Posts