Jump to content

Фильтр товаров с нулевой ценой в админ панели Simpla


Recommended Posts

Друзья, очень давно( наверное еще на старом форуме) была доработка где возможность появляется фильтровать товары с нулевой ценой.

Сейчас по поиску не нашел результата.

Если у кого сохранилось, напишите пожалуйста.

Link to post
Share on other sites
if (isset($filter['price_null'])) {
    $price_null_filter .= $this->db->placehold(' AND (SELECT COUNT(*)>0 FROM __variants pv WHERE pv.product_id=p.id AND pv.price>0 LIMIT 1) = ?', intval($filter['price_null']));
}

 

Нашел, вдруг кому пригодится.

Link to post
Share on other sites

Только добавить нужно в simpla/design/products.tpl

<li {if $filter=='allprice_null'}class="selected"{/if}><a href="{url keyword=null brand_id=null category_id=null page=null filter='allprice_null'}">С нулевой ценой</a></li>
	

и в simpla/ProductsAdmin.php

		
      elseif($f == 'allprice_null')
		$filter['price_null'] = 0;
		

ну и в 2х местах в api/Products.php

	if (isset($filter['price_null'])) {
		$in_stock_filter .= $this->db->placehold(' AND (SELECT COUNT(*)>0 FROM __variants pv WHERE pv.product_id=p.id AND pv.price>0 LIMIT 1) = ?', intval($filter['price_null']));
	}

 

Edited by get31
Link to post
Share on other sites
4 часа назад, get31 сказал:

Сомневаюсь, что вы проверили мой код

меня интересовал в первую очередь запрос, остальное можно методом тыка уже дописать.

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
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.

Loading...
×
×
  • Create New...