@@ -69,6 +69,9 @@ class ProductCategoryRepository extends BaseRepository implements DefaultReposit | |||
$query->andWhere('pf.status = 1') ; | |||
} | |||
$query->andWhere('e.displaySpecificDay IS NULL OR e.displaySpecificDay = :dayToday') ; | |||
$query->setParameter('dayToday', date('N')) ; | |||
$query->addOrderBy('e.position', 'ASC') ; | |||
return $query->getQuery()->getResult(); |
@@ -38,6 +38,10 @@ appOrder = new Vue({ | |||
{ | |||
name: 'maintenance', | |||
nameDisplay: 'Maintenance' | |||
}, | |||
{ | |||
name: 'lunch', | |||
nameDisplay: 'Repas du midi' | |||
} | |||
] | |||
}, window.addressValues, window.merchantPanelOrderValues); |
@@ -86,6 +86,7 @@ group: | |||
email: Email | |||
delivery: Livraison | |||
maintenance: Maintenance | |||
lunch: Repas du midi | |||
Address: | |||
listLoopBesancon: Adresses de Besançon à spécifier (lat / long) | |||
@@ -291,6 +292,11 @@ field: | |||
purchaseOrderEmailContent: "Contenu par défaut de l'email envoyé aux producteurs" | |||
dateStart: Date de début | |||
dateEnd: Date de fin | |||
messageLunchOpen: Message (section ouverte) | |||
messageLunchClosed: Message (section fermée) | |||
displaySpecificDay: Disponible un jour spécifique | |||
groupUsers: Groupes | |||
ticketTypesNotification: Catégorie ticket | |||
PointSale: | |||
code: Code | |||
@@ -493,7 +499,8 @@ field: | |||
days: Par jour | |||
week: Par semaine | |||
month: Par mois | |||
User: | |||
isSaleAlwaysOpen: Commandes toujours ouvertes | |||
action: | |||
apply: Appliquer | |||
new: Créer %entity_label% | |||
@@ -526,6 +533,7 @@ action: | |||
logout: Me déconnecter | |||
address: Adresse utilisateur | |||
switch: Prendre la main | |||
order: | |||
addOrderProduct: Ajouter un produit | |||
addReductionCart: Ajouter une réduction |
@@ -45,7 +45,9 @@ | |||
<div v-show="currentSection == 'maintenance'" class="panel panel-default"> | |||
{% include '@LcShop/backend/merchant/panel_maintenance.html.twig' %} | |||
</div> | |||
<div v-show="currentSection == 'lunch'" class="panel panel-default"> | |||
{% include '@LcShop/backend/merchant/panel_lunch.html.twig' %} | |||
</div> | |||
</div> | |||
</div> |
@@ -0,0 +1,18 @@ | |||
{% import '@LcShop/backend/default/block/macros.html.twig' as macros %} | |||
<div class="row"> | |||
<div class="col-8"> | |||
{{ macros.card_start('Merchant.lunch','light') }} | |||
{% if form.merchantConfigs['message-lunch-open'] is defined %} | |||
<div class="col-12"> | |||
{{ form_row(form.merchantConfigs['message-lunch-open']) }} | |||
</div> | |||
{% endif %} | |||
{% if form.merchantConfigs['message-lunch-closed'] is defined %} | |||
<div class="col-12"> | |||
{{ form_row(form.merchantConfigs['message-lunch-closed']) }} | |||
</div> | |||
{% endif %} | |||
{{ macros.card_end() }} | |||
</div> | |||
</div> |
@@ -65,16 +65,33 @@ trait OrderUtilsStockTrait | |||
} | |||
$allCategoriesSalesOff = true; | |||
$unavailableSpecificDay = false; | |||
foreach ($product->getProductFamily()->getProductCategories() as $category){ | |||
if($category->getParent()) { | |||
if($category->getSaleStatus() && $category->getParent()->getSaleStatus()) | |||
$allCategoriesSalesOff = false; | |||
} | |||
else { | |||
if($category->getSaleStatus()) $allCategoriesSalesOff = false; | |||
if($category->getSaleStatus()) { | |||
$allCategoriesSalesOff = false; | |||
} | |||
} | |||
// specific day | |||
$displaySpecificDay = $category->getDisplaySpecificDay() ; | |||
if($displaySpecificDay && $displaySpecificDay != date('N')) { | |||
$unavailableSpecificDay = true; | |||
} | |||
} | |||
if($allCategoriesSalesOff) { | |||
return false; | |||
} | |||
if($unavailableSpecificDay) { | |||
return false; | |||
} | |||
if($allCategoriesSalesOff) return false; | |||
return true ; | |||
} |