use Lc\ShopBundle\Context\FilterMerchantInterface; | use Lc\ShopBundle\Context\FilterMerchantInterface; | ||||
use Lc\ShopBundle\Context\FilterMultipleMerchantsInterface; | use Lc\ShopBundle\Context\FilterMultipleMerchantsInterface; | ||||
use Lc\ShopBundle\Context\ProductFamilyInterface; | |||||
use Lc\ShopBundle\Context\StatusInterface; | use Lc\ShopBundle\Context\StatusInterface; | ||||
use Symfony\Component\DependencyInjection\Container; | use Symfony\Component\DependencyInjection\Container; | ||||
use Symfony\Component\EventDispatcher\EventSubscriberInterface; | use Symfony\Component\EventDispatcher\EventSubscriberInterface; | ||||
}else {*/ | }else {*/ | ||||
if ($entityObject instanceof ProductFamilyInterface) { | |||||
$paginator->nbResultsOnSale = $entityRepo->count(array('saleStatus' =>1, 'status'=> 1, 'merchant'=> $criteria['merchant'])); | |||||
} | |||||
if ($entityObject instanceof StatusInterface) { | if ($entityObject instanceof StatusInterface) { | ||||
for ($status = -1; $status <= 1; $status++) { | for ($status = -1; $status <= 1; $status++) { |
*/ | */ | ||||
protected $productFamilies; | protected $productFamilies; | ||||
/** | |||||
* @ORM\Column(type="boolean") | |||||
*/ | |||||
protected $saleStatus; | |||||
public function __construct() | public function __construct() | ||||
{ | { | ||||
$this->childrens = new ArrayCollection(); | $this->childrens = new ArrayCollection(); | ||||
return $this; | return $this; | ||||
} | } | ||||
public function getSaleStatus(): ?bool | |||||
{ | |||||
return $this->saleStatus; | |||||
} | |||||
public function setSaleStatus(bool $saleStatus): self | |||||
{ | |||||
$this->saleStatus = $saleStatus; | |||||
return $this; | |||||
} | |||||
} | } |
protected $behaviorPrice; | protected $behaviorPrice; | ||||
/** | |||||
* @ORM\Column(type="boolean") | |||||
*/ | |||||
protected $saleStatus; | |||||
public function __construct() | public function __construct() | ||||
{ | { | ||||
$this->productCategories = new ArrayCollection(); | $this->productCategories = new ArrayCollection(); | ||||
return false ; | return false ; | ||||
} | } | ||||
public function getSaleStatus(): ?bool | |||||
{ | |||||
return $this->saleStatus; | |||||
} | |||||
public function setSaleStatus(bool $saleStatus): self | |||||
{ | |||||
$this->saleStatus = $saleStatus; | |||||
return $this; | |||||
} | |||||
} | } |
nbResultsFiltered: Total d'élements filtrés | nbResultsFiltered: Total d'élements filtrés | ||||
nbResultsOnline: Total d'élements en ligne | nbResultsOnline: Total d'élements en ligne | ||||
nbResultsOffline: Total d'élements hors ligne | nbResultsOffline: Total d'élements hors ligne | ||||
nbResultsDeleted: Total d'élements supprimé | |||||
nbResultsDeleted: Total d'élements supprimés | |||||
nbResultsOnSale: Total de produits en vente | |||||
nbProductFamilyOnline: Total de produits visibles | |||||
listChildren: Afficher les enfants | listChildren: Afficher les enfants | ||||
edit: Éditer | edit: Éditer | ||||
delete: Supprimer | delete: Supprimer | ||||
deliveryAvailabilty: Créneau de livraison | deliveryAvailabilty: Créneau de livraison | ||||
id: Id | id: Id | ||||
status: Statut | status: Statut | ||||
saleStatus: En vente sur le site | |||||
statusOptions: | statusOptions: | ||||
offline: <span class="badge badge-danger">Hors ligne</span> | offline: <span class="badge badge-danger">Hors ligne</span> | ||||
online: <span class="badge badge-success">En ligne</span> | online: <span class="badge badge-success">En ligne</span> |
<i class="fa fa-check"></i> </span>{% endif %} | <i class="fa fa-check"></i> </span>{% endif %} | ||||
{% if paginator.nbResultsOffline is defined %}<span data-toggle="tooltip" | {% if paginator.nbResultsOffline is defined %}<span data-toggle="tooltip" | ||||
title="{{ "list.nbResultsOffline"|trans }}" | title="{{ "list.nbResultsOffline"|trans }}" | ||||
class="badge badge-warning">{{ paginator.nbResultsOffline }} | |||||
class="badge badge-danger">{{ paginator.nbResultsOffline }} | |||||
<i class="fa fa-pen"></i></span>{% endif %} | <i class="fa fa-pen"></i></span>{% endif %} | ||||
{% if is_granted('ROLE_SUPER_ADMIN') and paginator.nbResultsDeleted is defined %}<span | {% if is_granted('ROLE_SUPER_ADMIN') and paginator.nbResultsDeleted is defined %}<span | ||||
data-toggle="tooltip" title="{{ "list.nbResultsDeleted"|trans }}" | data-toggle="tooltip" title="{{ "list.nbResultsDeleted"|trans }}" | ||||
class="badge badge-danger">{{ paginator.nbResultsDeleted }} <i | |||||
class="badge badge-secondary">{{ paginator.nbResultsDeleted }} <i | |||||
class="fa fa-trash"></i> | class="fa fa-trash"></i> | ||||
</span>{% endif %} | </span>{% endif %} | ||||
{% endblock %} | {% endblock %} |
<div class="col-12"> | <div class="col-12"> | ||||
{{ form_row(form.status) }} | {{ form_row(form.status) }} | ||||
</div> | </div> | ||||
<div class="col-12"> | |||||
{{ form_row(form.saleStatus) }} | |||||
</div> | |||||
<div class="col-12"> | <div class="col-12"> | ||||
{{ form_row(form.supplier) }} | {{ form_row(form.supplier) }} | ||||
</div> | </div> |
public function isProductAvailable(Product $product, $quantityOrder = 0, $checkCart = false, $orderShop = null) | public function isProductAvailable(Product $product, $quantityOrder = 0, $checkCart = false, $orderShop = null) | ||||
{ | { | ||||
if ($product->getStatus() != 1 || $product->getProductFamily()->getStatus() != 1) { | |||||
if ($product->getStatus() != 1 || $product->getProductFamily()->getStatus() != 1 || $product->getProductFamily()->getSaleStatus()!=1) { | |||||
return false; | return false; | ||||
} | } | ||||
$allCategoriesSalesOff = true; | |||||
foreach ($product->getProductFamily()->getProductCategories() as $category){ | |||||
if($category->getSaleStatus())$allCategoriesSalesOff = false; | |||||
} | |||||
if($allCategoriesSalesOff)return false; | |||||
if (!$orderShop) { | if (!$orderShop) { | ||||
$orderShop = $this->getCartCurrent(); | $orderShop = $this->getCartCurrent(); | ||||
} | } |