public function getCurrentSection(){ | public function getCurrentSection(){ | ||||
return $this->get(SectionResolver::class)->getCurrent(); | return $this->get(SectionResolver::class)->getCurrent(); | ||||
} | } | ||||
public function getCurrentMerchant(){ | |||||
return $this->get(MerchantResolver::class)->getCurrent(); | |||||
} | |||||
} | } | ||||
return $this; | return $this; | ||||
} | } | ||||
public function setLeftJoin($entityName): self{ | |||||
$this->queryBuilderParameters['leftJoin'][] = $entityName; | |||||
return $this; | |||||
} | |||||
public function addOrderBy($field, $direction ='ASC') : self | public function addOrderBy($field, $direction ='ASC') : self | ||||
{ | { | ||||
} | } | ||||
} | } | ||||
if (isset($param['leftJoin'])) { | |||||
foreach ($param['leftJoin'] as $i=>$entityName) { | |||||
$qb->leftJoin('e.'.$entityName, $entityName)->addSelect($entityName); | |||||
} | |||||
} | |||||
/*if (isset($param['devAlias'])) { | /*if (isset($param['devAlias'])) { | ||||
$qb->andWhere('e.devAlias = :devAlias')->setParameter( | $qb->andWhere('e.devAlias = :devAlias')->setParameter( | ||||
'devAlias', | 'devAlias', |
{% set item = entity.instance %} | |||||
{% if item.unit == constant('App\\Entity\\Config\\Unit::UNIT_PERCENT') %} | |||||
{% set unit = '%' %} | |||||
{% elseif item.unit == constant('App\\Entity\\Config\\Unit::UNIT_AMOUNT') %} | |||||
{% set unit = '€' %} | |||||
{% endif %} | |||||
-{{ item.value }}{{ unit }} |
{{ item.availableQuantity - orderUtils.getReductionCartUsedQuantity(item) }} |
{% set item = entity.instance %} | |||||
{% set totalUsed = order_shop_container.store.getReductionCartUsedQuantity(item) %} | |||||
<span class="badge badge-success">{{ totalUsed }}</span> utilisé(s) | |||||
/ <span class="badge badge-primary">{{ item.availableQuantity - totalUsed }}</span> restante(s) |