Dimon789 Posted October 4, 2013 Report Share Posted October 4, 2013 Добавил возможность отключать и включать бренды, по аналогии как с категориями, только возникла одна проблемка, не могу прописать условие чтобы не выводились товары у которых бренд отключен, делаю так <!-- Список товаров--> <ul class="products"> {foreach name=brands item=b from=$category->brands} {if $b->visible} {foreach $products as $product} <!-- Товар--> <li class="product"> ...... </li> <!-- Товар (The End)--> {/foreach} {/if} {/foreach} Но пропадают все товары Quote Link to post Share on other sites
Noxter Posted October 4, 2013 Report Share Posted October 4, 2013 Делайте проверку не в шаблоне а в PHP. Quote Link to post Share on other sites
Dimon789 Posted October 4, 2013 Author Report Share Posted October 4, 2013 подскажите как, а тосам не разобрался Quote Link to post Share on other sites
Noxter Posted October 4, 2013 Report Share Posted October 4, 2013 подскажите как, а тосам не разобрался Файл api/Products.php есть функция get_products, вот там и ройтесь. Quote Link to post Share on other sites
Dimon789 Posted October 4, 2013 Author Report Share Posted October 4, 2013 Файл api/Products.php есть функция get_products, вот там и ройтесь. Роюсь но не получается делаю так на 3 строчке добавляю $brand_visible_filter = ''; чуть ниже добавляю if(isset($filter['brand_visible_filter'])) $brand_visible_filter = $this->db->placehold('AND (SELECT visible FROM __brands WHERE visible>0 ) = ?', intval($filter['brand_visible_filter'])); и в запросе селект добавляю после Where $in_stock_filter $brand_visible_filter $visible_filter Quote Link to post Share on other sites
Jekas Posted October 4, 2013 Report Share Posted October 4, 2013 Запрос видимо у Вас не правильный Quote Link to post Share on other sites
Dimon789 Posted October 4, 2013 Author Report Share Posted October 4, 2013 Все разобрался спасибо Noxter Quote Link to post Share on other sites
digimon Posted January 28, 2014 Report Share Posted January 28, 2014 можете решение вывести Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.