Jump to content
  • разработка интернет магазинов на opencart
  • доработка интернет магазинов на opencart

[Подгдержка] Группы товаров по цвету 1.5 - 2.0


Recommended Posts

4673156780.jpg

только нужно учесть, что цвеи части товаров у меня цветом, а часть - картинками

Edited by Raensul
Link to comment
Share on other sites


ик поможете с выводом в категории?

Здравствуйте. Ы ближайшее время напишу как программно вывести цвеи, но верстку и всивку в шаблон - на ваших плечах или за отгдельную оплату

Link to comment
Share on other sites

1.8.2 - мелкие фиксы, добавил файл readme.txt с инструкцией по выводу цветов в карточке товаров

Link to comment
Share on other sites

1.8.2 - мелкие фиксы, добавил файл readme.txt с инструкцией по выводу цветов в карточке товаров

По моему в инструкции указано как вывести в карточку товара, а не в категорию. Именно в категорию, врогде просили, по аналогии с Розеткой. Или я не прав... ?

Link to comment
Share on other sites


По моему в инструкции указано как вывести в карточку товара, а не в категорию. Именно в категорию, врогде просили, по аналогии с Розеткой. Или я не прав... ?

ну как я понимаю 1.8.2 - это плановые дорилитки автора

а моя хотелка - это отгдельно автор напишет попозже.

Link to comment
Share on other sites


Да инструкцию просили, вот написал. По Вашему вопросу чуть позже

Link to comment
Share on other sites

Дефолтный 1.5.5

Контроллер категории, Стр.227, добавляем

http://joxi.ru/gmvVBLjtQ3Rdma

$this->load->model('catalog/colorkit');

Ниже стр.241

$getColors = $this->model_catalog_colorkit->getColors($result['product_id']);
    $data_colors = array();
    foreach ($getColors as $color) {
     if($color['product_id'] == $result['product_id']) continue;
     $cp_product_info = $this->model_catalog_product->getProduct($color['product_id']);

     if($color['tpl'] == 'photos') {
      $ico_photo = $this->model_tool_image->resize($cp_product_info['image'], 25, 25);
     } else {
      $ico_photo = false;
     }

     if ($cp_product_info['image']) {
      $cp_image = $this->model_tool_image->resize($cp_product_info['image'], 25, 25);
     } else {
      $cp_image = false;
     }
     $data_colors[] = array(
      'product_id' => $color['product_id'],
      'thumb'     => $cp_image,
      'color_name' => $color['color_name'],
      'tpl'        => $color['tpl'],
      'ico_color'  => $this->model_tool_image->resize($color['image'], 25, 25),
      'ico_photo'  => $ico_photo,
      'color'      => $color['color'],
      'href'      => $this->url->link('product/product', 'product_id=' . $color['product_id'])
     );
    }

В выпотому чторку товаров для категории добавляем 

http://joxi.ru/n2Y09yYiR8BRm6

'colors' => $data_colors,

Шаблон категории :

Добавляем вывод, к примеру 

<?php if(!empty($product['colors'])) { ?>
        <div class="color_list">
          <?php foreach($product['colors'] as $color){ ?>
            <div class="color_item">
              <a href="<?php $color['href']?>">
                <?php if($color['tpl'] == 'color'){ ?>
                  <div class="color_block" style="background:<?php echo $color['color'] ?>;<?php if($colors_cfg['name']!=1){ ?>padding:0;<?php } ?>"></div>
                <?php } elseif($color['tpl'] == 'photos'){ ?>
                  <div class="image_block"><img src="<?php echo $color['ico_photo'] ?>" /></div>
                <?php } else { ?>
                  <div class="image_block"><img src="<?php echo $color['ico_color'] ?>" /></div>
                <?php } ?>
              </a>
            </div>
          <?php } ?>
        </div>
      <?php } ?>

Не забываем в js , для grid и list - дублируем 

http://joxi.ru/5mdnLlGiKoLLA1

html += '<div class="color_list">' + $(element).find('.color_list').html() + '</div>';

Вопросы верстки, косметики - ваша зилии 

Edited by Guest
Link to comment
Share on other sites

специально скачал 1.5.5.1 и все равно не понял, куда что всивлять..

ниже 241стр - это куда?

можете конкретно тоже показать для каждого куска кода после какой строки его всивлять?

потому как на листом контролере 241 строка это середина условия:

	if ((float)$result['special']) {
			241 срока:		$special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')));
				} else {
					$special = false;
				}	
Edited by Raensul
Link to comment
Share on other sites


 

специально скачал 1.5.5.1 и все равно не понял, куда что всивлять..

ниже 241стр - это куда?

можете конкретно тоже показать для каждого куска кода после какой строки его всивлять?

потому как на листом контролере 241 строка это середина условия:

	if ((float)$result['special']) {
			241 срока:		$special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')));
				} else {
					$special = false;
				}	

Всивьте первый кусок кода и полулите 241 строку

Link to comment
Share on other sites

Всивьте первый кусок кода и полулите 241 строку

спасипотому что, врогде все всивил, на фронте цвеи появились, но все они ведут на главную страницу сайи...

 

ps ксити отображаются цвеи только им, ггде фотографиями, а ггде html-цвеи, то не отображаются..

