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

Leaderboard

Popular Content

Showing content with the highest reputation on 04/29/2011 in all areas

  1. Делаем следующее: CSS: добавляем в конец /*=Category view*/ .view-buttons{float:left;margin-top: 7px;} .view-buttons a{display:inline-block;height:16px;width:16px;margin-left:7px;} .view-buttons a#grid{background:url('../image/view-table.png') no-repeat 0 0;} .view-buttons a#list{background:url('../image/view-list.png') no-repeat 0 0;} .view-buttons a.onpress{background-position:0 -16px!important;} .grid{list-style-type:none;margin:5px 0;padding:0;text-align: center;} .grid li{float: left;height: 215px;width: 25%;/*width: 32%;*/} .grid .right{min-height: 50px;} .grid .title{display:block; margin: 3px 0;} .list{list-style-type:none;margin:5px 0;padding:0;overflow:hidden;} .list li{clear:both;float:none;overflow:hidden;padding:20px;} .list li + li{border-top:1px dotted #999999;} .list .title{display:block;margin:0 0 10px;} .list .main{float:left;} .list .main .left{float:left;} .list .main .left a{display:block;text-decoration:none;} .list .main .right{float:right;margin: 0 20px;padding-top: 10px;} .list .main .right .model{display:block;} .list .other{float:right; padding-top: 10px;} .list .other img{display:block;margin: 3px 0;} /*=End category view */ HTML: в category.tpl заменяем <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><br /> <a href="<?php echo $products[$j]['href']; ?>"><?php echo $products[$j]['name']; ?></a><br /> <span style="color: #999; font-size: 11px;"><?php echo $products[$j]['model']; ?></span><br /> <?php if ($display_price) { ?> <?php if (!$products[$j]['special']) { ?> <span style="color: #900; font-weight: bold;"><?php echo $products[$j]['price']; ?></span> <?php } else { ?> <span style="color: #900; font-weight: bold; text-decoration: line-through;"><?php echo $products[$j]['price']; ?></span> <span style="color: #F00;"><?php echo $products[$j]['special']; ?></span> <?php } ?> <a class="button_add_small" href="<?php echo $products[$j]['add']; ?>" title="<?php echo $button_add_to_cart; ?>" > </a> <?php } ?> <br /> <?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> на <ul class="<?php echo $view_mode; ?>" id="view"> <?php foreach ($products as $product) { ?> <li> <div class="main"> <div class="left"> <a href="<?php echo $product['href']; ?>" class="thumb" rel="<?php echo $product['compare_thumb']; ?>"> <img src="<?php echo $product['thumb']; ?>" title="<?php echo $product['name']; ?>" alt="<?php echo $product['name']; ?>" id="image-<?php echo $product['product_id']; ?>" /> </a> </div> <div class="right"> <a href="<?php echo $product['href']; ?>" class="title"><?php echo $product['name']; ?></a> <span class="model"><?php echo $product['model']; ?></span> </div> </div> <div class="other"> <?php if ($display_price) { ?> <?php if (!$product['special']) { ?> <span style="color: #900; font-weight: bold;"><?php echo $product['price']; ?></span> <?php } else { ?> <span style="color: #900; font-weight: bold; text-decoration: line-through;"><?php echo $product['price']; ?></span> <span style="color: #F00;"><?php echo $product['special']; ?></span> <?php } ?> <a class="button_add_small" href="<?php echo $product['add']; ?>" title="<?php echo $button_add_to_cart; ?>" > </a> <?php } ?> <br /> <?php if ($product['rating']) { ?> <img src="catalog/view/theme/default/image/stars_<?php echo $product['rating'] . '.png'; ?>" alt="<?php echo $product['stars']; ?>" /> <?php } ?> </div> </li> <?php } ?> </ul> заменяем <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> на <div class="sort"> <div class="view-buttons"> <a id="grid" class="change-view<?php echo ($view_mode == 'grid' ? ' onpress' : ''); ?>"></a> <a id="list" class="change-view<?php echo ($view_mode == 'list' ? ' onpress' : ''); ?>"></a> </div> <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> перед <?php echo $footer; ?> вставляем <script type="text/javascript"><!-- $('.change-view').click(function(){ $('#view').removeClass().addClass($(this).attr('id')); $('.change-view').removeClass('onpress'); $(this).addClass('onpress'); $.post('<?php echo $view_action; ?>', 'view=' + $(this).attr('id')); }); //--></script> PHP: в category.php, после $this->data['button_add_to_cart'] = $this->language->get('button_add_to_cart');добавляем $this->data['view_action'] = HTTP_SERVER . 'index.php?route=product/category/view'; $this->data['view_mode'] = (isset($this->session->data['view_mode']) ? $this->session->data['view_mode'] : 'grid'); В конец файла перед закрытием класса вставляем метод public function view() { if ($this->request->server['REQUEST_METHOD'] == 'POST' && isset($this->request->post['view'])) { $this->session->data['view_mode'] = $this->request->post['view']; } } Иконки видов: кидаем в папку с изображениями вашего шаблона view_icons.zip Собственно и всё. Временную демку можно глянуть тут
    1 point
  2. я уже писал, как добавить вывод наличия на складе в категории. пользуйтесь поиском
    1 point
  3. 1. Чтобы убрать вылидацию : Находите файл \www\catalog\controller\account\create.php Находите в районе 320 ой строки: private function validate() { if ((strlen(utf8_decode($this->request->post['firstname'])) < 1) || (strlen(utf8_decode($this->request->post['firstname'])) > 32)) { $this->error['firstname'] = $this->language->get('error_firstname'); } if ((strlen(utf8_decode($this->request->post['lastname'])) < 1) || (strlen(utf8_decode($this->request->post['lastname'])) > 32)) { $this->error['lastname'] = $this->language->get('error_lastname'); } if ((strlen(utf8_decode($this->request->post['email'])) > 96) || (!preg_match(EMAIL_PATTERN, $this->request->post['email']))) { $this->error['email'] = $this->language->get('error_email'); } if ($this->model_account_customer->getTotalCustomersByEmail($this->request->post['email'])) { $this->error['warning'] = $this->language->get('error_exists'); } if ((strlen(utf8_decode($this->request->post['telephone'])) < 3) || (strlen(utf8_decode($this->request->post['telephone'])) > 32)) { $this->error['telephone'] = $this->language->get('error_telephone'); } if ((strlen(utf8_decode($this->request->post['address_1'])) < 3) || (strlen(utf8_decode($this->request->post['address_1'])) > 128)) { $this->error['address_1'] = $this->language->get('error_address_1'); } if ((strlen(utf8_decode($this->request->post['city'])) < 3) || (strlen(utf8_decode($this->request->post['city'])) > 128)) { $this->error['city'] = $this->language->get('error_city'); } $this->load->model('localisation/country'); $country_info = $this->model_localisation_country->getCountry($this->request->post['country_id']); if ($country_info && $country_info['postcode_required']) { if ((strlen(utf8_decode($this->request->post['postcode'])) < 2) || (strlen(utf8_decode($this->request->post['postcode'])) > 10)) { $this->error['postcode'] = $this->language->get('error_postcode'); } } if ($this->request->post['country_id'] == 'FALSE') { $this->error['country'] = $this->language->get('error_country'); } if ($this->request->post['zone_id'] == 'FALSE') { $this->error['zone'] = $this->language->get('error_zone'); } if ((strlen(utf8_decode($this->request->post['password'])) < 4) || (strlen(utf8_decode($this->request->post['password'])) > 20)) { $this->error['password'] = $this->language->get('error_password'); } if ($this->request->post['confirm'] != $this->request->post['password']) { $this->error['confirm'] = $this->language->get('error_confirm'); } if ($this->config->get('config_account_id')) { $this->load->model('catalog/information'); $information_info = $this->model_catalog_information->getInformation($this->config->get('config_account_id')); if ($information_info) { if (!isset($this->request->post['agree'])) { $this->error['warning'] = sprintf($this->language->get('error_agree'), $information_info['title']); } } } if (!$this->error) { return TRUE; } else { return FALSE; } } Здесь можно снять обязательное заполнение какого-то поля, просто закомментировав его, например, чтобы не заполнять фамилию, надо поменять if ((strlen(utf8_decode($this->request->post['firstname'])) < 1) || (strlen(utf8_decode($this->request->post['firstname'])) > 32)) { $this->error['firstname'] = $this->language->get('error_firstname'); }на /* if ((strlen(utf8_decode($this->request->post['firstname'])) < 1) || (strlen(utf8_decode($this->request->post['firstname'])) > 32)) { $this->error['firstname'] = $this->language->get('error_firstname'); } */ Так проделываем для всех полей, которые нам не нужны(т.е. просто комментим их). 2. Чтобы поле не показывалось в форме регистрации: Находите файл \www\catalog\view\theme\default\template\account\create.tpl (default - ваша тема, может быть другой) В строках, которые хотим убрать, добавляем style="display:none" пример(убираем фамилию): меняем <tr> <td><span class="required">*</span> <?php echo $entry_lastname; ?></td> <td><input type="text" name="lastname" value="<?php echo $lastname; ?>" /> <?php if ($error_lastname) { ?> <span class="error"><?php echo $error_lastname; ?></span> <?php } ?></td> </tr>на <tr style="display:none"> <td><span class="required">*</span> <?php echo $entry_lastname; ?></td> <td><input type="text" name="lastname" value="<?php echo $lastname; ?>" /> <?php if ($error_lastname) { ?> <span class="error"><?php echo $error_lastname; ?></span> <?php } ?></td> </tr> 3. Ставим мне плюсик :rolleyes:
    1 point
×
×
  • 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.