Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Maxots

Newbie
  
  • Posts

    21
  • Joined

  • Last visited

Maxots's Achievements

Apprentice

Apprentice (3/14)

  • First Post
  • Collaborator
  • Conversation Starter
  • Week One Done
  • One Month Later

Recent Badges

0

Reputation

  1. Решил правкой кода в файле /catalog/view/theme/default/template/module/information.tpl: <div class="box"> <div class="box-heading"><?php echo $heading_title; ?></div> <div class="box-content"> <div class="box-category"> <ul class="list-unstyled info_menu"> <?php $i = 1; if ($_SERVER['REQUEST_URI']=="/about_us" || $_SERVER['REQUEST_URI'] == "/prod" || $_SERVER['REQUEST_URI'] == "/sized" || $_SERVER['REQUEST_URI'] == "/reviews" || $_SERVER['REQUEST_URI'] == "/certificates"){ foreach ($informations as $information) { $i++; if($i > 6) break; ?> <li><a href="<?php echo $information['href']; ?>"><?php echo $information['title']; ?></a></li> <?php } ?> <?php } if ($_SERVER['REQUEST_URI']=="/byers" || $_SERVER['REQUEST_URI'] == "/payment_and_delivery" || $_SERVER['REQUEST_URI'] == "/pre-order" || $_SERVER['REQUEST_URI'] == "/faq" || $_SERVER['REQUEST_URI'] == "/contract" || $_SERVER['REQUEST_URI'] == "/recommended" || $_SERVER['REQUEST_URI'] == "/for_byers"){ foreach ($informations as $information) { $i++; if($i > 13)break; if ($i> 6 or $i > 13){ ?> <li><a href="<?php echo $information['href']; ?>"><?php echo $information['title']; ?></a></li> <?php } } }?> </ul> </div> </div> </div>
  2. Всем привет! Наткнулся на проблему: нужно вывести меню со статьями на сайте. Только есть нюанс: надо выводить только определенные статьи. Например в горизонтальном меню (под шапкой сразу) есть пункт: Новости. При нажатии на него в блоке с контентом (по центру) появляется новость и в левой колонке сслыки в виде меню все статьи типа новости. Есть пункт еще "О нас" (в горизонтальном меню под шапкой сразу). При нажатии на него появляется уже другое меню (где до этого было меню с перечнем новостей). Это реализуется только с помощью правки кода? Либо есть какой-то модуль? Заранее спасибо!
  3. Спасибо вам больше! Разобрался - заработало! И правда, еще есть папка lib где надо было добавить по аналогии 'upc' => $product_query->row['upc'], Все выводит, все работает. Еще раз большое спасибо!
  4. Да, я так и делаю (но без языковых файлов), но переменная почему-то пуста ( Если вывожу переменную в карточке товара работает. В корзине - не хочет
  5. В том то и дело, что переменная хранится не в $product['upc'], а в $product_info['upc']. И как передать этот массив в этот контроллер непонятно (
  6. Получается ничему. Я так понимаю она должна как-то передаваться в этот контроллер. Как переменную upc передать в контроллер корзины?
  7. Добавляю такой код: $this->data['upc'] = $upc; в контроллер и вывожу в темплейт. Ошибка пропала. Но ничего не выводится. Не то делаю?
  8. Спасибо! Точно, нашел контроллер в одноименной папке. Только не понятно куда вставлять $this->data['upc']. <?php class ControllerCheckoutCartPopup extends Controller { public function index() { $this->language->load('module/cart_popup'); if (isset($this->request->get['updateKey']) && isset($this->request->get['updateQuantiyPlus'])) { $quantityPlus = (int)$this->request->get['updateQuantiyPlus'] + 1; $this->cart->update($this->request->get['updateKey'], $quantityPlus); } if (isset($this->request->get['updateKey']) && isset($this->request->get['updateQuantiyMinus'])) { $quantityMinus = (int)$this->request->get['updateQuantiyMinus'] - 1; if ($quantityMinus > 0) { $this->cart->update($this->request->get['updateKey'], $quantityMinus); } } if (isset($this->request->get['remove'])) { $this->cart->remove($this->request->get['remove']); unset($this->session->data['vouchers'][$this->request->get['remove']]); } // Totals $this->load->model('setting/extension'); $total_data = array(); $total = 0; $taxes = $this->cart->getTaxes(); // Display prices if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) { $sort_order = array(); $results = $this->model_setting_extension->getExtensions('total'); foreach ($results as $key => $value) { $sort_order[$key] = $this->config->get($value['code'] . '_sort_order'); } array_multisort($sort_order, SORT_ASC, $results); foreach ($results as $result) { if ($this->config->get($result['code'] . '_status')) { $this->load->model('total/' . $result['code']); $this->{'model_total_' . $result['code']}->getTotal($total_data, $total, $taxes); } $sort_order = array(); foreach ($total_data as $key => $value) { $sort_order[$key] = $value['sort_order']; } array_multisort($sort_order, SORT_ASC, $total_data); } } $this->data['totals'] = $total_data; $this->data['heading_title'] = $this->language->get('heading_title'); $this->data['text_items'] = sprintf($this->language->get('text_items'), $this->cart->countProducts() + (isset($this->session->data['vouchers']) ? count($this->session->data['vouchers']) : 0), $this->currency->format($total)); $this->data['text_empty'] = $this->language->get('text_empty'); $this->data['text_cart'] = $this->language->get('text_cart'); $this->data['text_checkout'] = $this->language->get('text_checkout'); $this->data['button_minus'] = $this->language->get('button_minus'); $this->data['button_plus'] = $this->language->get('button_plus'); $this->data['button_remove'] = $this->language->get('button_remove'); $this->data['button_shopping'] = $this->language->get('button_shopping'); //$this->data['continue'] = $this->url->link('common/home'); $this->load->model('tool/image'); $this->data['products'] = array(); foreach ($this->cart->getProducts() as $product) { if ($product['image']) { $image = $this->model_tool_image->resize($product['image'], $this->config->get('config_image_cart_width'), $this->config->get('config_image_cart_height')); } else { $image = ''; } $option_data = array(); foreach ($product['option'] as $option) { if ($option['type'] != 'file') { $value = $option['option_value']; } else { $filename = $this->encryption->decrypt($option['option_value']); $value = utf8_substr($filename, 0, utf8_strrpos($filename, '.')); } $option_data[] = array( 'name' => $option['name'], 'value' => (utf8_strlen($value) > 20 ? utf8_substr($value, 0, 20) . '..' : $value), 'type' => $option['type'] ); } // Display prices if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) { $price = $this->currency->format($this->tax->calculate($product['price'], $product['tax_class_id'], $this->config->get('config_tax'))); } else { $price = false; } // Display prices if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) { $total = $this->currency->format($this->tax->calculate($product['price'], $product['tax_class_id'], $this->config->get('config_tax')) * $product['quantity']); } else { $total = false; } $this->data['products'][] = array( 'key' => $product['key'], 'thumb' => $image, 'name' => $product['name'], 'model' => $product['model'], 'option' => $option_data, 'quantity' => $product['quantity'], 'o' => $this->data['upc'], 'price' => $price, 'total' => $total, 'href' => $this->url->link('product/product', 'product_id=' . $product['product_id']) ); } // Gift Voucher $this->data['vouchers'] = array(); if (!empty($this->session->data['vouchers'])) { foreach ($this->session->data['vouchers'] as $key => $voucher) { $this->data['vouchers'][] = array( 'key' => $key, 'description' => $voucher['description'], 'amount' => $this->currency->format($voucher['amount']) ); } } $this->data['cart'] = $this->url->link('checkout/cart'); $this->data['checkout'] = $this->url->link('checkout/checkout', '', 'SSL'); if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/checkout/cartPopup.tpl')) { $this->template = $this->config->get('config_template') . '/template/checkout/cartPopup.tpl'; } else { $this->template = 'default/template/checkout/cartPopup.tpl'; } $this->response->setOutput($this->render()); } } ?>
  9. файл контроллера: <?php class ControllerModuleCartPopup extends Controller { protected function index() { // Add script $this->document->addScript('catalog/view/javascript/cartpopup.js'); // Add style //$this->document->addStyle('catalog/view/theme/default/stylesheet/stylesheetcartPopup.css'); if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/stylesheet/stylesheetcartPopup.css')) { $this->document->addStyle('catalog/view/theme/' . $this->config->get('config_template') . '/stylesheet/stylesheetcartPopup.css'); } else { $this->document->addStyle('catalog/view/theme/default/stylesheet/stylesheetcartPopup.css'); } // Settings $this->load->model('setting/setting'); $settings = $this->model_setting_setting->getSetting('cart_popup', $this->config->get('config_store_id')); foreach ($settings as $key => $value) { $this->config->set($key, $value); } if ($this->config->get('cart_popup_module_width') && $this->config->get('cart_popup_module_height')) { $this->data['cart_popup_module_width'] = $this->config->get('cart_popup_module_width'); $this->data['cart_popup_module_height'] = $this->config->get('cart_popup_module_height'); } else { $this->data['cart_popup_module_width'] = 600; $this->data['cart_popup_module_height'] = 400; } if ($this->config->get('cart_popup_module_height_hand')) { $this->data['cart_popup_module_height_hand'] = $this->config->get('cart_popup_module_height_hand'); } else { $this->data['cart_popup_module_height_hand'] = 0; } if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/module/cart_popup.tpl')) { $this->template = $this->config->get('config_template') . '/template/module/cart_popup.tpl'; } else { $this->template = 'default/template/module/cart_popup.tpl'; } $this->render(); } } ?> Он указывает на /template/module/cart_popup.tpl. Вот этот файл(cart_popup.tpl): <!--<div class="modal_bg"></div> <div class="modal_cart"> </div>--> <script> $(document).ready(function () { $("<style>").text(".modal_cart { width:<?php echo $cart_popup_module_width; ?>px; height:<?php echo $cart_popup_module_height; ?>px; } #byhand { height:<?php echo $cart_popup_module_height_hand; ?>px; }").appendTo("head"); }); </script> Но есть еще один файл в папке checkout. Называется тоже cart_popup.tpl. В нем как раз все то что надо, но переменную не видит, ту которая с артиклем. Вот этот файл: <div id="cartPopup"> <div id="cart1" class="cart_popup1"> <div id="heading1" class="heading1"> <!-- <h1 id="h1popup"><?php echo $heading_title; ?></h1> --> <!-- <span id="cart-total1"><?php echo $text_items; ?></span> --> </div> <div id="content1" class="content1"> <div id="contentUp">Товар добавлен в корзину <img class="del" onclick="modal_esc_click()" src="/catalog/view/theme/default/image/main/esc.png" alt=""></div> <?php if ($products || $vouchers) { ?> <div class="mini-cart-info1"> <table> <thead> <tr> <td></td> <td></td> <td class="name">Товар</td> <td>Цена за пару</td> <td>Стоимость короба</td> <td>Количетсво</td> <td class="total">Сумма</td> </tr> </thead> <?php foreach ($products as $product) { ?> <tr> <td class="remove"><img src="catalog/view/theme/default/image/main/del.png" title="<?php echo $button_remove; ?>" onclick="$('.modal_cart').load('index.php?route=checkout/cartPopup&remove=<?php echo $product['key']; ?>' + ' #cartPopup > *', function (response, status, xhr) { var newHeight = $('.modal_cart').outerHeight(false) - $('.cart_popup1 *').outerHeight(true) - $('#heading1 *').outerHeight(true) - $('#contentUp *').outerHeight(true) - $('.mini-cart-total1 *').outerHeight(true) - $('#checkout1 *').outerHeight(true) - $('#byhand').outerHeight(true); $('.mini-cart-info1').height(newHeight); if ($('#checkout_quick').length > 0) { $('#checkout_quick_cart').attr('href', $('#checkout_quick').attr('href')); $('#checkout_quick_cart').text($('#checkout_quick').text()); } $('#cart').load('index.php?route=module/cart&remove=<?php echo $product['key']; ?>' + ' #cart > *'); if ($('.empty').length > 0) { continue_click(); } });" /></td> <td class="image"><?php if ($product['thumb']) { ?> <a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" title="<?php echo $product['name']; ?>" /></a> <?php } else { ?> <div class="image"><a href="<?php echo $product['href']; ?>"><img src="/image/cache/no_image-100x100.jpg" style="width:92px;"></a></div> <?php } ?></td> <td class="name"><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a> <div> <?php foreach ($product['option'] as $option) { ?> - <small><?php echo $option['name']; ?> <?php echo $option['value']; ?></small><br /> <?php } ?> </div></td> <td class="price"><?php echo $product['price']; ?></td> <td class="price"><?php echo $one?></td> <?php print_r($data); ?> <td class="quantity"> <img style="cursor: pointer;" src="catalog/view/theme/default/image/main/plus.png" alt="<?php echo $button_plus; ?>" title="<?php echo $button_plus; ?>" onclick="$('.modal_cart').load('index.php?route=checkout/cartPopup&updateKey=<?php echo $product['key']; ?>&updateQuantiyPlus=<?php echo $product['quantity']; ?>' + ' #cartPopup > *', function (response, status, xhr) { var newHeight = $('.modal_cart').outerHeight(false) - $('.cart_popup1 *').outerHeight(true) - $('#heading1 *').outerHeight(true) - $('#contentUp *').outerHeight(true) - $('.mini-cart-total1 *').outerHeight(true) - $('#checkout1 *').outerHeight(true) - $('#byhand').outerHeight(true); $('.mini-cart-info1').height(newHeight); if ($('#checkout_quick').length > 0) { $('#checkout_quick_cart').attr('href', $('#checkout_quick').attr('href')); $('#checkout_quick_cart').text($('#checkout_quick').text()); } $('#cart').load('index.php?route=module/cart' + ' #cart > *'); });" /> <div class="qw-box"><span id="popup-quantity" style="vertical-align: top;"><?php echo $product['quantity']; ?></span> шт.</div> <img style="cursor: pointer;" src="catalog/view/theme/default/image/main/minus.png" alt="<?php echo $button_minus; ?>" title="<?php echo $button_minus; ?>" onclick="$('.modal_cart').load('index.php?route=checkout/cartPopup&updateKey=<?php echo $product['key']; ?>&updateQuantiyMinus=<?php echo $product['quantity']; ?>' + ' #cartPopup > *', function (response, status, xhr) { var newHeight = $('.modal_cart').outerHeight(false) - $('.cart_popup1 *').outerHeight(true) - $('#heading1 *').outerHeight(true) - $('#contentUp *').outerHeight(true) - $('.mini-cart-total1 *').outerHeight(true) - $('#checkout1 *').outerHeight(true) - $('#byhand').outerHeight(true); $('.mini-cart-info1').height(newHeight); if ($('#checkout_quick').length > 0) { $('#checkout_quick_cart').attr('href', $('#checkout_quick').attr('href')); $('#checkout_quick_cart').text($('#checkout_quick').text()); } $('#cart').load('index.php?route=module/cart' + ' #cart > *'); });" /> </td> <td class="total"><?php echo $product['total']; ?></td> </tr> <?php } ?> <?php foreach ($vouchers as $voucher) { ?> <tr> <td class="remove"> <img src="catalog/view/theme/default/image/remove.png" alt="<?php echo $button_remove; ?>" title="<?php echo $button_remove; ?>" onclick="$('.modal_cart').load('index.php?route=checkout/cartPopup&remove=<?php echo $voucher['key']; ?>' + ' #cartPopup > *', function (response, status, xhr) { var newHeight = $('.modal_cart').outerHeight(false) - $('.cart_popup1 *').outerHeight(true) - $('#heading1 *').outerHeight(true) - $('#contentUp *').outerHeight(true) - $('.mini-cart-total1 *').outerHeight(true) - $('#checkout1 *').outerHeight(true) - $('#byhand').outerHeight(true); $('.mini-cart-info1').height(newHeight); $('#cart').load('index.php?route=module/cart&remove=<?php echo $voucher['key']; ?>' + ' #cart > *'); });" /></td> <td class="image"></td> <td class="total"></td> <td class="name"><?php echo $voucher['description']; ?></td> <td class="quantity">x 1</td> <td class="total"><?php echo $voucher['amount']; ?></td> </tr> <?php } ?> </table> </div> <div class="total-box"> <div class="mini-cart-total1" > <table> <?php foreach ($totals as $total) { ?> <tr id="total_<?php echo $total['code']; ?>"> <td class="right"><b><?php echo $total['title']; ?>:</b></td> <td class="right"><?php echo $total['text']; ?></td> </tr> <?php } ?> </table> </div> <div id="checkout1" class="checkout"> <a id="checkout_cart" href="<?php echo $checkout; ?>" class=""><button><?php echo $text_checkout; ?></button></a> <a class="" onclick="continue_click()"><?php echo $button_shopping; ?></a> </div> <div id="byhand"> </div> </div> <?php } else { ?> <div class="empty"> <?php echo $text_empty; ?></div> <br> <!-- <div class="center"> <a class="button" onclick="continue_click()"><?php echo $button_shopping; ?></a> </div> --> <?php } ?> </div> </div> </div> В чем причина может быть?
  10. Странно получается. Я захожу в catalog/controller/module/cart_popup.php вставляю $this->data['upc']. в шаблоне вывожу просто как переменную. не понимает. Может вставляю не туда куда надо в контроллер?
  11. Спасибо! Покопался - разобрался немного. Но теперь застрял. Хочу вывести артикул в корзину. Передаю переменную туда вот так <?php echo $product_info['sku']; ?> пишет что не знает такой переменной. Подскажите, что делать? как правильно передать переменную в корзину? Добавляю переменную в контроллер вот так: $this->data['upc'] = $product_info['upc'];
  12. Всем привет! Установил модуль Free Popup Cart. По умолчанию отображает только столбцы Товар, Цена за штуку, Количетсво, Сумма. Нужно добавить новые столбцы. На сайте продается товар только оптово, т.е. за 1 ящик указывается цена. Мне надо чтобы выводилось еще одно поле с названием цена за штуку. Подскажите как это сделать? Заранее спасибо!
  13. Все, разобрался. Эти вкладки показываются автоматом, если человек не вошел в систему.
×
×
  • 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.