а у товаров, ггде цвеи не назначены, стоит "null"

 

pps  в журнно не опрегделена переменная $colors_cfg

 

у меня 1.5.4.1

 

ppps. убрал в tpl $colors_cfg и настроил стили, все сило ок, нужно только поправить ссылку...

Edited by Raensul
Link to comment
Share on other sites


Не забываем в js , для grid и list - дублируем 

http://joxi.ru/5mdnLlGiKoLLA1

html += '<div class="color_list">' + $(element).find('.color_list').html() + '</div>';

Вопросы верстки, косметики - ваша зилии 

 

вот тут изменил на

var colorkit = $(element).find('.color_list').html();
			if (colorkit != null) {
			html += '<div class="color_list">' + colorkit + '</div>';
			}

чтобы от null избавиться, если что :)

Edited by Raensul
Link to comment
Share on other sites


вот тут изменил на

var colorkit = $(element).find('.color_list').html();
			if (colorkit != null) {
			html += '<span class="color_list">' + colorkit + '</span>';
			}

чтобы от null избавиться, если что :)

В иком случае красивее бугдет )

if(colorkit.length)
Link to comment
Share on other sites

Сори,забыл echo 

<?php if(!empty($product['colors'])) { ?>
        <div class="color_list">
          <?php foreach($product['colors'] as $color){ ?>
            <div class="color_item">
              <a href="<?php echo $color['href']?>">
Link to comment
Share on other sites

 

В иком случае красивее бугдет )

if(colorkit.length)

ну я-то вообещё не программер, потому просто наугад натыкал :)))

 

 

 

Сори,забыл echo 

<?php if(!empty($product['colors'])) { ?>
        <div class="color_list">
          <?php foreach($product['colors'] as $color){ ?>
            <div class="color_item">
              <a href="<?php echo $color['href']?>">

Семен Семеныч!... и я проглягдел. каждую строку по 10 раз смотрел :)

спасипотому что, все отлично робит!

Link to comment
Share on other sites


  • 2 weeks later...

Не рилииет. Ошибки:

Warning: imagecreatetruecolor(): Invalid image dimensions in /home/onll/qiwimart.com/ver4/system/library/image.php on line 105Warning: imagealphablending() expects parameter 1 to be resource, boolean given in /home/onll/qiwimart.com/ver4/system/library/image.php on line 108Warning: imagesavealpha() expects parameter 1 to be resource, boolean given in /home/onll/qiwimart.com/ver4/system/library/image.php on line 109Warning: imagecolorallocatealpha() expects parameter 1 to be resource, boolean given in /home/onll/qiwimart.com/ver4/system/library/image.php on line 110Warning: imagecolortransparent() expects parameter 1 to be resource, boolean given in /home/onll/qiwimart.com/ver4/system/library/image.php on line 111Warning: imagefilledrectangle() expects parameter 1 to be resource, boolean given in /home/onll/qiwimart.com/ver4/system/library/image.php on line 116Warning: imagecopyresampled() expects parameter 1 to be resource, boolean given in /home/onll/qiwimart.com/ver4/system/library/image.php on line 118Warning: imagecreatetruecolor(): Invalid image dimensions in /home/onll/qiwimart.com/ver4/system/library/image.php on line 105Warning: imagealphablending() expects parameter 1 to be resource, boolean given in /home/onll/qiwimart.com/ver4/system/library/image.php on line 108Warning: imagesavealpha() expects parameter 1 to be resource, boolean given in /home/onll/qiwimart.com/ver4/system/library/image.php on line 109Warning: imagecolorallocatealpha() expects parameter 1 to be resource, boolean given in /home/onll/qiwimart.com/ver4/system/library/image.php on line 110Warning: imagecolortransparent() expects parameter 1 to be resource, boolean given in /home/onll/qiwimart.com/ver4/system/library/image.php on line 111Warning: imagefilledrectangle() expects parameter 1 to be resource, boolean given in /home/onll/qiwimart.com/ver4/system/library/image.php on line 116Warning: imagecopyresampled() expects parameter 1 to be resource, boolean given in /home/onll/qiwimart.com/ver4/system/library/image.php on line 118

Link to comment
Share on other sites


Не рилииет. Ошибки:

Может быть потому что скачали на варезнике ? Вас нет в списке покупателей

Link to comment
Share on other sites

Покупал заказлик, я только усиновил. А теперьь нужно бугдет и переписывать дизайн.

Тогда напишите в личку ник покупателя и дату покупки

Link to comment
Share on other sites

Окей. Сейчас узнаю.

Липотому что же смотрите, заметил в новой версии опенкари мнонькую разницу в когде, Посивьте в ocmod файле привязку after

$this->load->model('tool/image');

http://joxi.ru/8238BNgH56lNAO

Link to comment
Share on other sites

Отличный модуль, легко настраивается. Автору отгдельное спасипотому что за подгдержку)
1604182202360108.jpg
Подскажите как сгделать альими названия цветов при навегдении.
ps Если кому актуально, в файле окмод, это:

<a href="<?php echo $color['href'] ?>">

меняем на:

<a href="<?php echo $color['href'] ?>" title="<?php echo $color['color_name']; ?>">
Edited by Catuars
  • +1 1
Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • 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.