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

Goodvina

Newbie
  
  • Posts

    7
  • Joined

  • Last visited

1 Follower

Goodvina's Achievements

Rookie

Rookie (2/14)

  • Conversation Starter
  • First Post
  • Week One Done
  • One Month Later
  • One Year In

Recent Badges

0

Reputation

  1. помогите, пожалуйста, разобраться, что делаю не так, очень нужна эта кнопка..
  2. вот файлы, над которыми голову ломаю... 1.category.tpl <?php echo $header; ?><?php echo $column_left; ?><?php echo $column_right; ?><div id="content"> <div class="top"> <div class="left"></div> <div class="right"></div> <div class="center"> <h1><?php echo $heading_title; ?></h1> </div> </div> <div class="middle"> <table style="padding-bottom:10px;"> <tr> <?php if ($thumb) { ?> <td><img src="<?php echo $thumb; ?>" alt="<?php echo $heading_title; ?>" /></td> <?php } ?> <?php if ($description) { ?> <td><?php echo $description; ?></td> <?php } ?> </tr> </table> <?php if (!$categories && !$products) { ?> <div class="content"><?php echo $text_error; ?></div> <?php } ?> <?php if ($categories) { ?> <table class="list"> <?php for ($i = 0; $i < sizeof($categories); $i = $i + 4) { ?> <tr> <?php for ($j = $i; $j < ($i + 4); $j++) { ?> <td width="25%"><?php if (isset($categories[$j])) { ?> <a href="<?php echo $categories[$j]['href']; ?>"><img src="<?php echo $categories[$j]['thumb']; ?>" title="<?php echo $categories[$j]['name']; ?>" alt="<?php echo $categories[$j]['name']; ?>" style="margin-bottom: 3px;" /></a> <a href="<?php echo $categories[$j]['href']; ?>"><?php echo $categories[$j]['name']; ?></a> <?php } ?></td> <?php } ?> </tr> <?php } ?> </table> <?php } ?> <?php if ($products) { ?> <div class="sort"> <div class="div1"> <select name="sort" onchange="location = this.value"> <?php foreach ($sorts as $sorts) { ?> <?php if (($sort . '-' . $order) == $sorts['value']) { ?> <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 class="div2"><?php echo $text_sort; ?></div> </div> <table class="list"> <?php for ($i = 0; $i < sizeof($products); $i = $i + 4) { ?> <tr> <?php for ($j = $i; $j < ($i + 4); $j++) { ?> <td width="25%"><?php if (isset($products[$j])) { ?> <a href="<?php echo $products[$j]['href']; ?>"><img src="<?php echo $products[$j]['thumb']; ?>" title="<?php echo $products[$j]['name']; ?>" alt="<?php echo $products[$j]['name']; ?>" /></a> <a href="<?php echo $products[$j]['href']; ?>"><?php echo $products[$j]['name']; ?></a> [color= #999; font-size: 11px;]<?php echo $products[$j]['model']; ?>[/color] <?php if ($display_price) { ?> <?php if (!$products[$j]['special']) { ?> [color= #900; font-weight: bold;]<?php echo $products[$j]['price']; ?>[/color] <?php } else { ?> [color= #900; font-weight: bold; text-decoration: line-through;]<?php echo $products[$j]['price']; ?>[/color] [color= #F00;]<?php echo $products[$j]['special']; ?>[/color] <?php } ?> <a class="button_add_small" href="<?php echo $products[$j]['add']; ?>" title="<?php echo $button_add_to_cart; ?>" > </a> <a class="button_add_small" href="#" onclick="buyProduct(<?php echo $products[$j]['id']; ?>);return false;" id="add_to_cart<?php echo $products[$j]['id']; ?>" class="buy"></a> <?php } ?> <?php if ($products[$j]['rating']) { ?> <img src="catalog/view/theme/default/image/stars_<?php echo $products[$j]['rating'] . '.png'; ?>" alt="<?php echo $products[$j]['stars']; ?>" /> <?php } ?> <?php } ?></td> <?php } ?> </tr> <?php } ?> </table> <div class="pagination"><?php echo $pagination; ?></div> <?php } ?> </div> <div class="bottom"> <div class="left"></div> <div class="right"></div> <div class="center"></div> </div></div><?php echo $footer; ?> 2.header.tpl <?php if (isset($_SERVER['HTTP_USER_AGENT']) && !strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 6')) echo '<?xml version="1.0" encoding="UTF-8"?>'. "n"; ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" dir="<?php echo $direction; ?>" lang="<?php echo $lang; ?>" xml:lang="<?php echo $lang; ?>"><script type="text/javascript">function buyProduct(id){ $.ajax({ type: 'post', url: 'index.php?route=module/cart/callback', dataType: 'html', data: 'product_id='+id+'&quantity=1', success: function (html) { $('#module_cart .middle').html(html); }, complete: function () { var image = $('#image'+id).offset(); var cart = $('#module_cart').offset(); $('#image'+id).before('<img src="' + $('#image'+id).attr('src') + '" id="temp" style="position: absolute; top: ' + image.top + 'px; left: ' + image.left + 'px;" />'); params = { top : cart.top + 'px', left : cart.left + 'px', opacity : 0.0, width : $('#module_cart').width(), heigth : $('#module_cart').height() }; $('#temp').animate(params, 'slow', false, function () { $('#temp').remove(); }); } }); }</script><head><title><?php echo $title; ?></title><?php if ($keywords) { ?><meta name="keywords" content="<?php echo $keywords; ?>" /><?php } ?><?php if ($description) { ?><meta name="description" content="<?php echo $description; ?>" /><?php } ?><base href="<?php echo $base; ?>" /><?php if ($icon) { ?><link href="<?php echo $icon; ?>" rel="icon" /><?php } ?><?php foreach ($links as $link) { ?><link href="<?php echo str_replace('&', '&', $link['href']); ?>" rel="<?php echo $link['rel']; ?>" /><?php } ?><link rel="stylesheet" type="text/css" href="catalog/view/theme/<?php echo $template; ?>/stylesheet/stylesheet.css" /><!--[if lt IE 7]><link rel="stylesheet" type="text/css" href="catalog/view/theme/default/stylesheet/ie6.css" /><script type="text/javascript" src="catalog/view/javascript/DD_belatedPNG_0.0.8a-min.js"></script><script>DD_belatedPNG.fix('img, #header .div3 a, #content .left, #content .right, .box .top');</script><![endif]--><?php foreach ($styles as $style) { ?><link rel="<?php echo $style['rel']; ?>" type="text/css" href="<?php echo $style['href']; ?>" media="<?php echo $style['media']; ?>" /><?php } ?><script type="text/javascript" src="catalog/view/javascript/jquery/jquery-1.3.2.min.js"></script><script type="text/javascript" src="catalog/view/javascript/jquery/thickbox/thickbox-compressed.js"></script><link rel="stylesheet" type="text/css" href="catalog/view/javascript/jquery/thickbox/thickbox.css" /><script type="text/javascript" src="catalog/view/javascript/jquery/tab.js"></script><?php foreach ($scripts as $script) { ?><script type="text/javascript" src="<?php echo $script; ?>"></script><?php } ?><script type="text/javascript"><!--function bookmark(url, title) { if (window.sidebar) { // firefox window.sidebar.addPanel(title, url, ""); } else if(window.opera && window.print) { // opera var elem = document.createElement('a'); elem.setAttribute('href',url); elem.setAttribute('title',title); elem.setAttribute('rel','sidebar'); elem.click(); } else if(document.all) {// ie window.external.AddFavorite(url, title); }}//--></script></head><body><div id="container"><div id="header"> <div class="div1"> <div class="div2"> <?php if ($logo) { ?> <a href="<?php echo str_replace('&', '&', $home); ?>"><img src="<?php echo $logo; ?>" title="<?php echo $store; ?>" alt="<?php echo $store; ?>" /></a> <?php } ?> </div> <div class="div3"><a href="<?php echo str_replace('&', '&', $special); ?>" style="background-image: url('catalog/view/theme/default/image/special.png');"><?php echo $text_special; ?></a><a onclick="bookmark(document.location, '<?php echo addslashes($title); ?>');" style="background-image: url('catalog/view/theme/default/image/bookmark.png');"><?php echo $text_bookmark; ?></a><a href="<?php echo str_replace('&', '&', $contact); ?>" style="background-image: url('catalog/view/theme/default/image/contact.png');"><?php echo $text_contact; ?></a><a href="<?php echo str_replace('&', '&', $sitemap); ?>" style="background-image: url('catalog/view/theme/default/image/sitemap.png');"><?php echo $text_sitemap; ?></a></div> <div class="div4"><a href="<?php echo str_replace('&', '&', $home); ?>" id="tab_home"><?php echo $text_home; ?></a> <?php if (!$logged) { ?> <a href="<?php echo str_replace('&', '&', $login); ?>" id="tab_login"><?php echo $text_login; ?></a> <?php } else { ?> <a href="<?php echo str_replace('&', '&', $logout); ?>" id="tab_logout"><?php echo $text_logout; ?></a> <?php } ?> <a href="<?php echo str_replace('&', '&', $account); ?>" id="tab_account"><?php echo $text_account; ?></a><a href="<?php echo str_replace('&', '&', $cart); ?>" id="tab_cart"><?php echo $text_cart; ?></a><a href="<?php echo str_replace('&', '&', $checkout); ?>" id="tab_checkout"><?php echo $text_checkout; ?></a></div> <div class="div5"> <div class="left"></div> <div class="right"></div> <div class="center"> <div id="search"> <div class="div8"><?php echo $entry_search; ?> </div> <div class="div9"> <?php if ($keyword) { ?> <input type="text" value="<?php echo $keyword; ?>" id="filter_keyword" /> <?php } else { ?> <input type="text" value="<?php echo $text_keyword; ?>" id="filter_keyword" onclick="this.value = '';" onkeydown="this.style.color = '#000000'" style="color: #999;" /> <?php } ?> <select id="filter_category_id"> <option value="0"><?php echo $text_category; ?></option> <?php foreach ($categories as $category) { ?> <?php if ($category['category_id'] == $category_id) { ?> <option value="<?php echo $category['category_id']; ?>" selected="selected"><?php echo $category['name']; ?></option> <?php } else { ?> <option value="<?php echo $category['category_id']; ?>"><?php echo $category['name']; ?></option> <?php } ?> <?php } ?> </select> </div> <div class="div10"> <a onclick="moduleSearch();" class="button"><span><?php echo $button_go; ?></span></a> <a href="<?php echo str_replace('&', '&', $advanced); ?>"><?php echo $text_advanced; ?></a></div> </div> </div> </div> </div> <div class="div6"> <div class="left"></div> <div class="right"></div> <div class="center"> <?php if (isset($common_error)) { ?> <div class="warning"><?php echo $common_error; ?></div> <?php } ?> <div id="breadcrumb"> <?php foreach ($breadcrumbs as $breadcrumb) { ?> <?php echo $breadcrumb['separator']; ?><a href="<?php echo str_replace('&', '&', $breadcrumb['href']); ?>"><?php echo $breadcrumb['text']; ?></a> <?php } ?> </div> <div class="div7"> <?php if ($currencies) { ?> <form action="<?php echo str_replace('&', '&', $action); ?>" method="post" enctype="multipart/form-data" id="currency_form"> <div class="switcher"> <?php foreach ($currencies as $currency) { ?> <?php if ($currency['code'] == $currency_code) { ?> <div class="selected"><a><?php echo $currency['title']; ?></a></div> <?php } ?> <?php } ?> <div class="option"> <?php foreach ($currencies as $currency) { ?> <a onclick="$('input[name='currency_code']').attr('value', '<?php echo $currency['code']; ?>'); $('#currency_form').submit();"><?php echo $currency['title']; ?></a> <?php } ?> </div> </div> <div style="display: inline;"> <input type="hidden" name="currency_code" value="" /> <input type="hidden" name="redirect" value="<?php echo $redirect; ?>" /> </div> </form> <?php } ?> <?php if ($languages) { ?> <form action="<?php echo str_replace('&', '&', $action); ?>" method="post" enctype="multipart/form-data" id="language_form"> <div class="switcher"> <?php foreach ($languages as $language) { ?> <?php if ($language['code'] == $language_code) { ?> <div class="selected"><a><img src="image/flags/<?php echo $language['image']; ?>" alt="<?php echo $language['name']; ?>" /> <?php echo $language['name']; ?></a></div> <?php } ?> <?php } ?> <div class="option"> <?php foreach ($languages as $language) { ?> <a onclick="$('input[name='language_code']').attr('value', '<?php echo $language['code']; ?>'); $('#language_form').submit();"><img src="image/flags/<?php echo $language['image']; ?>" alt="<?php echo $language['name']; ?>" /> <?php echo $language['name']; ?></a> <?php } ?> </div> </div> <div> <input type="hidden" name="language_code" value="" /> <input type="hidden" name="redirect" value="<?php echo $redirect; ?>" /> </div> </form> <?php } ?> </div> </div> </div></div><script type="text/javascript"><!-- function getURLVar(urlVarName) { var urlHalves = String(document.location).toLowerCase().split('?'); var urlVarValue = ''; if (urlHalves[1]) { var urlVars = urlHalves[1].split('&'); for (var i = 0; i <= (urlVars.length); i++) { if (urlVars[i]) { var urlVarPair = urlVars[i].split('='); if (urlVarPair[0] && urlVarPair[0] == urlVarName.toLowerCase()) { urlVarValue = urlVarPair[1]; } } } } return urlVarValue;} $(document).ready(function() { route = getURLVar('route'); if (!route) { $('#tab_home').addClass('selected'); } else { part = route.split('/'); if (route == 'common/home') { $('#tab_home').addClass('selected'); } else if (route == 'account/login') { $('#tab_login').addClass('selected'); } else if (part[0] == 'account') { $('#tab_account').addClass('selected'); } else if (route == 'checkout/cart') { $('#tab_cart').addClass('selected'); } else if (part[0] == 'checkout') { $('#tab_checkout').addClass('selected'); } else { $('#tab_home').addClass('selected'); } }});//--></script><script type="text/javascript"><!--$('#search input').keydown(function(e) { if (e.keyCode == 13) { moduleSearch(); }});function moduleSearch() { url = 'index.php?route=product/search'; var filter_keyword = $('#filter_keyword').attr('value') if (filter_keyword) { url += '&keyword=' + encodeURIComponent(filter_keyword); } var filter_category_id = $('#filter_category_id').attr('value'); if (filter_category_id) { url += '&category_id=' + filter_category_id; } location = url;}//--></script><script type="text/javascript"><!--$('.switcher').bind('click', function() { $(this).find('.option').slideToggle('fast');});$('.switcher').bind('mouseleave', function() { $(this).find('.option').slideUp('fast');}); //--></script> 3. category.php <?php class ControllerProductCategory extends Controller { public function index() { $this->language->load('product/category'); $this->document->breadcrumbs = array(); $this->document->breadcrumbs[] = array( 'href' => HTTP_SERVER . 'index.php?route=common/home', 'text' => $this->language->get('text_home'), 'separator' => FALSE ); $this->load->model('catalog/category'); $this->load->model('tool/seo_url'); if (isset($this->request->get['path'])) { $path = ''; $parts = explode('_', $this->request->get['path']); foreach ($parts as $path_id) { $category_info = $this->model_catalog_category->getCategory($path_id); if ($category_info) { if (!$path) { $path = $path_id; } else { $path .= '_' . $path_id; } $this->document->breadcrumbs[] = array( 'href' => $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/category&path=' . $path), 'text' => $category_info['name'], 'separator' => $this->language->get('text_separator') ); } } $category_id = array_pop($parts); } else { $category_id = 0; } $category_info = $this->model_catalog_category->getCategory($category_id); if ($category_info) { $this->document->title = $category_info['name']; $this->document->keywords = $category_info['meta_keywords']; $this->document->description = $category_info['meta_description']; $this->data['heading_title'] = $category_info['name']; $this->data['description'] = html_entity_decode($category_info['description'], ENT_QUOTES, 'UTF-8'); $this->data['text_sort'] = $this->language->get('text_sort'); $this->load->model('tool/image'); if ($category_info['image']) { $image = $category_info['image']; } else { $image = ''; } $this->data['thumb'] = $this->model_tool_image->resize($image, $this->config->get('config_image_category_width'), $this->config->get('config_image_category_height')); if (isset($this->request->get['page'])) { $page = $this->request->get['page']; } else { $page = 1; } 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'; } $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']; } $this->load->model('catalog/product'); $category_total = $this->model_catalog_category->getTotalCategoriesByCategoryId($category_id); $product_total = $this->model_catalog_product->getTotalProductsByCategoryId($category_id); if ($category_total || $product_total) { $this->data['categories'] = array(); $results = $this->model_catalog_category->getCategories($category_id); foreach ($results as $result) { if ($result['image']) { $image = $result['image']; } else { $image = 'no_image.jpg'; } $this->data['categories'][] = array( 'name' => $result['name'], 'href' => $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/category&path=' . $this->request->get['path'] . '_' . $result['category_id'] . $url), 'thumb' => $this->model_tool_image->resize($image, $this->config->get('config_image_category_width'), $this->config->get('config_image_category_height')) ); } $this->load->model('catalog/review'); $this->data['button_add_to_cart'] = $this->language->get('button_add_to_cart'); $this->data['products'] = array( 'id' => $result['product_id'], 'name' => $result['name'], 'model' => $result['model'], 'rating' => $rating, 'stars' => sprintf($this->language->get('text_stars'), $rating), 'thumb' => image_resize($image, $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height')), 'price' => $price, 'special' => $special, 'href' => $this->model_tool_seo_url->rewrite($this->url->http('product/product&product_id=' . $result['product_id'])) ); $results = $this->model_catalog_product->getProductsByCategoryId($category_id, $sort, $order, ($page - 1) * $this->config->get('config_catalog_limit'), $this->config->get('config_catalog_limit')); foreach ($results as $result) { if ($result['image']) { $image = $result['image']; } else { $image = 'no_image.jpg'; } if ($this->config->get('config_review')) { $rating = $this->model_catalog_review->getAverageRating($result['product_id']); } else { $rating = false; } $special = FALSE; $discount = $this->model_catalog_product->getProductDiscount($result['product_id']); if ($discount) { $price = $this->currency->format($this->tax->calculate($discount, $result['tax_class_id'], $this->config->get('config_tax'))); } else { $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax'))); $special = $this->model_catalog_product->getProductSpecial($result['product_id']); if ($special) { $special = $this->currency->format($this->tax->calculate($special, $result['tax_class_id'], $this->config->get('config_tax'))); } } $options = $this->model_catalog_product->getProductOptions($result['product_id']); if ($options) { $add = $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/product&product_id=' . $result['product_id']); } else { $add = HTTPS_SERVER . 'index.php?route=checkout/cart&product_id=' . $result['product_id']; } $this->data['products'][] = array( 'name' => $result['name'], 'model' => $result['model'], 'rating' => $rating, 'stars' => sprintf($this->language->get('text_stars'), $rating), 'thumb' => $this->model_tool_image->resize($image, $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height')), 'price' => $price, 'options' => $options, 'special' => $special, 'href' => $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/product&path=' . $this->request->get['path'] . '&product_id=' . $result['product_id']), 'add' => $add ); } if (!$this->config->get('config_customer_price')) { $this->data['display_price'] = TRUE; } elseif ($this->customer->isLogged()) { $this->data['display_price'] = TRUE; } else { $this->data['display_price'] = FALSE; } $url = ''; if (isset($this->request->get['page'])) { $url .= '&page=' . $this->request->get['page']; } $this->data['sorts'] = array(); $this->data['sorts'][] = array( 'text' => $this->language->get('text_default'), 'value' => 'p.sort_order-ASC', 'href' => $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/category&path=' . $this->request->get['path'] . '&sort=p.sort_order&order=ASC') ); $this->data['sorts'][] = array( 'text' => $this->language->get('text_name_asc'), 'value' => 'pd.name-ASC', 'href' => $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/category&path=' . $this->request->get['path'] . '&sort=pd.name&order=ASC') ); $this->data['sorts'][] = array( 'text' => $this->language->get('text_name_desc'), 'value' => 'pd.name-DESC', 'href' => $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/category&path=' . $this->request->get['path'] . '&sort=pd.name&order=DESC') ); $this->data['sorts'][] = array( 'text' => $this->language->get('text_price_asc'), 'value' => 'p.price-ASC', 'href' => $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/category&path=' . $this->request->get['path'] . '&sort=p.price&order=ASC') ); $this->data['sorts'][] = array( 'text' => $this->language->get('text_price_desc'), 'value' => 'p.price-DESC', 'href' => $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/category&path=' . $this->request->get['path'] . '&sort=p.price&order=DESC') ); $this->data['sorts'][] = array( 'text' => $this->language->get('text_rating_desc'), 'value' => 'rating-DESC', 'href' => $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/category&path=' . $this->request->get['path'] . '&sort=rating&order=DESC') ); $this->data['sorts'][] = array( 'text' => $this->language->get('text_rating_asc'), 'value' => 'rating-ASC', 'href' => $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/category&path=' . $this->request->get['path'] . '&sort=rating&order=ASC') ); $this->data['sorts'][] = array( 'text' => $this->language->get('text_model_asc'), 'value' => 'p.model-ASC', 'href' => $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/category&path=' . $this->request->get['path'] . '&sort=p.model&order=ASC') ); $this->data['sorts'][] = array( 'text' => $this->language->get('text_model_desc'), 'value' => 'p.model-DESC', 'href' => $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/category&path=' . $this->request->get['path'] . '&sort=p.model&order=DESC') ); $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']; } $pagination = new Pagination(); $pagination->total = $product_total; $pagination->page = $page; $pagination->limit = $this->config->get('config_catalog_limit'); $pagination->text = $this->language->get('text_pagination'); $pagination->url = $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/category&path=' . $this->request->get['path'] . $url . '&page={page}'); $this->data['pagination'] = $pagination->render(); $this->data['sort'] = $sort; $this->data['order'] = $order; if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/product/category.tpl')) { $this->template = $this->config->get('config_template') . '/template/product/category.tpl'; } else { $this->template = 'default/template/product/category.tpl'; } $this->children = array( 'common/column_right', 'common/column_left', 'common/footer', 'common/header' ); $this->response->setOutput($this->render(TRUE), $this->config->get('config_compression')); } else { $this->document->title = $category_info['name']; $this->document->description = $category_info['meta_description']; $this->data['heading_title'] = $category_info['name']; $this->data['text_error'] = $this->language->get('text_empty'); $this->data['button_continue'] = $this->language->get('button_continue'); $this->data['continue'] = HTTP_SERVER . 'index.php?route=common/home'; $this->data['categories'] = array(); $this->data['products'] = array(); if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/product/category.tpl')) { $this->template = $this->config->get('config_template') . '/template/product/category.tpl'; } else { $this->template = 'default/template/product/category.tpl'; } $this->children = array( 'common/column_right', 'common/column_left', 'common/footer', 'common/header' ); $this->response->setOutput($this->render(TRUE), $this->config->get('config_compression')); } } else { $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['page'])) { $url .= '&page=' . $this->request->get['page']; } if (isset($this->request->get['path'])) { $this->document->breadcrumbs[] = array( 'href' => $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/category&path=' . $this->request->get['path'] . $url), 'text' => $this->language->get('text_error'), 'separator' => $this->language->get('text_separator') ); } $this->document->title = $this->language->get('text_error'); $this->data['heading_title'] = $this->language->get('text_error'); $this->data['text_error'] = $this->language->get('text_error'); $this->data['button_continue'] = $this->language->get('button_continue'); $this->data['continue'] = HTTP_SERVER . 'index.php?route=common/home'; if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/error/not_found.tpl')) { $this->template = $this->config->get('config_template') . '/template/error/not_found.tpl'; } else { $this->template = 'default/template/error/not_found.tpl'; } $this->children = array( 'common/column_right', 'common/column_left', 'common/footer', 'common/header' ); $this->response->setOutput($this->render(TRUE), $this->config->get('config_compression')); } }}?> 4.home.php <?php class ControllerCommonHome extends Controller { public function index() { $this->language->load('common/home'); $this->document->title = $this->config->get('config_title'); $this->document->description = $this->config->get('config_meta_description'); $this->data['heading_title'] = sprintf($this->language->get('heading_title'), $this->config->get('config_name')); $this->load->model('setting/store'); $this->data['products'] = array(); if (!$this->config->get('config_store_id')) { $this->data['welcome'] = html_entity_decode($this->config->get('config_description_' . $this->config->get('config_language_id')), ENT_QUOTES, 'UTF-8'); } else { $store_info = $this->model_setting_store->getStore($this->config->get('config_store_id')); if ($store_info) { $this->data['welcome'] = html_entity_decode($store_info['description'], ENT_QUOTES, 'UTF-8'); } else { $this->data['welcome'] = ''; } } if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/common/home.tpl')) { $this->template = $this->config->get('config_template') . '/template/common/home.tpl'; } else { $this->template = 'default/template/common/home.tpl'; } $this->children = array( 'common/column_right', 'common/column_left', 'common/footer', 'common/header' ); $this->load->model('checkout/extension'); $module_data = $this->model_checkout_extension->getExtensionsByPosition('module', 'home'); $this->data['modules'] = $module_data; foreach ($module_data as $result) { $this->children[] = 'module/' . $result['code']; } $this->response->setOutput($this->render(TRUE), $this->config->get('config_compression')); }}?>5.cart.php <?php class ControllerModuleCart extends Controller { protected function index() { $this->language->load('module/cart'); $this->load->model('tool/seo_url'); $this->data['heading_title'] = $this->language->get('heading_title'); $this->data['text_subtotal'] = $this->language->get('text_subtotal'); $this->data['text_empty'] = $this->language->get('text_empty'); $this->data['text_remove'] = $this->language->get('text_remove'); $this->data['text_confirm'] = $this->language->get('text_confirm'); $this->data['text_view'] = $this->language->get('text_view'); $this->data['text_checkout'] = $this->language->get('text_checkout'); $this->data['view'] = HTTP_SERVER . 'index.php?route=checkout/cart'; $this->data['checkout'] = HTTPS_SERVER . 'index.php?route=checkout/shipping'; $this->data['products'] = array(); foreach ($this->cart->getProducts() as $result) { $option_data = array(); foreach ($result['option'] as $option) { $option_data[] = array( 'name' => $option['name'], 'value' => $option['value'] ); } $this->data['products'][] = array( 'key' => $result['key'], 'name' => $result['name'], 'option' => $option_data, 'quantity' => $result['quantity'], 'stock' => $result['stock'], 'price' => $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax'))), 'href' => $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/product&product_id=' . $result['product_id']), ); } if (!$this->config->get('config_customer_price')) { $this->data['display_price'] = TRUE; } elseif ($this->customer->isLogged()) { $this->data['display_price'] = TRUE; } else { $this->data['display_price'] = FALSE; } $total_data = array(); $total = 0; $taxes = $this->cart->getTaxes(); $this->load->model('checkout/extension'); $sort_order = array(); $results = $this->model_checkout_extension->getExtensions('total'); foreach ($results as $key => $value) { $sort_order[$key] = $this->config->get($value['key'] . '_sort_order'); } array_multisort($sort_order, SORT_ASC, $results); foreach ($results as $result) { $this->load->model('total/' . $result['key']); $this->{'model_total_' . $result['key']}->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['ajax'] = $this->config->get('cart_ajax'); $this->id = 'cart'; if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/module/cart.tpl')) { $this->template = $this->config->get('config_template') . '/template/module/cart.tpl'; } else { $this->template = 'default/template/module/cart.tpl'; } $this->render(); } public function callback() { $this->language->load('module/cart'); $this->load->model('tool/seo_url'); unset($this->session->data['shipping_methods']); unset($this->session->data['shipping_method']); unset($this->session->data['payment_methods']); unset($this->session->data['payment_method']); if ($this->request->server['REQUEST_METHOD'] == 'POST') { if (isset($this->request->post['remove'])) { $result = explode('_', $this->request->post['remove']); $this->cart->remove(trim($result[1])); } else { if (isset($this->request->post['option'])) { $option = $this->request->post['option']; } else { $option = array(); } $this->cart->add($this->request->post['product_id'], $this->request->post['quantity'], $option); } } $output = '<table cellpadding="2" cellspacing="0" style="width: 100%;">'; if ($this->cart->getProducts()) { foreach ($this->cart->getProducts() as $product) { $output .= '<tr>'; $output .= '<td width="1" valign="top" align="left"><span class="cart_remove" id="remove_ ' . $product['key'] . '" /> </span></td><td width="1" valign="top" align="right">' . $product['quantity'] . ' x </td>'; $output .= '<td align="left" valign="top"><a href="' . $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/product&product_id=' . $product['product_id']) . '">' . $product['name'] . '</a>'; $output .= '<div>'; foreach ($product['option'] as $option) { $output .= ' - <small style="color: #999;">' . $option['name'] . ' ' . $option['value'] . '</small>'; } $output .= '</div></td>'; $output .= '</tr>'; } $output .= '</table>'; $output .= ''; $total = 0; $taxes = $this->cart->getTaxes(); $this->load->model('checkout/extension'); $sort_order = array(); $view = HTTP_SERVER . 'index.php?route=checkout/cart'; $checkout = HTTPS_SERVER . 'index.php?route=checkout/shipping'; $results = $this->model_checkout_extension->getExtensions('total'); foreach ($results as $key => $value) { $sort_order[$key] = $this->config->get($value['key'] . '_sort_order'); } array_multisort($sort_order, SORT_ASC, $results); foreach ($results as $result) { $this->load->model('total/' . $result['key']); $this->{'model_total_' . $result['key']}->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); $output .= '<table cellpadding="0" cellspacing="0" align="right" style="display:inline-block;">'; foreach ($total_data as $total) { $output .= '<tr>'; $output .= '<td align="right"><span class="cart_module_total">[b]' . $total['title'] . '[/b]</span></td>'; $output .= '<td align="right"><span class="cart_module_total">' . $total['text'] . '</span></td>'; $output .= '</tr>'; } $output .= '</table>'; $output .= '<div style="padding-top:5px;text-align:center;clear:both;"><a href="' . $view . '">' . $this->language->get('text_view') . '</a> | <a href="' . $checkout . '">' . $this->language->get('text_checkout') . '</a></div>'; } else { $output .= '<div style="text-align: center;">' . $this->language->get('text_empty') . '</div>'; } $this->response->setOutput($output, $this->config->get('config_compression')); function delProduct(id){$.ajax({type: 'post',url: 'index.php?route=module/cart/callback',dataType: 'html',data: 'product_id='+id+'&_opt=del',success: function (html) {$('#module_cart').html(html);}});</script> } }?>с последним все стало совсем плохо да и ошибки везде..
  3. ну вроде туда и добавляю <?php echo $header; ?><?php echo $column_left; ?><?php echo $column_right; ?><div id="content"> <div class="top"> <div class="left"></div> <div class="right"></div> <div class="center"> <h1><?php echo $heading_title; ?></h1> </div> </div> <div class="middle"> <table style="padding-bottom:10px;"> <tr> <?php if ($thumb) { ?> <td><img src="<?php echo $thumb; ?>" alt="<?php echo $heading_title; ?>" /></td> <?php } ?> <?php if ($description) { ?> <td><?php echo $description; ?></td> <?php } ?> </tr> </table> <?php if (!$categories && !$products) { ?> <div class="content"><?php echo $text_error; ?></div> <?php } ?> <?php if ($categories) { ?> <table class="list"> <?php for ($i = 0; $i < sizeof($categories); $i = $i + 4) { ?> <tr> <?php for ($j = $i; $j < ($i + 4); $j++) { ?> <td width="25%"><?php if (isset($categories[$j])) { ?> <a href="<?php echo $categories[$j]['href']; ?>"><img src="<?php echo $categories[$j]['thumb']; ?>" title="<?php echo $categories[$j]['name']; ?>" alt="<?php echo $categories[$j]['name']; ?>" style="margin-bottom: 3px;" /></a> <a href="<?php echo $categories[$j]['href']; ?>"><?php echo $categories[$j]['name']; ?></a> <?php } ?></td> <?php } ?> </tr> <?php } ?> </table> <?php } ?> <?php if ($products) { ?> <div class="sort"> <div class="div1"> <select name="sort" onchange="location = this.value"> <?php foreach ($sorts as $sorts) { ?> <?php if (($sort . '-' . $order) == $sorts['value']) { ?> <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 class="div2"><?php echo $text_sort; ?></div> </div> <table class="list"> <?php for ($i = 0; $i < sizeof($products); $i = $i + 4) { ?> <tr> <?php for ($j = $i; $j < ($i + 4); $j++) { ?> <td width="25%"><?php if (isset($products[$j])) { ?> <a href="<?php echo $products[$j]['href']; ?>"><img src="<?php echo $products[$j]['thumb']; ?>" title="<?php echo $products[$j]['name']; ?>" alt="<?php echo $products[$j]['name']; ?>" /></a> <a href="<?php echo $products[$j]['href']; ?>"><?php echo $products[$j]['name']; ?></a> [color= #999; font-size: 11px;]<?php echo $products[$j]['model']; ?>[/color] <?php if ($display_price) { ?> <?php if (!$products[$j]['special']) { ?> [color= #900; font-weight: bold;]<?php echo $products[$j]['price']; ?>[/color] <?php } else { ?> [color= #900; font-weight: bold; text-decoration: line-through;]<?php echo $products[$j]['price']; ?>[/color] [color= #F00;]<?php echo $products[$j]['special']; ?>[/color] <?php } ?> <a class="button_add_small" href="<?php echo $products[$j]['add']; ?>" title="<?php echo $button_add_to_cart; ?>" > </a> <a class="button_add_small" href="#" onclick="buyProduct(<?php echo $products[$j]['id']; ?>);return false;" id="add_to_cart<?php echo $products[$j]['id']; ?>" class="buy"></a> ///<<<вот эту строчку <?php } ?> <?php if ($products[$j]['rating']) { ?> <img src="catalog/view/theme/default/image/stars_<?php echo $products[$j]['rating'] . '.png'; ?>" alt="<?php echo $products[$j]['stars']; ?>" /> <?php } ?> <?php } ?></td> <?php } ?> </tr> <?php } ?> </table> <div class="pagination"><?php echo $pagination; ?></div> <?php } ?> </div> <div class="bottom"> <div class="left"></div> <div class="right"></div> <div class="center"></div> </div></div><?php echo $footer; ?>
  4. про txt это уже глюки пошли от просмотра одной и той же информации, простите за неточность).. в конец файла была попытка дописать <a class="button_add_small" href="#" onclick="buyProduct(<?php echo $products[$j]['id']; ?>);return false;" id="add_to_cart<?php echo $products[$j]['id']; ?>" class="buy"></a> не получилось найти этот самый цикл отрисовки товаров
  5. у меня не получается настроить эту кнопку, правильно ли я понимаю, что надо редактировать файлы(5) - header.tpl.txt, cart.tpl.txt, cart.php.txt, home.tpl.txt и home.php.txt?попытка сделать так, как в предыдущем сообщении:В контроллер вывода перечня продуктов catalogcontrollerproductscategory.php добавил идентификатор:КОД: ВЫДЕЛИТЬ ВСЕ'id' => $result['product_id'], /*это та самая строчка*/В шаблон вывода перечня продуктов catalogviewthemedefaulttemplateproductcategory.tpl добавил кнопку:КОД: ВЫДЕЛИТЬ ВСЕпривела к ошибке в строках, видимо, потому, что неправильно дописывать было все это в конец файла, а куда правильно- не знаю, сориентируйте пожалуйста, знающие люди, очень важно сделать эту кнопку..
  6. Подскажите пожалуйста, каким образом можно учитывать в заказе производителя, очень нужно, чтобы когда клиент заказывает товар, можно было легко и быстро узнать, от какого производителя та или иная продукция. Помогите пожалуйста. Быть может, нужно установить какой-то модуль, самостоятельно не могу разобраться
  7. Подскажите пожалуйста, каким образом можно учитывать в заказе производителя, очень нужно, чтобы когда клиент заказывает товар, можно было легко и быстро узнать, от какого производителя та или иная продукция. Помогите пожалуйста. Быть может, нужно установить какой-то модуль, самостоятельно не могу разобраться
Guest
×
  • 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.