Друзья, никак не могу справится с проблемой вывода mpn на страницу закладок Ранее этот Mpn вывел и в категории и в модули отдельные, везде был принцип примерно одинаков, в контроллер добавляем в $data['products'][] = array следующее 'mpn' => $this->currency->format((float)$product['mpn']); И далее выводим в шаблоне А вот в контроллере wishlist не прокатило, просто ничего не выводит Код wishlist прилагаю Спойлер Код: <?php class ControllerAccountWishList extends Controller { public function index() { if (!$this->customer->isLogged()) { $this->session->data['redirect'] = $this->url->link('account/wishlist', '', true); $this->response->redirect($this->url->link('account/login', '', true)); } $this->load->language('account/wishlist'); $this->load->model('account/wishlist'); $this->load->model('catalog/product'); $this->load->model('tool/image'); if (isset($this->request->get['remove'])) { // Remove Wishlist $this->model_account_wishlist->deleteWishlist($this->request->get['remove']); $this->session->data['success'] = $this->language->get('text_remove'); $this->response->redirect($this->url->link('account/wishlist')); } $this->document->setTitle($this->language->get('heading_title')); $data['breadcrumbs'] = array(); $data['breadcrumbs'][] = array( 'text' => $this->language->get('text_home'), 'href' => $this->url->link('common/home') ); $data['breadcrumbs'][] = array( 'text' => $this->language->get('text_account'), 'href' => $this->url->link('account/account', '', true) ); $data['breadcrumbs'][] = array( 'text' => $this->language->get('heading_title'), 'href' => $this->url->link('account/wishlist') ); $data['heading_title'] = $this->language->get('heading_title'); $data['text_empty'] = $this->language->get('text_empty'); $data['column_image'] = $this->language->get('column_image'); $data['column_name'] = $this->language->get('column_name'); $data['column_model'] = $this->language->get('column_model'); $data['column_stock'] = $this->language->get('column_stock'); $data['column_price'] = $this->language->get('column_price'); $data['column_action'] = $this->language->get('column_action'); $data['button_continue'] = $this->language->get('button_continue'); $data['button_cart'] = $this->language->get('button_cart'); $data['button_remove'] = $this->language->get('button_remove'); if (isset($this->session->data['success'])) { $data['success'] = $this->session->data['success']; unset($this->session->data['success']); } else { $data['success'] = ''; } $data['products'] = array(); $results = $this->model_account_wishlist->getWishlist(); foreach ($results as $result) { $product_info = $this->model_catalog_product->getProduct($result['product_id']); if ($product_info) { if ($product_info['image']) { $image = $this->model_tool_image->resize($product_info['image'], $this->config->get($this->config->get('config_theme') . '_image_wishlist_width'), $this->config->get($this->config->get('config_theme') . '_image_wishlist_height')); } else { $image = false; } if ($product_info['quantity'] <= 0) { $stock = $product_info['stock_status']; } elseif ($this->config->get('config_stock_display')) { $stock = $product_info['quantity']; } else { $stock = $this->language->get('text_instock'); } if ($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')), $this->session->data['currency']); } 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')), $this->session->data['currency']); } else { $special = false; } $data['products'][] = array( 'product_id' => $product_info['product_id'], 'thumb' => $image, 'name' => $product_info['name'], 'mpn' => $this->currency->format((float)$product['mpn']); 'model' => $product_info['model'], 'stock' => $stock, 'price' => $price, 'special' => $special, 'href' => $this->url->link('product/product', 'product_id=' . $product_info['product_id']), 'remove' => $this->url->link('account/wishlist', 'remove=' . $product_info['product_id']) ); } else { $this->model_account_wishlist->deleteWishlist($result['product_id']); } } $data['continue'] = $this->url->link('account/account', '', true); $data['column_left'] = $this->load->controller('common/column_left'); $data['column_right'] = $this->load->controller('common/column_right'); $data['content_top'] = $this->load->controller('common/content_top'); $data['content_bottom'] = $this->load->controller('common/content_bottom'); $data['footer'] = $this->load->controller('common/footer'); $data['header'] = $this->load->controller('common/header'); $this->response->setOutput($this->load->view('account/wishlist', $data)); } public function add() { $this->load->language('account/wishlist'); $json = array(); if (isset($this->request->post['product_id'])) { $product_id = $this->request->post['product_id']; } else { $product_id = 0; } $this->load->model('catalog/product'); $product_info = $this->model_catalog_product->getProduct($product_id); if ($product_info) { if ($this->customer->isLogged()) { // Edit customers cart $this->load->model('account/wishlist'); $this->model_account_wishlist->addWishlist($this->request->post['product_id']); $json['success'] = sprintf($this->language->get('text_success'), $this->url->link('product/product', 'product_id=' . (int)$this->request->post['product_id']), $product_info['name'], $this->url->link('account/wishlist')); $json['total'] = sprintf($this->language->get('text_wishlist'), $this->model_account_wishlist->getTotalWishlist()); } else { if (!isset($this->session->data['wishlist'])) { $this->session->data['wishlist'] = array(); } $this->session->data['wishlist'][] = $this->request->post['product_id']; $this->session->data['wishlist'] = array_unique($this->session->data['wishlist']); $json['success'] = sprintf($this->language->get('text_login'), $this->url->link('account/login', '', true), $this->url->link('account/register', '', true), $this->url->link('product/product', 'product_id=' . (int)$this->request->post['product_id']), $product_info['name'], $this->url->link('account/wishlist')); $json['total'] = sprintf($this->language->get('text_wishlist'), (isset($this->session->data['wishlist']) ? count($this->session->data['wishlist']) : 0)); } } $this->response->addHeader('Content-Type: application/json'); $this->response->setOutput(json_encode($json)); } } Где что я упускаю? И делал $product['mpn'] и $product_info['mpn'] Все бесполезно
На сайте куча изменений, внесенных в system/storage/modification , поэтому обновлять модификаторы - это как открыть ящик пандоры) Но я $product_info['mpn'] вносил сразу в system/storage/modification и не помогло(
может для закладок какой-то модуль другой установлен? тогда другие контроллер и вьюха. покажите как во вьюхе выводите
Вообще в настройках модуля (lightshop) есть пункт -Избранное без регистрации, и он выбран. Но в файлах шаблона не нашел ничего касаемо wishlist Вьюха точно та, т.к. иные изменения отражаются там Спойлер Код: <?php if ($products) { ?> <table class="catalogue__table active"> <?php foreach ($products as $product) { ?> <tr class="catalogue__table-row"> <td class="catalogue__table-photo" style="padding: 10px 5px 0px 10px; width: 250px;"> <a href="<?php echo $product['href']; ?>" class="catalogue__photo-link"> <img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>"> </a> </td> <td class="catalogue__table-name"> <a href="<?php echo $product['href']; ?>" class="catalogue__product-name"> <?php echo $product['name']; ?> </a> <div style="display: flex;"><p style="padding: 3px 3px 3px 0px; color: #acacac;">Код товара: </p><p style="padding: 3px; color: #acacac;"><?php echo $product['model']; ?></p></div> </td> <td class="catalogue__table-price"> <span class="catalogue__price catalogue__price--md"> <?php echo $product['mpn']; ?> </span> </td> <td class="catalogue__table-btn" style="position: relative;"> <a class="catalogue__table-action-link" href="<?php echo $product['remove']; ?>"> <span class="catalogue__table-action-icon"> <svg class="icon-cross"> <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#cross"></use> </svg> </span> </a> <a href="#popup-buy-click" data-for="<?php echo $product_id; ?>" data-typefrom="product" class="js-fancy-popup-cart btn products-full-list__btn" style=" width: 190px;height: 50px;white-space: normal; left: 15px" id="buyonecll"><?php echo $text_lightshop_buy_click; ?></a> </td> <td class="catalogue__table-action"> <span class="catalogue__table-action-item"> <a class="catalogue__table-action-link" href="<?php echo $product['remove']; ?>"> <span class="catalogue__table-action-icon"> <svg class="icon-cross"> <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#cross"></use> </svg> </span> <span class="catalogue__table-action-text"> <?php echo $button_remove; ?> </span> </a> </span> </td> </tr> <?php } ?>
Просто наиогромнейшее спасибо!!! Точка с запятой была одна из ошибок) Еще две ошибки были: 1. Шаблон я менял в system/storage, а контроллер в catalog (надо все же чаще спать) 2. В контроллер правильнее вносить так Спойлер Код: 'mpn' => $this->currency->format((float)$product_info['mpn'], $this->config->get('config_currency')), Иначе будут ошибки В любом случае, именно с Вашего совета я распутал эту цепочку) Спасибо еще раз)