Раздел sale в simpla

Требуется создать категорию, куда будут попадать товары с скидкой.

  • создаем категорию с адресом страницы «sale»
  • в файле /view/ProductsView.php правим код:
// Выберем текущую категорию
if (!empty($category_url))
{
	$category = $this->categories->get_category((string)$category_url);
	if (empty($category) || (!$category->visible && empty($_SESSION['admin'])))
		return false;
	$this->design->assign('category', $category);
	
	if($category->url == 'sale') {
		$filter['discounted'] = 1;
	}
	else {
		$filter['category_id'] = $category->children;
	}
}
  • В файде /api/Products.php обновляем методы get_products и count_products:
public function get_products($filter = array())
{
...
$is_featured_filter = '';
$discounted_filter = '';
$in_stock_filter = '';
...
if(isset($filter['discounted']))
	$discounted_filter = $this->db->placehold('AND (SELECT 1 FROM __variants pv WHERE pv.product_id=p.id AND pv.compare_price>0 LIMIT 1) = ?', intval($filter['discounted']));
...
$query = "SELECT 
...
WHERE
...
$discounted_filter
...
";
...
}
public function count_products($filter = array())
{
...
$is_featured_filter = '';
$discounted_filter = '';
$in_stock_filter = '';
...
if(isset($filter['discounted']))
	$discounted_filter = $this->db->placehold('AND (SELECT 1 FROM __variants pv WHERE pv.product_id=p.id AND pv.compare_price>0 LIMIT 1) = ?', intval($filter['discounted']));
...
$query = "SELECT 
...
WHERE
...
$discounted_filter
...
";
...
}
2016   simpla
113 комментариев
ApnozSmini

casino bonus <a href=«https://onlinecasinosec.com/»>online gambling</a> gsn casino games https://onlinecasinosec.com/ — online casino slots

AvpwcSmini

usa online casino <a href=«https://onlinecasinozix.com/»>online casino real money</a> usa online casino https://onlinecasinozix.com/ — online gambling casino

AjradSmini

online casino bonus <a href=«https://onlinecasinoqr.com/»>online casino real money</a> free online casino slots https://onlinecasinoqr.com/ — casino play

AoqqySmini

online casino gambling <a href=«https://onlinecasinoplay.us.org/»>gsn casino games</a> online gambling https://onlinecasinoplay.us.org/ — online casino

AhflzSmini

online casinos for us players <a href=«https://onlinecasinopix.com/»>online casino</a> casino play https://onlinecasinopix.com/ — mgm online casino

AtkpcSmini

casino online <a href=«https://onlinecasinoqw.com/»>real money casino</a> online casino https://onlinecasinoqw.com/ — casino slots

AjaksSmini

casino slots <a href=«https://onlinecasinohouse24.com/»>gambling sites</a> online casino games https://onlinecasinohouse24.com/ — online casino

AydijSmini

online casino real money <a href=«https://onlinecasinolime24.com/»>slots for real money</a> online casino games https://onlinecasinolime24.com/ — casino bonus

AenefSmini

casino slots <a href=«https://online-casino-eagle.com/»>online casinos</a> online casino games https://online-casino-eagle.com/ — online casinos

AeziySmini

online gambling <a href=«https://online-casino-topslots.com/»>online casino games</a> online casino gambling https://online-casino-topslots.com/ — casino slots

AyyjuSmini

casino play <a href=«https://onlinecasinostate.com/»>online casino</a> online casino slots [url=https://onlinecasinostate.com/]slots for real money[/url]

AgccySmini

online casino <a href=«https://onlinecasinousd.com/»>online casinos</a> online casino https://onlinecasinousd.com/ — real money casino

AldbrSmini

online casinos <a href=«https://onlinecasino100slots.com/»>online casino slots</a> mgm online casino https://onlinecasino100slots.com/ — online casino gambling

AuzomSmini

betfair online casino <a href=«https://onlinecasinomansion24.com/»>online gambling</a> online casino gambling https://onlinecasinomansion24.com/ — online casinos

AgjkpSmini

