$query->andWhere('pf.status = 1') ; | $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') ; | $query->addOrderBy('e.position', 'ASC') ; | ||||
return $query->getQuery()->getResult(); | return $query->getQuery()->getResult(); |
{ | { | ||||
name: 'maintenance', | name: 'maintenance', | ||||
nameDisplay: 'Maintenance' | nameDisplay: 'Maintenance' | ||||
}, | |||||
{ | |||||
name: 'lunch', | |||||
nameDisplay: 'Repas du midi' | |||||
} | } | ||||
] | ] | ||||
}, window.addressValues, window.merchantPanelOrderValues); | }, window.addressValues, window.merchantPanelOrderValues); |
email: Email | email: Email | ||||
delivery: Livraison | delivery: Livraison | ||||
maintenance: Maintenance | maintenance: Maintenance | ||||
lunch: Repas du midi | |||||
Address: | Address: | ||||
listLoopBesancon: Adresses de Besançon à spécifier (lat / long) | listLoopBesancon: Adresses de Besançon à spécifier (lat / long) | ||||
purchaseOrderEmailContent: "Contenu par défaut de l'email envoyé aux producteurs" | purchaseOrderEmailContent: "Contenu par défaut de l'email envoyé aux producteurs" | ||||
dateStart: Date de début | dateStart: Date de début | ||||
dateEnd: Date de fin | 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: | PointSale: | ||||
code: Code | code: Code | ||||
days: Par jour | days: Par jour | ||||
week: Par semaine | week: Par semaine | ||||
month: Par mois | month: Par mois | ||||
User: | |||||
isSaleAlwaysOpen: Commandes toujours ouvertes | |||||
action: | action: | ||||
apply: Appliquer | apply: Appliquer | ||||
new: Créer %entity_label% | new: Créer %entity_label% | ||||
logout: Me déconnecter | logout: Me déconnecter | ||||
address: Adresse utilisateur | address: Adresse utilisateur | ||||
switch: Prendre la main | switch: Prendre la main | ||||
order: | order: | ||||
addOrderProduct: Ajouter un produit | addOrderProduct: Ajouter un produit | ||||
addReductionCart: Ajouter une réduction | addReductionCart: Ajouter une réduction |
<div v-show="currentSection == 'maintenance'" class="panel panel-default"> | <div v-show="currentSection == 'maintenance'" class="panel panel-default"> | ||||
{% include '@LcShop/backend/merchant/panel_maintenance.html.twig' %} | {% include '@LcShop/backend/merchant/panel_maintenance.html.twig' %} | ||||
</div> | </div> | ||||
<div v-show="currentSection == 'lunch'" class="panel panel-default"> | |||||
{% include '@LcShop/backend/merchant/panel_lunch.html.twig' %} | |||||
</div> | |||||
</div> | </div> | ||||
</div> | </div> |
{% 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> |
} | } | ||||
$allCategoriesSalesOff = true; | $allCategoriesSalesOff = true; | ||||
$unavailableSpecificDay = false; | |||||
foreach ($product->getProductFamily()->getProductCategories() as $category){ | foreach ($product->getProductFamily()->getProductCategories() as $category){ | ||||
if($category->getParent()) { | if($category->getParent()) { | ||||
if($category->getSaleStatus() && $category->getParent()->getSaleStatus()) | if($category->getSaleStatus() && $category->getParent()->getSaleStatus()) | ||||
$allCategoriesSalesOff = false; | $allCategoriesSalesOff = false; | ||||
} | } | ||||
else { | 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 ; | return true ; | ||||
} | } |