] ; | ] ; | ||||
$i = 0 ; | $i = 0 ; | ||||
foreach ($users as $user) { | foreach ($users as $user) { | ||||
$paramsTemplate['user'] =$user; | |||||
if(!isset($packageMessagesArray[$i])) { | if(!isset($packageMessagesArray[$i])) { | ||||
$packageMessagesArray[$i] = [] ; | $packageMessagesArray[$i] = [] ; | ||||
} | } | ||||
public function getNewsletter() | public function getNewsletter() | ||||
{ | { | ||||
$newsletter = $this->merchantUtils->getMerchantCurrent()->getNewsletter() ; | $newsletter = $this->merchantUtils->getMerchantCurrent()->getNewsletter() ; | ||||
if($newsletter) { | if($newsletter) { | ||||
return $newsletter ; | return $newsletter ; | ||||
} | } |
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; | |||||
} | |||||
} | } |
{ | { | ||||
addressType: null, | addressType: null, | ||||
currentSection:'general', | currentSection:'general', | ||||
isOpenFullTime: false, | |||||
sectionsArray: [ | sectionsArray: [ | ||||
{ | { | ||||
name: 'general', | name: 'general', | ||||
nameDisplay: 'Maintenance' | nameDisplay: 'Maintenance' | ||||
} | } | ||||
] | ] | ||||
}, window.addressValues); | |||||
}, window.addressValues, window.merchantPanelOrderValues); | |||||
}, | }, | ||||
mounted: function () {}, | mounted: function () {}, | ||||
methods: { | methods: { |
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 | ||||
editStockNoQuantityDefault: "Le stock n'a pas été modifié pour le produit #%id% (Aucune quantité par défaut)" | editStockNoQuantityDefault: "Le stock n'a pas été modifié pour le produit #%id% (Aucune quantité par défaut)" | ||||
field: | field: | ||||
default: | default: | ||||
unit: Unité | |||||
placeholder: Choisissez une option | placeholder: Choisissez une option | ||||
deliveryPointSale: Lieu de livraison | deliveryPointSale: Lieu de livraison | ||||
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> | ||||
success: Succès (vert) | success: Succès (vert) | ||||
warningMessage: Contenu du message d'avertissement | warningMessage: Contenu du message d'avertissement | ||||
newsletters: Newsletters | newsletters: Newsletters | ||||
deliveryDepositoryOnly: Retrait au dépot uniquement | |||||
isPublic: Publique | isPublic: Publique | ||||
isDepository: Dépôt | isDepository: Dépôt | ||||
productCategories: Catégories | productCategories: Catégories |
<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 %} |
<span class="glyphicon glyphicon-triangle-bottom"></span> | <span class="glyphicon glyphicon-triangle-bottom"></span> | ||||
<i class="fa fa-exclamation-circle invalid-form"></i> | <i class="fa fa-exclamation-circle invalid-form"></i> | ||||
</button> | </button> | ||||
</li> | </li> | ||||
</ul> | </ul> | ||||
</div> | </div> |
<div class="row"> | <div class="row"> | ||||
<div class="col-8"> | <div class="col-8"> | ||||
{{ macros.card_start('Merchant.delivery','light') }} | {{ macros.card_start('Merchant.delivery','light') }} | ||||
{% if form.merchantConfigs['delivery-depository-only'] is defined %} | |||||
<div class="col-12"> | |||||
{{ form_row(form.merchantConfigs['delivery-depository-only']) }} | |||||
</div> | |||||
{% endif %} | |||||
{% if form.merchantConfigs['image-zones'] is defined %} | {% if form.merchantConfigs['image-zones'] is defined %} | ||||
<div class="col-12"> | <div class="col-12"> | ||||
{{ form_row(form.merchantConfigs['image-zones']) }} | {{ form_row(form.merchantConfigs['image-zones']) }} |
<div class="col-12"> | <div class="col-12"> | ||||
{{ form_row(form.merchantConfigs['email-contact']) }} | {{ form_row(form.merchantConfigs['email-contact']) }} | ||||
</div> | </div> | ||||
{% if form.merchantConfigs['email-from-purchase-order'] is defined %} | |||||
<div class="col-12"> | <div class="col-12"> | ||||
{{ form_row(form.merchantConfigs['email-from-purchase-order']) }} | {{ form_row(form.merchantConfigs['email-from-purchase-order']) }} | ||||
</div> | </div> | ||||
{% endif %} | |||||
{% if form.merchantConfigs['purchase-order-email-content'] is defined %} | {% if form.merchantConfigs['purchase-order-email-content'] is defined %} | ||||
<div class="col-12"> | <div class="col-12"> | ||||
{{ form_row(form.merchantConfigs['purchase-order-email-content']) }} | {{ form_row(form.merchantConfigs['purchase-order-email-content']) }} |
{% import '@LcShop/backend/default/block/macros.html.twig' as macros %} | {% import '@LcShop/backend/default/block/macros.html.twig' as macros %} | ||||
<script> | |||||
window.merchantPanelOrderValues = { | |||||
{% if form.merchantConfigs['is-open-full-time'] is defined %}isOpenFullTime: {{ form.merchantConfigs['is-open-full-time'].vars.data.value }}{% endif %} | |||||
}; | |||||
</script> | |||||
<div class="row"> | <div class="row"> | ||||
<div class="col-8"> | <div class="col-8"> | ||||
{{ macros.card_start('Merchant.order','light') }} | {{ macros.card_start('Merchant.order','light') }} | ||||
<div class="col-6"> | <div class="col-6"> | ||||
{{ form_row(form.merchantConfigs['maximum-order-week']) }} | {{ form_row(form.merchantConfigs['maximum-order-week']) }} | ||||
</div> | </div> | ||||
<div class="col-6"> | |||||
{% if form.merchantConfigs['is-open-full-time'] is defined %} | |||||
<div class="col-12"> | |||||
{% for field in form.merchantConfigs['is-open-full-time'] %} | |||||
{% if field.vars.name == 'value' %} | |||||
{{ form_row(field, {'attr': {"v-model" : 'isOpenFullTime'}}) }} | |||||
{% else %} | |||||
{{ form_row(field) }} | |||||
{% endif %} | |||||
{% endfor %} | |||||
</div> | |||||
{% endif %} | |||||
{% if form.merchantConfigs['message-site-opening-background'] is defined %} | |||||
<div v-show="isOpenFullTime == true" class="col-6"> | |||||
{{ form_row(form.merchantConfigs['message-site-opening-background']) }} | |||||
</div> | |||||
{% endif %} | |||||
{% if form.merchantConfigs['message-site-opening'] is defined %} | |||||
<div v-show="isOpenFullTime == true" class="col-6"> | |||||
{{ form_row(form.merchantConfigs['message-site-opening']) }} | |||||
</div> | |||||
{% endif %} | |||||
<div v-show="isOpenFullTime == false" class="col-6"> | |||||
{{ form_row(form.merchantConfigs['order-open-day']) }} | {{ form_row(form.merchantConfigs['order-open-day']) }} | ||||
</div> | </div> | ||||
<div class="col-6"> | |||||
<div v-show="isOpenFullTime == false" class="col-6"> | |||||
{{ form_row(form.merchantConfigs['order-open-time']) }} | {{ form_row(form.merchantConfigs['order-open-time']) }} | ||||
</div> | </div> | ||||
{% if form.merchantConfigs['order-open-day-vip'] is defined %} | {% if form.merchantConfigs['order-open-day-vip'] is defined %} | ||||
<div class="col-6"> | |||||
<div v-show="isOpenFullTime == false" class="col-6"> | |||||
{{ form_row(form.merchantConfigs['order-open-day-vip']) }} | {{ form_row(form.merchantConfigs['order-open-day-vip']) }} | ||||
</div> | </div> | ||||
{% endif %} | {% endif %} | ||||
{% if form.merchantConfigs['order-open-time-vip'] is defined %} | {% if form.merchantConfigs['order-open-time-vip'] is defined %} | ||||
<div class="col-6"> | |||||
<div v-show="isOpenFullTime == false" class="col-6"> | |||||
{{ form_row(form.merchantConfigs['order-open-time-vip']) }} | {{ form_row(form.merchantConfigs['order-open-time-vip']) }} | ||||
</div> | </div> | ||||
{% endif %} | {% endif %} | ||||
<div class="col-6"> | |||||
<div v-show="isOpenFullTime == false" class="col-6"> | |||||
{{ form_row(form.merchantConfigs['order-close-day']) }} | {{ form_row(form.merchantConfigs['order-close-day']) }} | ||||
</div> | </div> | ||||
<div class="col-6"> | |||||
<div v-show="isOpenFullTime == false" class="col-6"> | |||||
{{ form_row(form.merchantConfigs['order-close-time']) }} | {{ form_row(form.merchantConfigs['order-close-time']) }} | ||||
</div> | </div> | ||||
<div class="col-6"> | |||||
<div v-show="isOpenFullTime == false" class="col-6"> | |||||
{{ form_row(form.dateBeginHoliday) }} | {{ form_row(form.dateBeginHoliday) }} | ||||
</div> | </div> | ||||
<div class="col-6"> | |||||
<div v-show="isOpenFullTime == false" class="col-6"> | |||||
{{ form_row(form.dateEndHoliday) }} | {{ form_row(form.dateEndHoliday) }} | ||||
</div> | </div> | ||||
{{ macros.card_end() }} | {{ macros.card_end() }} |
<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 isProductSaleStatusOn(Product $product) | |||||
{ | |||||
if($product->getProductFamily()->getSaleStatus()!=1) { | |||||
return false ; | |||||
} | |||||
$allCategoriesSalesOff = true; | |||||
foreach ($product->getProductFamily()->getProductCategories() as $category){ | |||||
if($category->getParent()) { | |||||
if($category->getSaleStatus() && $category->getParent()->getSaleStatus()) | |||||
$allCategoriesSalesOff = false; | |||||
} | |||||
else { | |||||
if($category->getSaleStatus()) $allCategoriesSalesOff = false; | |||||
} | |||||
} | |||||
if($allCategoriesSalesOff) return false; | |||||
return true ; | |||||
} | |||||
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 || !$this->isProductSaleStatusOn($product)) { | |||||
return false; | return false; | ||||
} | } | ||||
]); | ]); | ||||
} | } | ||||
public function urlEncryptData($datas){ | |||||
$key = 'secretToken'; | |||||
foreach ($datas as $data) { | |||||
$key .= $data; | |||||
} | |||||
return md5($key); | |||||
} | |||||
} | } |