diabetes diet <a href=«https://weightlossketodiet2018.com/»>paleo diet</a> military diet https://weightlossketodiet2018.com/ — military diet

AosilSmini

diet plans <a href=«https://weightlossketodiet2018.us.org/»>mediterranean diet plan</a> cabbage soup diet | https://weightlossketodiet2018.us.org/ — gluten free diet

AhdwcSmini

online casinos <a href=«https://onlinecasinozix.com/»>online casino games</a> gsn casino games https://onlinecasinozix.com/ — casino slots

AkmguSmini

weight watchers <a href=«https://weightloss-ketodiet.com/»>mediterranean diet recipes</a> military diet https://weightloss-ketodiet.com/ — shepherds diet

0t26gu2k

playing craps — [url=https://crapscas.com/]free craps game[/url]
craps online <a href=» https://crapscas.com/ «>how to play craps</a>
https://crapscas.com/

AaaovSmini

online casinos <a href=«https://casinoslotsy.us.org/»>casino games</a> casino real money https://casinoslotsy.us.org/ — casino slots

AdylwSmini

real money casino <a href=«https://onlinecasinogamesnt.us.org/»>bovada casino</a> online casino gambling https://onlinecasinogamesnt.us.org/ — gsn casino

AokkkSmini

casino bonus <a href=«https://onlinecasinoqe.com/»>casino real money</a> usa online casino https://onlinecasinoqe.com/ — online casinos for us players

AfwzlSmini

best online casinos <a href=«https://online-casinoss.us.org/»>casino games</a> online casinos https://online-casinoss.us.org/ — gsn casino

AqvdjSmini

casino online <a href=«https://onlinecasinoslots24.us.org/»>casino slots</a> casino slots https://onlinecasinoslots24.us.org/ — gsn casino games

AfgheSmini

casino play <a href=«https://onlinecasinousd.com/»>betfair online casino</a> gsn casino https://onlinecasinousd.com/ — casino bonus

myqmatpa

free poker online vegas world — [url=https://freepokercasno.com/]vegas world free poker[/url]
free poker games <a href=» https://freepokercasno.com/ «>free poker online vegas world</a>
https://freepokercasno.com/

AtmdySmini

hallmark online casino <a href=«https://onlinecasinomaniaa.com/»>online casinos for us players</a> twin river online casino [url=https://onlinecasinomaniaa.com/]casinos near me[/url]

AxivySmini

online casino games <a href=«https://onlinecasino-slots.us.org/»>casino blackjack</a> bovada casino https://onlinecasino-slots.us.org/ — online gambling casino

AczdoSmini

online casino <a href=«https://onlinecasinogamestt.us.org/»>casino online</a> online gambling https://onlinecasinogamestt.us.org/ — free online casino slots

AunvySmini

foxwoods casino online slots <a href=«https://onlinecasinoppl.com/»>online gambling casino</a> zone online casino vegas world [url=https://onlinecasinoppl.com/]jack online casino[/url]

AempbSmini

doubledown casino facebook <a href=«https://onlinecasinozeus24.com/»>caesars casino online</a> choctaw casino [url=https://onlinecasinozeus24.com/]mgm online casino[/url]

b9k565en

craps online free — [url=https://crapscas.com/]craps table[/url]
craps wizard of odds <a href=» https://crapscas.com/ «>free craps game</a>
https://crapscas.com/

AobguSmini

best online casino <a href=«https://casinorealmoneyy.com/»>gsn casino slots</a> casino games https://casinorealmoneyy.com/ — slots for real money

ApubfSmini

online casinos for us players <a href=«https://onlinecasinoss.us.org/»>casino bonus</a> online gambling https://onlinecasinoss.us.org/ — mgm online casino

AwsxmSmini

twin river online casino <a href=«https://onlinecasinovus.com/»>stn play online casino</a> gossip online casino [url=https://onlinecasinovus.com/]potawatomi casino[/url]

ApttcSmini

slots for real money <a href=«https://onlinecasinoster.us.org/»>casino play</a> casino bonus https://onlinecasinoster.us.org/ — usa online casino

AxmglSmini

betfair online casino <a href=«https://casinoslotssy.us.org/»>gsn casino slots</a> online casino slots https://casinoslotssy.us.org/ — online casino real money

AqvccSmini

ketogenic diet <a href=«https://weightloss-ketodiet.com/»>gout diet</a> diet coke https://weightloss-ketodiet.com/ — mayo clinic diet

AunqbSmini

foxwoods resort casino <a href=«https://onlinecasinozonee.com/»>casino game</a> best online casino [url=https://onlinecasinozonee.com/]online casino bonus[/url]

e46cfaur

free poker 247 texas holdem — [url=https://freepokercasno.com/]aol free poker games no limit texas hold’em[/url]
vegas world free poker play <a href=» https://freepokercasno.com/ «>lv world free poker</a>
https://freepokercasno.com/

AhmdnSmini

online casino gambling <a href=«https://casinoslotsy.us.org/»>online casino real money</a> gsn casino games https://casinoslotsy.us.org/ — online casino bonus

AcbvmSmini

mgm online casino <a href=«https://onlinecasinogamesnt.us.org/»>online casino</a> casino blackjack https://onlinecasinogamesnt.us.org/ — best online casinos

AjmabSmini

mgm online casino <a href=«https://onlinecasinoslots24.us.org/»>online casino bonus</a> gsn casino https://onlinecasinoslots24.us.org/ — online casino gambling

AfstySmini

online casino real money <a href=«https://casino-online2018.us.org/»>casino blackjack</a> online casino bonus https://casino-online2018.us.org/ — casino play

AguunSmini

gsn casino <a href=«https://onlinecasinohouse24.com/»>online gambling</a> online casino bonus https://onlinecasinohouse24.com/ — casino blackjack

AkngvSmini

online gambling <a href=«https://onlinecasinoqe.com/»>gsn casino</a> online gambling https://onlinecasinoqe.com/ — online casino games

ApcxlSmini

casino bonus <a href=«https://onlinecasinovus.com/»>doubleu casino on facebook</a> real casino slots on facebook [url=https://onlinecasinovus.com/]zone online casino vegas world[/url]

ApkfwSmini

gundry diet <a href=«https://weightloss-ketodiet.com/»>shepherds diet</a> mediterranean diet https://weightloss-ketodiet.com/ — atkins diet

AxfrzSmini

usa online casino <a href=«https://onlinecasinoslots24.us.org/»>online casino slots</a> slots for real money https://onlinecasinoslots24.us.org/ — casino slots

AboooSmini

casino slots <a href=«https://onlinecasinoqw.com/»>gsn casino games</a> casino blackjack https://onlinecasinoqw.com/ — real money casino

53l7y56i

free craps — [url=https://crapscas.com/]wizard of odds craps[/url]
how to win at craps every time <a href=» https://crapscas.com/ «>craps wizard of odds</a>
https://crapscas.com/

ctbzp2on

free roulette games — [url=https://roulettecas.com/]free roulette game 247[/url]
online roulette <a href=» https://roulettecas.com/ «>play roulette</a>
https://roulettecas.com/

ywtjn2vm

free video poker — [url=https://videopokercas.com/]video poker free[/url]
free video poker no download <a href=» https://videopokercas.com/ «>wizard of odds video poker</a>
https://videopokercas.com/

AfxsrSmini

online casino slots <a href=«https://onlinecasinoslotsnow.com/»>real money casino</a> online casino bonus [url=https://onlinecasinoslotsnow.com/]best online casino[/url]

AugdwSmini

online casinos for us players <a href=«https://onlinecasinoppl.com/»>online slot machines</a> parx casino online [url=https://onlinecasinoppl.com/]chinook winds casino[/url]

lz3za81v

texas holdem radio freeroll password — [url=https://texasholdemcas.com/]texas holdem poker free online aol no limit[/url]
texas holdem free <a href=» https://texasholdemcas.com/ «>texas holdem rules</a>
https://texasholdemcas.com/

AalwvSmini

pala casino online nj <a href=«https://onlinecasinovus.com/»>best online casinos</a> online casino no deposit bonus [url=https://onlinecasinovus.com/]online gambling[/url]

AohmlSmini

dakota sioux casino <a href=«https://casinoslotssy.us.org/»>playmgm nj casino online</a> casino real money [url=https://casinoslotssy.us.org/]casino games[/url]

2ylu9nbl

wsop free poker texas hold’em — [url=https://freepokercasno.com/]free poker games vegas world[/url]
vegas world free poker <a href=» https://freepokercasno.com/ «>vegas world free poker games</a>
https://freepokercasno.com/

AjcifSmini

sugarhouse casino <a href=«https://onlinecasinoqr.com/»>betfair casino online nj</a> cherokee casino https://onlinecasinoqr.com/ — gossip online casino

AcahvSmini

foxwoods casino online slots <a href=«https://onlinecasinoqe.com/»>online casino games free</a> doubleu casino https://onlinecasinoqe.com/ — vegas world casino games

ArgchSmini

hallmark casino online <a href=«https://onlinecasinowus.com/»>hollywood online casino</a> pechanga casino [url=https://onlinecasinowus.com/]casino real money[/url]

AfocbSmini

maryland live casino online <a href=«https://onlinecasinogamesnt.us.org/»>online casino gambling</a> casino slots [url=https://onlinecasinogamesnt.us.org/]treasure island casino minnesota[/url]

ArrszSmini

casino play <a href=«https://onlinecasinoha.us.org/»>online casino real money</a> online casino games | [url=https://onlinecasinoha.us.org/]online casino games[/url]

AfveiSmini

parx casino online <a href=«https://onlinecasino-games.us.org/»>casino real money</a> morongo casino [url=https://onlinecasino-games.us.org/]real money casino[/url]

ArzqeSmini

gsn casino slots <a href=«https://onlinecasinowus.com/»>muckleshoot casino</a> chumba casino [url=https://onlinecasinowus.com/]pala casino online[/url]

AevrkSmini

online casino slots <a href=«https://casino-online2018.us.org/»>gambling games</a> casino online [url=https://casino-online2018.us.org/]betfair online casino[/url]

AxkckSmini

plainridge casino <a href=«https://casinorealmoney2018.us.org/»>cafe casino online</a> potawatomi casino [url=https://casinorealmoney2018.us.org/]tropicana online casino nj[/url]

nowosz02

wizard of odds video poker — [url=https://videopokercas.com/]100 play video poker[/url]
video poker games <a href=» https://videopokercas.com/ «>video poker free</a>
https://videopokercas.com/

ivwlcncn

online roulette free — [url=https://roulettecas.com/]roulette[/url]
free roulette spin <a href=» https://roulettecas.com/ «>play roulette for free</a>
https://roulettecas.com/

AwpuoSmini

turning stone casino <a href=«https://onlinecasinozeus24.com/»>zone online casino log in</a> real casino slots [url=https://onlinecasinozeus24.com/]casino slots[/url]

AwbndSmini

online casino gambling <a href=«https://casinoslotssy.us.org/»>choctaw casino durant oklahoma</a> online gambling [url=https://casinoslotssy.us.org/]real casino slots[/url]

0k5108ua

free poker wsop — [url=https://freepokercasno.com/]www cabana vegas free poker site.com[/url]
vegas world free poker games <a href=» https://freepokercasno.com/ «>aol free poker games no limit texas hold’em</a>
https://freepokercasno.com/

AkjjeSmini

online casino no deposit bonus <a href=«https://onlinecasinogamesnt.us.org/»>three rivers casino</a> playmgm nj casino online [url=https://onlinecasinogamesnt.us.org/]mgm online casino[/url]

AnisgSmini

best online casinos <a href=«https://onlinecasinoqe.com/»>betfair casino online nj</a> casino online [url=https://onlinecasinoqe.com/]virgin casino online nj[/url]

AieypSmini

hollywood casino online facebook <a href=«https://onlinecasinozonee.com/»>casino slots</a> online casino gambling [url=https://onlinecasinozonee.com/]winstar world casino[/url]

AzmmaSmini

seneca casino online games <a href=«https://online-casinoss.us.org/»>virgin casino online nj</a> muckleshoot casino [url=https://online-casinoss.us.org/]soaring eagle casino[/url]

m7gadnzr

how to win at craps — [url=https://crapscas.com/]craps game[/url]
free crap game <a href=» https://crapscas.com/ «>craps strategy</a>
https://crapscas.com/

AqglnSmini

double down casino <a href=«https://onlinecasinoqr.com/»>choctaw casino durant oklahoma</a> turning stone casino [url=https://onlinecasinoqr.com/]casino blackjack[/url]

taejhdaz

free roulette spin — [url=https://roulettecas.com/]roulette free[/url]
roulette online <a href=» https://roulettecas.com/ «>online roulette</a>
https://roulettecas.com/

AzuhsSmini

rich casino <a href=«https://ausonlinecasino.com/»>aol games casino</a> star casino [url=https://ausonlinecasino.com/]joe fortune casino[/url]

AuecjSmini

casinos in iowa <a href=«https://onlinecasino-games.us.org/»>online casino</a> slots casino games [url=https://onlinecasino-games.us.org/]casino slot[/url]

AadnhSmini

vegas casino online <a href=«https://casinorealmoneyy.com/»>mgm online casino</a> paradise casino [url=https://casinorealmoneyy.com/]huuuge casino slots[/url]

AypolSmini

doubledown casino <a href=«https://onlinecasinovus.com/»>online casino gambling</a> huge casino slots [url=https://onlinecasinovus.com/]seneca niagara casino[/url]

urmwvskr

free poker no limit hold’emaol — [url=https://freepokercasno.com/]all free poker games[/url]
las vegas free poker games <a href=» https://freepokercasno.com/ «>wsop free poker</a>
https://freepokercasno.com/

AqtliSmini

gossip online casino <a href=«https://casinorealmoney2018.us.org/»>online casinos for us players</a> mgm online casino [url=https://casinorealmoney2018.us.org/]empire city casino online[/url]

슈퍼카지노

https://aticpay.com/super/ — 슈퍼카지노

우리카지노

https://aticpay.com/woori/ — 우리카지노

퍼스트카지노

https://aticpay.com/first/ — 퍼스트카지노

예스카지노

https://aticpay.com/yescasino/ — 예스카지노

YES카지노

https://aticpay.com/yes/ — YES카지노

오바마카지노

https://aticpay.com/obama/ — 오바마카지노

슈퍼카지노

https://pauio.com/super/ — 슈퍼카지노

우리카지노

https://pauio.com/woori/ — 우리카지노

퍼스트카지노

https://pauio.com/first/ — 퍼스트카지노

예스카지노

https://pauio.com/yesci/ — 예스카지노

YES카지노

https://pauio.com/yeska/ — YES카지노

오바마카지노

https://pauio.com/obamas/ — 오바마카지노

슈퍼카지노

https://custory.com/super/ — 슈퍼카지노

우리카지노

https://custory.com/woori/ — 우리카지노

퍼스트카지노

https://custory.com/first/ — 퍼스트카지노

예스카지노

https://custory.com/yes/ — 예스카지노

YES카지노

https://custory.com/yescasino/ — YES카지노

오바마카지노

https://custory.com/obama/ — 오바마카지노

슈퍼카지노

https://dancesweb.com/ — 슈퍼카지노

우리카지노

https://dancesweb.com/woori/ — 우리카지노

퍼스트카지노

https://dancesweb.com/first/ — 퍼스트카지노

예스카지노

https://dancesweb.com/yesca/ — 예스카지노

YES카지노

https://dancesweb.com/yesno/ — YES카지노

오바마카지노

https://dancesweb.com/obama/ — 오바마카지노

슈퍼카지노

https://stylebet77.com/ — 슈퍼카지노

우리카지노

https://stylebet77.com/ — 우리카지노

퍼스트카지노

https://stylebet77.com/ — 퍼스트카지노

Ваш комментарий
адрес не будет опубликован

ХТМЛ не работает

Ctrl + Enter
Популярное