Jump to content
Sign in to follow this  
kate1987

Добавить опции OC filter в модуль рекомендуемые

Recommended Posts

Здравствуйте

Использую Opencart 1.5.6 + OC filter

Хочу вывести опции OC filter в модуль рекомендуемые

Для этого добавила в котроллер

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

после

		$this->load->model('catalog/product'); 
 $ocfilter_products_options = $this->model_catalog_ocfilter->getOCFilterProductsOptions($products);  

после

$products = array_slice($products, 0, (int)$setting['limit']);
'ocfilter_products_options' => $ocfilter_products_options[$product_info['product_id']]

после

'href'    	 => $this->url->link('product/product', 'product_id=' . $product_info['product_id']),

И в файле tpl

<?php if ($product['ocfilter_products_options']) { ?>
			  <?php if (is_array($product['ocfilter_products_options'])) { ?>
			  <ul class="product-ocfilter-options">
			    <?php foreach ($product['ocfilter_products_options'] as $ocfilter_option) { ?>
			    <li><span class="product-ocfilter-option"><?php echo $ocfilter_option['name']; ?>:</span> <span class="product-ocfilter-value"><?php echo $ocfilter_option['values']; ?></span></li>
			    <?php } ?>
			  </ul>
			  <?php } else { ?>
			  <?php echo $product['ocfilter_products_options']; ?>
			  <?php } ?>
			  <?php } ?>

Результатом является ошибка на сайте

 

Notice: Undefined index: 56 in /home/u385680816/public_html/vqmod/vqcache/vq2-catalog_controller_module_featured.php on line 79

Notice: Undefined index: 57 in /home/u385680816/public_html/vqmod/vqcache/vq2-catalog_controller_module_featured.php on line 79

Notice: Undefined index: 58 in /home/u385680816/public_html/vqmod/vqcache/vq2-catalog_controller_module_featured.php on line 79

Notice: Undefined index: 52 in /home/u385680816/public_html/vqmod/vqcache/vq2-catalog_controller_module_featured.php on line 79

 

где 56, 57, 58, 52

это id товаров, выведенных в модуле рекомендуемые

 

Может кто выводил эти опции в модулях? Прошу помощи

Share this post


Link to post
Share on other sites

а кто будет смотреть, что пришло в переменную $ocfilter_products_options?

Share this post


Link to post
Share on other sites
<?php print_r $ocfilter_products_options  ?>

Так вы имеете в виду?

Результат - пусто(

Share this post


Link to post
Share on other sites

с утра еще было

print_r($var);
но тут уж лучше

var_dump($var);
и знать, что там

$this->model_catalog_ocfilter->getOCFilterProductsOptions($products);
вообще происходит и что он ждет на входе.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
You are posting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×

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.