-
Публікації
74 -
З нами
-
Відвідування
Тип публікації
Профілі
Форум
Маркетплейс
Статті
FAQ
Наші новини
Магазин
Блоги
module__dplus_manager
Усі публікації користувача 113212
-
пс любят соц сети, чтобы лучше индексировались страницы, хочу попробовать добавить ссылки в твиттер и проч. вот пример, но на ворд пресс https://stylelib.org/social-auto-poster/
-
Добрый день. Может кто подскажет с помощью какого инструмента или модуля можно прогнать ссылки через твиттер, и другие соц сети?
-
все уже сам пофиксил, номер группы клиентов неправильно поставил
-
да ,0000-00-00,0000-00-00
-
Добрый день. Может кто подскажет. opencart 3.0.2.0 Импортирую акции товара, в админке скидка по акции отображается, а в карточке товара нет. В админке: В карточке товара отображается без скидок: Но, при этом, если в админке товар сохранить - скидка начинает отображаться. Кэш модификаторов и темы почистил. Подскажите как сделать чтобы акции были во всех товарах активированы?
-
Готов, оказалось дело в фильтре, написал разработчику фильтра, все поправил
-
Добрый день. Ситуация следующая: Импортировал акции в товар, в админке акция корректно отображается Но при этом в карточке товара скидка не отображается. Если в админке товар просто пересохранить, скидка начинает корректно отображатся в карточке товара. Скрин, после того как сохранил товар в админке. модуль покупал на opencartlabs.ru Подскажите, что сделать что акции сразу были активны во всех товарах?
-
и файлы шаблона поменял, тож мимо
-
поменял все файлы контроллера на стоковые, не помогло
-
кэш почистил
-
Добрый день, opc 3.0.2.0 загрузил акции в определенный товар,(пример 3,1,438.34,0000-00-00,0000-00-00) все успешно загрузилось, в товаре скидка не отображает. При этом, если зайти в админку, и сохранить ничего не меня, скидка начинает отображаться. Подскажите что не так? и куда смотреть?
-
тэк) <?php echo $header; if(isset($mfilter_json)) { if(!empty($mfilter_json)) { echo '<div id="mfilter-json" style="display:none">' . base64_encode( $mfilter_json ) . '</div>'; } } $theme_options = $registry->get('theme_options'); $config = $registry->get('config'); include('catalog/view/theme/'.$config->get('theme_' . $config->get('config_theme') . '_directory').'/template/new_elements/wrapper_top.tpl'); ?> <div id="mfilter-content-container"> <?php if ($categories && $theme_options->get('refine_search_style') != '2') { ?> <h2 class="refine_search"><?php echo $text_refine; ?></h2> <div class="category-list<?php if ($theme_options->get('refine_search_style') == '1') { echo ' category-list-text-only'; } ?>"> <div class="row"> <?php $class = 3; $row = 4; if($theme_options->get( 'refine_search_number' ) == 2) { $class = 62; } if($theme_options->get( 'refine_search_number' ) == 5) { $class = 25; } if($theme_options->get( 'refine_search_number' ) == 3) { $class = 4; } if($theme_options->get( 'refine_search_number' ) == 6) { $class = 2; } if($theme_options->get( 'refine_search_number' ) > 1) { $row = $theme_options->get( 'refine_search_number' ); } ?> <?php $row_fluid = 0; foreach ($theme_options->refineSearch() as $category) { $row_fluid++; ?> <?php if ($theme_options->get('refine_search_style') != '1') { $width = 250; $height = 250; if($theme_options->get( 'refine_image_width' ) > 20) $width = $theme_options->get( 'refine_image_width' ); if($theme_options->get( 'refine_image_height' ) > 20) $height = $theme_options->get( 'refine_image_height' ); $model_tool_image = $registry->get('model_tool_image'); if($category['thumb'] != '') { $image = $model_tool_image->resize($category['thumb'], $width, $height); } else { $image = $model_tool_image->resize('no_image.jpg', $width, $height); } } ?> <?php $r=$row_fluid-floor($row_fluid/$row)*$row; if($row_fluid>$row && $r == 1) { echo '</div><div class="row">'; } ?> <div class="col-sm-<?php echo $class; ?> col-xs-6"> <?php if ($theme_options->get('refine_search_style') != '1') { ?> <a href="<?php echo $category['href']; ?>"><img src="<?php echo $image; ?>" alt="<?php echo $category['name']; ?>" /></a> <?php } ?> <a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a> </div> <?php } ?> </div> </div> <?php } ?> <?php if ($products) { ?> <!-- Filter --> <div class="product-filter clearfix"> <div class="options"> <div class="button-group display" data-toggle="buttons-radio"> <button id="grid" <?php if($theme_options->get('default_list_grid') == '1') { echo 'class="active"'; } ?> rel="tooltip" title="Grid" onclick="display('grid');"><i class="icon-icons2"></i></button> <button id="list" <?php if($theme_options->get('default_list_grid') != '1') { echo 'class="active"'; } ?> rel="tooltip" title="List" onclick="display('list');"><i class="icon-menu2"></i></button> </div> </div> <div class="list-options"> <div class="sort"> <?php echo $text_sort; ?> <div class="overflow-select"> <select onchange="location = this.value;"> <?php foreach ($sorts as $sorts) { ?> <?php if ($sorts['value'] == $sort . '-' . $order) { ?> <option value="<?php echo $sorts['href']; ?>" selected="selected"><?php echo $sorts['text']; ?></option> <?php } else { ?> <option value="<?php echo $sorts['href']; ?>"><?php echo $sorts['text']; ?></option> <?php } ?> <?php } ?> </select> </div> </div> <div class="limit"> <?php echo $text_limit; ?> <div class="overflow-select"> <select onchange="location = this.value;"> <?php foreach ($limits as $limits) { ?> <?php if ($limits['value'] == $limit) { ?> <option value="<?php echo $limits['href']; ?>" selected="selected"><?php echo $limits['text']; ?></option> <?php } else { ?> <option value="<?php echo $limits['href']; ?>"><?php echo $limits['text']; ?></option> <?php } ?> <?php } ?> </select> </div> </div> </div> </div> <!-- Products list --> <div class="product-list"<?php if(!($theme_options->get('default_list_grid') == '1')) { echo ' class="active"'; } ?>> <?php foreach ($products as $product) { ?> <!-- Product --> <div> <div class="row"> <div class="col-sm-5"> <div class="image <?php if($theme_options->get( 'product_image_effect' ) == '1') { echo 'image-swap-effect'; } ?>"> <?php if($product['special'] && $theme_options->get( 'display_text_sale' ) != '0') { ?> <?php $text_sale = 'Sale'; if($theme_options->get( 'sale_text', $config->get( 'config_language_id' ) ) != '') { $text_sale = $theme_options->get( 'sale_text', $config->get( 'config_language_id' ) ); } ?> <?php if($theme_options->get( 'type_sale' ) == '1') { ?> <?php $product_detail = $theme_options->getDataProduct( $product['product_id'] ); $roznica_ceny = $product_detail['price']-$product_detail['special']; $procent = ($roznica_ceny*100)/$product_detail['price']; ?> <div class="sale">-<?php echo round($procent); ?>%</div> <?php } else { ?> <div class="sale"><?php echo $text_sale; ?></div> <?php } ?> <?php } ?> <div class="buttons"> <?php if($theme_options->get( 'quick_view' ) == 1) { ?> <div class="quickview"> <a href="index.php?route=product/quickview&product_id=<?php echo $product['product_id']; ?>" data-original-title="<?php if($theme_options->get( 'quickview_text', $config->get( 'config_language_id' ) ) != '') { echo html_entity_decode($theme_options->get( 'quickview_text', $config->get( 'config_language_id' ) )); } else { echo 'Quick View'; } ?>" data-toggle="tooltip"><i class="p-icon icon-plus"></i></a> </div> <?php } ?> </div> <?php if($product['thumb']) { ?> <a href="<?php echo $product['href']; ?>"> <?php if($theme_options->get( 'product_image_effect' ) == '1') { $nthumb = str_replace(' ', "%20", ($product['thumb'])); $nthumb = str_replace(HTTP_SERVER, "", $nthumb); if(file_exists($nthumb)) { $image_size = getimagesize($nthumb); } else { $image_size[0] = 740; $image_size[1] = 740; } $image_swap = $theme_options->productImageSwap($product['product_id'], $image_size[0], $image_size[1]); if($image_swap != '') echo '<img src="' . $image_swap . '" alt="' . $product['name'] . '" class="swap-image" />'; } ?> <?php if($theme_options->get( 'lazy_loading_images' ) != '0') { ?> <img src="image/catalog/blank.gif" data-echo="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" class="<?php if($theme_options->get( 'product_image_effect' ) == '2') { echo 'zoom-image-effect'; } ?>" /> <?php } else { ?> <img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" class="<?php if($theme_options->get( 'product_image_effect' ) == '2') { echo 'zoom-image-effect'; } ?>" /> <?php } ?> </a> <?php } else { ?> <a href="<?php echo $product['href']; ?>"><img src="image/no_image.jpg" alt="<?php echo $product['name']; ?>" /></a> <?php } ?> </div> </div> <div class="name-desc col-sm-7"> <div class="name"><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a></div> <?php if ($product['rating']) { ?> <div class="rating-reviews clearfix"> <div class="rating"><i class="fa fa-star<?php if($product['rating'] >= 1) { echo ' active'; } ?>"></i><i class="fa fa-star<?php if($product['rating'] >= 2) { echo ' active'; } ?>"></i><i class="fa fa-star<?php if($product['rating'] >= 3) { echo ' active'; } ?>"></i><i class="fa fa-star<?php if($product['rating'] >= 4) { echo ' active'; } ?>"></i><i class="fa fa-star<?php if($product['rating'] >= 5) { echo ' active'; } ?>"></i></div> </div> <?php } ?> <div class="price"> <?php if (!$product['special']) { ?> <?php echo $product['price']; ?> <?php } else { ?> <span class="price-new"><?php echo $product['special']; ?></span> <span class="price-old"><?php echo $product['price']; ?></span> <?php } ?> </div> <div class="description"><?php echo $product['description']; ?></div> <div class="bottom clearfix"> <div class="add-to-cart"> <?php $enquiry = false; if($config->get( 'product_blocks_module' ) != '') { $enquiry = $theme_options->productIsEnquiry($product['product_id']); } if(is_array($enquiry)) { ?> <a href="javascript:openPopup('<?php echo $enquiry['popup_module']; ?>', '<?php echo $product['product_id']; ?>')" class="button button-enquiry"> <?php if($enquiry['icon'] != '' && $enquiry['icon_position'] == 'left') { echo '<img src="image/' . $enquiry['icon']. '" align="left" class="icon-enquiry" alt="Icon">'; } ?> <span class="text-enquiry"><?php echo $enquiry['block_name']; ?></span> <?php if($enquiry['icon'] != '' && $enquiry['icon_position'] == 'right') { echo '<img src="image/' . $enquiry['icon']. '" align="right" class="icon-enquiry" alt="Icon">'; } ?> </a> <?php } else { ?> <a onclick="cart.add('<?php echo $product['product_id']; ?>');" class="button"><?php echo $button_cart; ?></a> <?php } ?> </div> <div class="buttons2"> <?php if($theme_options->get( 'display_add_to_wishlist' ) != '0') { ?> <a onclick="wishlist.add('<?php echo $product['product_id']; ?>');" class="add-to-wishlist" data-toggle="tooltip" data-original-title="<?php if($theme_options->get( 'add_to_wishlist_text', $config->get( 'config_language_id' ) ) != '') { echo $theme_options->get( 'add_to_wishlist_text', $config->get( 'config_language_id' ) ); } else { echo 'Add to wishlist'; } ?>"><span></span></a> <?php } ?> <?php if($theme_options->get( 'display_add_to_compare' ) != '0') { ?> <a onclick="compare.add('<?php echo $product['product_id']; ?>');" class="add-to-compare" data-toggle="tooltip" data-original-title="<?php if($theme_options->get( 'add_to_compare_text', $config->get( 'config_language_id' ) ) != '') { echo $theme_options->get( 'add_to_compare_text', $config->get( 'config_language_id' ) ); } else { echo 'Add to compare'; } ?>"><span></span></a> <?php } ?> </div> </div> </div> </div> </div> <?php } ?> </div> <!-- Products grid --> <?php $class = 3; $row = 4; if($theme_options->get( 'product_per_pow2' ) == 6) { $class = 2; } if($theme_options->get( 'product_per_pow2' ) == 5) { $class = 25; } if($theme_options->get( 'product_per_pow2' ) == 3) { $class = 4; } if($theme_options->get( 'product_per_pow2' ) == 2) { $class = 6; } if($theme_options->get( 'product_per_pow2' ) > 1) { $row = $theme_options->get( 'product_per_pow2' ); } ?> <div class="product-grid tt-product-listing"<?php if($theme_options->get('default_list_grid') == '1') { echo ' class="active"'; } ?>> <!-- <div class="row"> --> <?php $row_fluid = 0; foreach ($products as $product) { $row_fluid++; ?> <?php $r=$row_fluid-floor($row_fluid/$row)*$row; if($row_fluid>$row && $r == 1) { } ?> <div class="col-sm-<?php echo $class; ?> col-xs-6 tt-col-item"> <?php include('catalog/view/theme/'.$config->get('theme_' . $config->get('config_theme') . '_directory').'/template/new_elements/product.tpl'); ?> </div> <?php } ?> <!-- </div> --> </div> <div class="row pagination-results"> <div class="col-sm-6 text-left"><?php echo $pagination; ?></div> <div class="col-sm-6 text-right"><?php echo $results; ?></div> </div> <?php } ?> <?php if ($thumb || $description) { ?> <div class="category-info clearfix"> <?php if ($thumb) { ?> <div class="image"><img src="<?php echo $thumb; ?>" alt="<?php echo $heading_title; ?>" /></div> <?php } ?> <?php if ($description) { ?> <?php echo $description; ?> <?php } ?> </div> <?php } ?> <?php if (!$categories && !$products) { ?> <p style="padding-top: 6px"><?php echo $text_empty; ?></p> <div class="buttons"> <div class="pull-right"><a href="<?php echo $continue; ?>" class="btn btn-primary"><?php echo $button_continue; ?></a></div> </div> <?php } ?> <script type="text/javascript"><!-- function display(view) { if (view == 'list') { $('.product-grid').removeClass("active"); $('.product-list').addClass("active"); $('.display').html('<button id="grid" rel="tooltip" title="Grid" onclick="display(\'grid\');"><i class="icon-icons2"></i></button> <button class="active" id="list" rel="tooltip" title="List" onclick="display(\'list\');"><i class="icon-menu2"></i></button>'); localStorage.setItem('display', 'list'); } else { $('.product-grid').addClass("active"); $('.product-list').removeClass("active"); $('.display').html('<button class="active" id="grid" rel="tooltip" title="Grid" onclick="display(\'grid\');"><i class="icon-icons2"></i></button> <button id="list" rel="tooltip" title="List" onclick="display(\'list\');"><i class="icon-menu2"></i></button>'); localStorage.setItem('display', 'grid'); } } if (localStorage.getItem('display') == 'list') { display('list'); } else if (localStorage.getItem('display') == 'grid') { display('grid'); } else { display('<?php if($theme_options->get('default_list_grid') == '1') { echo 'grid'; } else { echo 'list'; } ?>'); } //--></script> </div> <?php include('catalog/view/theme/'.$config->get('theme_' . $config->get('config_theme') . '_directory').'/template/new_elements/wrapper_bottom.tpl'); ?> <?php echo $footer; ?>
-
что не так? вроде все ок <?php class ControllerProductCategory extends Controller { public function index() { $this->load->language('product/category'); $this->load->model('catalog/category'); $this->load->model('catalog/product'); $this->load->model('tool/image'); if (isset($this->request->get['filter'])) { $filter = $this->request->get['filter']; } else { $filter = ''; } if (isset($this->request->get['sort'])) { $sort = $this->request->get['sort']; } else { $sort = 'p.sort_order'; } if (isset($this->request->get['order'])) { $order = $this->request->get['order']; } else { $order = 'ASC'; } if (isset($this->request->get['page'])) { $page = $this->request->get['page']; } else { $page = 1; } if (isset($this->request->get['limit'])) { $limit = (int)$this->request->get['limit']; } else { $limit = $this->config->get('theme_' . $this->config->get('config_theme') . '_product_limit'); } $data['breadcrumbs'] = array(); $data['breadcrumbs'][] = array( 'text' => $this->language->get('text_home'), 'href' => $this->url->link('common/home') ); if (isset($this->request->get['path'])) { $url = ''; if (isset($this->request->get['sort'])) { $url .= '&sort=' . $this->request->get['sort']; } if (isset($this->request->get['order'])) { $url .= '&order=' . $this->request->get['order']; } if (isset($this->request->get['limit'])) { $url .= '&limit=' . $this->request->get['limit']; } $path = ''; $parts = explode('_', (string)$this->request->get['path']); $category_id = (int)array_pop($parts); foreach ($parts as $path_id) { if (!$path) { $path = (int)$path_id; } else { $path .= '_' . (int)$path_id; } $category_info = $this->model_catalog_category->getCategory($path_id); if ($category_info) { $data['breadcrumbs'][] = array( 'text' => $category_info['name'], 'href' => $this->url->link('product/category', 'path=' . $path . $url) ); } } } else { $category_id = 0; } $category_info = $this->model_catalog_category->getCategory($category_id); if ($category_info) { $this->document->setTitle($category_info['meta_title']); $this->document->setDescription($category_info['meta_description']); $this->document->setKeywords($category_info['meta_keyword']); $data['heading_title'] = $category_info['name']; $data['text_compare'] = sprintf($this->language->get('text_compare'), (isset($this->session->data['compare']) ? count($this->session->data['compare']) : 0)); // Set the last category breadcrumb $data['breadcrumbs'][] = array( 'text' => $category_info['name'], 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path']) ); if ($category_info['image']) { $data['thumb'] = $this->model_tool_image->resize($category_info['image'], $this->config->get('theme_' . $this->config->get('config_theme') . '_image_category_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_category_height')); } else { $data['thumb'] = ''; } $data['description'] = html_entity_decode($category_info['description'], ENT_QUOTES, 'UTF-8'); $data['compare'] = $this->url->link('product/compare'); $url = ''; if (isset($this->request->get['filter'])) { $url .= '&filter=' . $this->request->get['filter']; } if (isset($this->request->get['sort'])) { $url .= '&sort=' . $this->request->get['sort']; } if (isset($this->request->get['order'])) { $url .= '&order=' . $this->request->get['order']; } if (isset($this->request->get['limit'])) { $url .= '&limit=' . $this->request->get['limit']; } $data['categories'] = array(); $results = $this->model_catalog_category->getCategories($category_id); foreach ($results as $result) { $filter_data = array( 'filter_category_id' => $result['category_id'], 'filter_sub_category' => true ); $data['categories'][] = array( 'name' => $result['name'] . ($this->config->get('config_product_count') ? ' (' . $this->model_catalog_product->getTotalProducts($filter_data) . ')' : ''), 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '_' . $result['category_id'] . $url) ); } $data['products'] = array(); $filter_data = array( 'filter_category_id' => $category_id, 'filter_filter' => $filter, 'sort' => $sort, 'order' => $order, 'start' => ($page - 1) * $limit, 'limit' => $limit ); $product_total = $this->model_catalog_product->getTotalProducts($filter_data); $results = $this->model_catalog_product->getProducts($filter_data); foreach ($results as $result) { if ($result['image']) { $image = $this->model_tool_image->resize($result['image'], $this->config->get('theme_' . $this->config->get('config_theme') . '_image_product_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_product_height')); } else { $image = $this->model_tool_image->resize('placeholder.png', $this->config->get('theme_' . $this->config->get('config_theme') . '_image_product_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_product_height')); } if ($this->customer->isLogged() || !$this->config->get('config_customer_price')) { $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')), $this->session->data['currency']); } else { $price = false; } if ((float)$result['special']) { $special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')), $this->session->data['currency']); } else { $special = false; } if ($this->config->get('config_tax')) { $tax = $this->currency->format((float)$result['special'] ? $result['special'] : $result['price'], $this->session->data['currency']); } else { $tax = false; } if ($this->config->get('config_review_status')) { $rating = (int)$result['rating']; } else { $rating = false; } $data['products'][] = array( 'product_id' => $result['product_id'], 'thumb' => $image, 'name' => $result['name'], 'description' => utf8_substr(trim(strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8'))), 0, $this->config->get('theme_' . $this->config->get('config_theme') . '_product_description_length')) . '..', 'price' => $price, 'special' => $special, 'tax' => $tax, 'minimum' => $result['minimum'] > 0 ? $result['minimum'] : 1, 'rating' => $result['rating'], 'href' => $this->url->link('product/product', 'path=' . $this->request->get['path'] . '&product_id=' . $result['product_id'] . $url) ); } $url = ''; if (isset($this->request->get['filter'])) { $url .= '&filter=' . $this->request->get['filter']; } if (isset($this->request->get['limit'])) { $url .= '&limit=' . $this->request->get['limit']; } $data['sorts'] = array(); $data['sorts'][] = array( 'text' => $this->language->get('text_default'), 'value' => 'p.sort_order-ASC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=p.sort_order&order=ASC' . $url) ); /* $data['sorts'][] = array( 'text' => $this->language->get('text_name_asc'), 'value' => 'pd.name-ASC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=pd.name&order=ASC' . $url) ); $data['sorts'][] = array( 'text' => $this->language->get('text_name_desc'), 'value' => 'pd.name-DESC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=pd.name&order=DESC' . $url) ); */ $data['sorts'][] = array( 'text' => $this->language->get('text_price_asc'), 'value' => 'p.price-ASC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=p.price&order=ASC' . $url) ); $data['sorts'][] = array( 'text' => $this->language->get('text_price_desc'), 'value' => 'p.price-DESC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=p.price&order=DESC' . $url) ); /* if ($this->config->get('config_review_status')) { $data['sorts'][] = array( 'text' => $this->language->get('text_rating_desc'), 'value' => 'rating-DESC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=rating&order=DESC' . $url) ); $data['sorts'][] = array( 'text' => $this->language->get('text_rating_asc'), 'value' => 'rating-ASC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=rating&order=ASC' . $url) ); } $data['sorts'][] = array( 'text' => $this->language->get('text_model_asc'), 'value' => 'p.model-ASC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=p.model&order=ASC' . $url) ); $data['sorts'][] = array( 'text' => $this->language->get('text_model_desc'), 'value' => 'p.model-DESC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=p.model&order=DESC' . $url) ); */ $url = ''; if (isset($this->request->get['filter'])) { $url .= '&filter=' . $this->request->get['filter']; } if (isset($this->request->get['sort'])) { $url .= '&sort=' . $this->request->get['sort']; } if (isset($this->request->get['order'])) { $url .= '&order=' . $this->request->get['order']; } $data['limits'] = array(); $limits = array_unique(array($this->config->get('theme_' . $this->config->get('config_theme') . '_product_limit'), 25, 50, 75, 100)); sort($limits); foreach($limits as $value) { $data['limits'][] = array( 'text' => $value, 'value' => $value, 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . $url . '&limit=' . $value) ); } $url = ''; if (isset($this->request->get['filter'])) { $url .= '&filter=' . $this->request->get['filter']; } if (isset($this->request->get['sort'])) { $url .= '&sort=' . $this->request->get['sort']; } if (isset($this->request->get['order'])) { $url .= '&order=' . $this->request->get['order']; } if (isset($this->request->get['limit'])) { $url .= '&limit=' . $this->request->get['limit']; } $pagination = new Pagination(); $pagination->total = $product_total; $pagination->page = $page; $pagination->limit = $limit; $pagination->url = $this->url->link('product/category', 'path=' . $this->request->get['path'] . $url . '&page={page}'); $data['pagination'] = $pagination->render(); $data['results'] = sprintf($this->language->get('text_pagination'), ($product_total) ? (($page - 1) * $limit) + 1 : 0, ((($page - 1) * $limit) > ($product_total - $limit)) ? $product_total : ((($page - 1) * $limit) + $limit), $product_total, ceil($product_total / $limit)); // http://googlewebmastercentral.blogspot.com/2011/09/pagination-with-relnext-and-relprev.html if ($page == 1) { $this->document->addLink($this->url->link('product/category', 'path=' . $category_info['category_id']), 'canonical'); } else { $this->document->addLink($this->url->link('product/category', 'path=' . $category_info['category_id'] . '&page='. $page), 'canonical'); } if ($page > 1) { $this->document->addLink($this->url->link('product/category', 'path=' . $category_info['category_id'] . (($page - 2) ? '&page='. ($page - 1) : '')), 'prev'); } if ($limit && ceil($product_total / $limit) > $page) { $this->document->addLink($this->url->link('product/category', 'path=' . $category_info['category_id'] . '&page='. ($page + 1)), 'next'); } $data['sort'] = $sort; $data['order'] = $order; $data['limit'] = $limit; $data['continue'] = $this->url->link('common/home'); $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('product/category', $data)); } else { $url = ''; if (isset($this->request->get['path'])) { $url .= '&path=' . $this->request->get['path']; } if (isset($this->request->get['filter'])) { $url .= '&filter=' . $this->request->get['filter']; } if (isset($this->request->get['sort'])) { $url .= '&sort=' . $this->request->get['sort']; } if (isset($this->request->get['order'])) { $url .= '&order=' . $this->request->get['order']; } if (isset($this->request->get['page'])) { $url .= '&page=' . $this->request->get['page']; } if (isset($this->request->get['limit'])) { $url .= '&limit=' . $this->request->get['limit']; } $data['breadcrumbs'][] = array( 'text' => $this->language->get('text_error'), 'href' => $this->url->link('product/category', $url) ); $this->document->setTitle($this->language->get('text_error')); $data['continue'] = $this->url->link('common/home'); $this->response->addHeader($this->request->server['SERVER_PROTOCOL'] . ' 404 Not Found'); $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('error/not_found', $data)); } } }
-
Добрый день. Выставляю скидку на товар, в карточке товара скидка корректно отображается. Но в каталоге, не отображается. Подскажите, куда смотреть?
-
мб, пригодится кому нибудь. https://codepen.io/jrg/pen/Cjrzx
-
Все разобрался, товар не отображается в каталоге и поиске, но в производителях товар есть, мб знает кто как в производителях скрыть?
-
не тот файл сбросил изначально product.php
-
кэш в модификаторе и теме почистил. не помогло
-
Поправил, спасибо
-
Прописал, не помогло, мб в op 3.0.2.0 что-то еще надо? <?php class ModelCatalogProducts extends Model { public function getProduct($product_id) { if ($this->customer->isLogged()) { $customer_group_id = $this->customer->getGroupId(); } else { $customer_group_id = $this->config->get('config_customer_group_id'); } $query = $this->db->query("SELECT DISTINCT *, pd.name AS name, p.image, m.name AS manufacturer, (SELECT price FROM " . DB_PREFIX . "product_discount pd2 WHERE pd2.product_id = p.product_id AND pd2.customer_group_id = '" . (int)$customer_group_id . "' AND pd2.quantity = '1' AND ((pd2.date_start = '0000-00-00' OR pd2.date_start < NOW()) AND (pd2.date_end = '0000-00-00' OR pd2.date_end > NOW())) ORDER BY pd2.priority ASC, pd2.price ASC LIMIT 1) AS discount, (SELECT price FROM " . DB_PREFIX . "product_special ps WHERE ps.product_id = p.product_id AND ps.customer_group_id = '" . (int)$customer_group_id . "' AND ((ps.date_start = '0000-00-00' OR ps.date_start < NOW()) AND (ps.date_end = '0000-00-00' OR ps.date_end > NOW())) ORDER BY ps.priority ASC, ps.price ASC LIMIT 1) AS special, (SELECT points FROM " . DB_PREFIX . "product_reward pr WHERE pr.product_id = p.product_id AND customer_group_id = '" . (int)$customer_group_id . "') AS reward, (SELECT ss.name FROM " . DB_PREFIX . "stock_status ss WHERE ss.stock_status_id = p.stock_status_id AND ss.language_id = '" . (int)$this->config->get('config_language_id') . "') AS stock_status, (SELECT wcd.unit FROM " . DB_PREFIX . "weight_class_description wcd WHERE p.weight_class_id = wcd.weight_class_id AND wcd.language_id = '" . (int)$this->config->get('config_language_id') . "') AS weight_class, (SELECT lcd.unit FROM " . DB_PREFIX . "length_class_description lcd WHERE p.length_class_id = lcd.length_class_id AND lcd.language_id = '" . (int)$this->config->get('config_language_id') . "') AS length_class, (SELECT AVG(rating) AS total FROM " . DB_PREFIX . "review r1 WHERE r1.product_id = p.product_id AND r1.status = '1' GROUP BY r1.product_id) AS rating, (SELECT COUNT(*) AS total FROM " . DB_PREFIX . "review r2 WHERE r2.product_id = p.product_id AND r2.status = '1' GROUP BY r2.product_id) AS reviews, p.sort_order FROM " . DB_PREFIX . "product p LEFT JOIN " . DB_PREFIX . "product_description pd ON (p.product_id = pd.product_id) LEFT JOIN " . DB_PREFIX . "product_to_store p2s ON (p.product_id = p2s.product_id) LEFT JOIN " . DB_PREFIX . "manufacturer m ON (p.manufacturer_id = m.manufacturer_id) WHERE p.product_id = '" . (int)$product_id . "' AND pd.language_id = '" . (int)$this->config->get('config_language_id') . "' AND p.status = '1' AND p.quantity > 0 AND p.date_available <= NOW() AND p2s.store_id = '" . (int)$this->config->get('config_store_id') . "'"); if ($query->num_rows) { return array( 'product_id' => $query->row['product_id'], 'name' => $query->row['name'], 'description' => $query->row['description'], 'meta_description' => $query->row['meta_description'], 'meta_keyword' => $query->row['meta_keyword'], 'tag' => $query->row['tag'], 'model' => $query->row['model'], 'sku' => $query->row['sku'], 'upc' => $query->row['upc'], 'ean' => $query->row['ean'], 'jan' => $query->row['jan'], 'isbn' => $query->row['isbn'], 'mpn' => $query->row['mpn'], 'location' => $query->row['location'], 'quantity' => $query->row['quantity'], 'stock_status' => $query->row['stock_status'], 'image' => $query->row['image'], 'manufacturer_id' => $query->row['manufacturer_id'], 'manufacturer' => $query->row['manufacturer'], 'price' => ($query->row['discount'] ? $query->row['discount'] : $query->row['price']), 'special' => $query->row['special'], 'reward' => $query->row['reward'], 'points' => $query->row['points'], 'tax_class_id' => $query->row['tax_class_id'], 'date_available' => $query->row['date_available'], 'weight' => $query->row['weight'], 'weight_class_id' => $query->row['weight_class_id'], 'length' => $query->row['length'], 'width' => $query->row['width'], 'height' => $query->row['height'], 'length_class_id' => $query->row['length_class_id'], 'subtract' => $query->row['subtract'], 'rating' => round($query->row['rating']), 'reviews' => $query->row['reviews'] ? $query->row['reviews'] : 0, 'minimum' => $query->row['minimum'], 'sort_order' => $query->row['sort_order'], 'status' => $query->row['status'], 'date_added' => $query->row['date_added'], 'date_modified' => $query->row['date_modified'], 'viewed' => $query->row['viewed'] ); } else { return false; } } public function getCategoryId($product_id) { $sql = "SELECT category_id FROM " . DB_PREFIX . "product_to_category WHERE product_id='" . $product_id . "'"; $query = $this->db->query($sql); return $query->row; } public function getRandomProducts($limit) { if ($this->customer->isLogged()) { $customer_group_id = $this->customer->getGroupId(); } else { $customer_group_id = $this->config->get('config_customer_group_id'); } $sql = "SELECT *, p.product_id, (SELECT AVG(rating) AS total FROM " . DB_PREFIX . "review r1 WHERE r1.product_id = p.product_id AND r1.status = '1' GROUP BY r1.product_id) AS rating FROM " . DB_PREFIX . "product p LEFT JOIN " . DB_PREFIX . "product_description pd ON (p.product_id = pd.product_id) LEFT JOIN " . DB_PREFIX . "product_to_store p2s ON (p.product_id = p2s.product_id) WHERE pd.language_id = '" . (int)$this->config->get('config_language_id') . "' AND p.status = '1' AND p.quantity > 0 AND p.date_available <= NOW() AND p2s.store_id = '" . (int)$this->config->get('config_store_id') . "'"; $sql .= " GROUP BY p.product_id"; $sort_data = array( 'pd.name', 'p.model', 'p.quantity', 'p.price', 'rating', 'p.sort_order', 'p.date_added' ); $sql .= " ORDER BY Rand()"; $sql .= " LIMIT 0," . (int)$limit; $product_data = array(); $query = $this->db->query($sql); foreach ($query->rows as $result) { $product_data[$result['product_id']] = $this->getProduct($result['product_id']); } return $product_data; } public function getAlsoBoughtProducts($limit) { $product_data = array(); if(isset($limit) && $limit>0) { if (isset($this->request->get['product_id'])) { $product_id = (int)$this->request->get['product_id']; } else { $product_id = 0; } if (isset($product_id) && $product_id > 0) { $cachestring = 'alsobought.product.L' . (int)$this->config->get('config_language_id') . '.S' . (int)$this->config->get('config_store_id') . '.G' . $this->config->get('config_customer_group_id') . '.P' .(int)$product_id . '.T' . (int)$limit; $product_data = $this->cache->get($cachestring); if (!$product_data) { $product_data = array(); $query = $this->db->query("SELECT op.product_id FROM " . DB_PREFIX . "order_product op INNER JOIN `" . DB_PREFIX . "product` p ON (op.product_id = p.product_id) INNER JOIN " . DB_PREFIX . "product_to_store p2s ON (p.product_id = p2s.product_id) WHERE EXISTS (SELECT 1 FROM " . DB_PREFIX . "order_product op1 WHERE op1.order_id = op.order_id AND op1.product_id = '" .(int)$product_id . "' ) AND op.product_id <> '" . (int)$product_id . "' AND p.status = '1' AND p.date_available <= NOW() AND p2s.store_id = '" . (int)$this->config->get('config_store_id') . "' GROUP BY op.product_id LIMIT " . (int)$limit); foreach ($query->rows as $result) { $product_data[$result['product_id']] = $this->getProduct($result['product_id']); } $this->cache->set($cachestring, $product_data); } } } return $product_data; } public function getMostViewedProducts($limit) { $product_data = array(); $query = $this->db->query("SELECT p.product_id FROM " . DB_PREFIX . "product p LEFT JOIN " . DB_PREFIX . "product_to_store p2s ON (p.product_id = p2s.product_id) WHERE p.status = '1' AND p.date_available <= NOW() AND p2s.store_id = '" . (int)$this->config->get('config_store_id') . "' ORDER BY p.viewed DESC LIMIT " . (int)$limit); foreach ($query->rows as $result) { $product_data[$result['product_id']] = $this->getProduct($result['product_id']); } return $product_data; } public function getProductsRelated($limit) { $product_data = array(); if (isset($this->request->get['product_id'])) { $product_id = (int)$this->request->get['product_id']; } else { $product_id = 0; } $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "product_related pr LEFT JOIN " . DB_PREFIX . "product p ON (pr.related_id = p.product_id) LEFT JOIN " . DB_PREFIX . "product_to_store p2s ON (p.product_id = p2s.product_id) WHERE pr.product_id = '" . (int)$product_id . "' AND p.status = '1' AND p.date_available <= NOW() AND p2s.store_id = '" . (int)$this->config->get('config_store_id') . "' LIMIT " . (int)$limit); foreach ($query->rows as $result) { $product_data[$result['related_id']] = $this->getProduct($result['related_id']); } return $product_data; } }
-
Добрый день В админке ошибка с ссылками, подскажите, куда смотреть. Если кликнуть на любую кнопку в меню, в урл прописывает например admin/#collapse4 и выбрасывает обратно на авторизацию.