// sauvegarde de la commande | // sauvegarde de la commande | ||||
$order->save(); | $order->save(); | ||||
$order->initReference() ; | |||||
$order->changeOrderStatus('new-order', 'user'); | $order->changeOrderStatus('new-order', 'user'); | ||||
// ajout de l'utilisateur à l'établissement | // ajout de l'utilisateur à l'établissement | ||||
} | } | ||||
$order->setTillerSynchronization() ; | $order->setTillerSynchronization() ; | ||||
$order->initReference() ; | |||||
} | } | ||||
use common\helpers\GlobalParam; | use common\helpers\GlobalParam; | ||||
use common\models\Producer; | use common\models\Producer; | ||||
use common\models\ProductCategory; | |||||
class SiteController extends ProducerBaseController | class SiteController extends ProducerBaseController | ||||
{ | { | ||||
]); | ]); | ||||
// produits | // produits | ||||
$categoriesArray = ProductCategory::searchAll([], ['orderby' => 'product_category.position ASC']) ; | |||||
$dataProviderProductsByCategories = [] ; | |||||
foreach($categoriesArray as $category) { | |||||
$dataProviderProductsByCategories[$category->id] = new ActiveDataProvider([ | |||||
'query' => Product::find() | |||||
->andWhere([ | |||||
'id_producer' => $this->getProducer()->id, | |||||
'active' => true, | |||||
]) | |||||
->andWhere('product.id_product_category = :id_product_category') | |||||
->params([':id_product_category' => $category->id]) | |||||
->orderBy('order ASC'), | |||||
'pagination' => [ | |||||
'pageSize' => 500, | |||||
], | |||||
'sort' => false, | |||||
]); | |||||
} | |||||
$queryProducts = Product::find() | $queryProducts = Product::find() | ||||
->andWhere([ | ->andWhere([ | ||||
'id_producer' => $this->getProducer()->id, | 'id_producer' => $this->getProducer()->id, | ||||
'active' => true | |||||
'active' => true, | |||||
]) | ]) | ||||
->orderBy('order ASC') ; | ->orderBy('order ASC') ; | ||||
$dataProviderProducts = new ActiveDataProvider([ | $dataProviderProducts = new ActiveDataProvider([ | ||||
'query' => $queryProducts, | 'query' => $queryProducts, | ||||
'pagination' => [ | 'pagination' => [ | ||||
'pageSize' => 50, | |||||
'pageSize' => 500, | |||||
], | ], | ||||
'sort' => false, | 'sort' => false, | ||||
]); | ]); | ||||
} | } | ||||
return $this->render('index', [ | return $this->render('index', [ | ||||
'dataProviderProductsByCategories' => $dataProviderProductsByCategories, | |||||
'dataProviderPointsSale' => $dataProviderPointsSale, | 'dataProviderPointsSale' => $dataProviderPointsSale, | ||||
'dataProviderProducts' => $dataProviderProducts, | 'dataProviderProducts' => $dataProviderProducts, | ||||
'hasProductPhoto' => $hasProductPhoto, | 'hasProductPhoto' => $hasProductPhoto, | ||||
'hasProductWeight' => $hasProductWeight | |||||
'hasProductWeight' => $hasProductWeight, | |||||
'categories' => $categoriesArray, | |||||
]); | ]); | ||||
} | } | ||||
<div class="row"> | <div class="row"> | ||||
<div class="col-md-6"> | <div class="col-md-6"> | ||||
<ul> | <ul> | ||||
<?php if($order->reference && strlen($order->reference) > 0): ?><li><span class="glyphicon glyphicon-check"></span> Commande N°<strong><?= Html::encode($order->reference); ?></strong></li><?php endif; ?> | |||||
<li><span class="glyphicon glyphicon-time"></span>Le <?= date('d/m/Y',strtotime($order->distribution->date)) ?></li> | <li><span class="glyphicon glyphicon-time"></span>Le <?= date('d/m/Y',strtotime($order->distribution->date)) ?></li> | ||||
<li><span class="glyphicon glyphicon-map-marker"></span><?= Html::encode($order->pointSale->name) ?><?php if(strlen($order->pointSale->name)): ?> | <li><span class="glyphicon glyphicon-map-marker"></span><?= Html::encode($order->pointSale->name) ?><?php if(strlen($order->pointSale->name)): ?> | ||||
<br /> <span class="locality">à <?= Html::encode($order->pointSale->locality) ?></span><?php endif; ?></li> | <br /> <span class="locality">à <?= Html::encode($order->pointSale->locality) ?></span><?php endif; ?></li> |
return '' ; | return '' ; | ||||
} | } | ||||
] ; | ] ; | ||||
?> | ?> | ||||
<?= GridView::widget([ | |||||
'dataProvider' => $dataProviderProducts, | |||||
'summary' => '', | |||||
'columns' => $columnsProducts | |||||
]); ?> | |||||
<?= GridView::widget([ | |||||
'dataProvider' => $dataProviderProducts, | |||||
'summary' => '', | |||||
'columns' => $columnsProducts | |||||
]); ?> | |||||
<?php foreach($categories as $category): ?> | |||||
<h4><?= Html::encode($category->name) ?></h4> | |||||
<?= GridView::widget([ | |||||
'dataProvider' => $dataProviderProductsByCategories[$category->id], | |||||
'summary' => '', | |||||
'columns' => $columnsProducts | |||||
]); ?> | |||||
<?php endforeach; ?> | |||||
</section> | </section> |
.site-index #points-sale .days small { | .site-index #points-sale .days small { | ||||
color: gray; | color: gray; | ||||
} | } | ||||
/* line 75, ../sass/site/_index.scss */ | |||||
/* line 76, ../sass/site/_index.scss */ | |||||
.site-index #products h4 { | |||||
font-family: "highvoltageregular"; | |||||
font-size: 22px; | |||||
line-height: 30px; | |||||
padding-top: 13px; | |||||
text-transform: uppercase !important; | |||||
} | |||||
/* line 84, ../sass/site/_index.scss */ | |||||
.site-index #products td.photo { | .site-index #products td.photo { | ||||
width: 100px; | width: 100px; | ||||
} | } | ||||
/* line 77, ../sass/site/_index.scss */ | |||||
/* line 86, ../sass/site/_index.scss */ | |||||
.site-index #products td.photo img.photo-product { | .site-index #products td.photo img.photo-product { | ||||
width: 120px; | width: 120px; | ||||
height: auto; | height: auto; | ||||
} | } | ||||
/* line 83, ../sass/site/_index.scss */ | |||||
/* line 92, ../sass/site/_index.scss */ | |||||
.site-index #products .name { | .site-index #products .name { | ||||
color: #333; | color: #333; | ||||
} | } | ||||
/* line 85, ../sass/site/_index.scss */ | |||||
/* line 94, ../sass/site/_index.scss */ | |||||
.site-index #products .name .the-name { | .site-index #products .name .the-name { | ||||
font-family: "capsuularegular"; | font-family: "capsuularegular"; | ||||
font-size: 20px; | font-size: 20px; |
} | } | ||||
#products { | #products { | ||||
h4 { | |||||
font-family: "highvoltageregular" ; | |||||
font-size: 22px ; | |||||
line-height: 30px ; | |||||
padding-top: 13px ; | |||||
text-transform: uppercase !important ; | |||||
} | |||||
td.photo { | td.photo { | ||||
width: 100px ; | width: 100px ; | ||||
img.photo-product { | img.photo-product { |