@@ -364,6 +364,8 @@ class OrderController extends ProducerBaseController | |||
// sauvegarde de la commande | |||
$order->save(); | |||
$order->initReference() ; | |||
$order->changeOrderStatus('new-order', 'user'); | |||
// ajout de l'utilisateur à l'établissement | |||
@@ -507,7 +509,6 @@ class OrderController extends ProducerBaseController | |||
} | |||
$order->setTillerSynchronization() ; | |||
$order->initReference() ; | |||
} | |||
@@ -40,6 +40,7 @@ namespace producer\controllers; | |||
use common\helpers\GlobalParam; | |||
use common\models\Producer; | |||
use common\models\ProductCategory; | |||
class SiteController extends ProducerBaseController | |||
{ | |||
@@ -103,16 +104,36 @@ class SiteController extends ProducerBaseController | |||
]); | |||
// 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() | |||
->andWhere([ | |||
'id_producer' => $this->getProducer()->id, | |||
'active' => true | |||
'active' => true, | |||
]) | |||
->orderBy('order ASC') ; | |||
$dataProviderProducts = new ActiveDataProvider([ | |||
'query' => $queryProducts, | |||
'pagination' => [ | |||
'pageSize' => 50, | |||
'pageSize' => 500, | |||
], | |||
'sort' => false, | |||
]); | |||
@@ -132,10 +153,12 @@ class SiteController extends ProducerBaseController | |||
} | |||
return $this->render('index', [ | |||
'dataProviderProductsByCategories' => $dataProviderProductsByCategories, | |||
'dataProviderPointsSale' => $dataProviderPointsSale, | |||
'dataProviderProducts' => $dataProviderProducts, | |||
'hasProductPhoto' => $hasProductPhoto, | |||
'hasProductWeight' => $hasProductWeight | |||
'hasProductWeight' => $hasProductWeight, | |||
'categories' => $categoriesArray, | |||
]); | |||
} | |||
@@ -67,6 +67,7 @@ $producer = GlobalParam::getCurrentProducer() ; | |||
<div class="row"> | |||
<div class="col-md-6"> | |||
<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-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> |
@@ -192,12 +192,20 @@ $this->setPageTitle(Html::encode($producer->type.' à '.$producer->city)) ; | |||
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> |
@@ -643,20 +643,28 @@ termes. | |||
.site-index #points-sale .days small { | |||
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 { | |||
width: 100px; | |||
} | |||
/* line 77, ../sass/site/_index.scss */ | |||
/* line 86, ../sass/site/_index.scss */ | |||
.site-index #products td.photo img.photo-product { | |||
width: 120px; | |||
height: auto; | |||
} | |||
/* line 83, ../sass/site/_index.scss */ | |||
/* line 92, ../sass/site/_index.scss */ | |||
.site-index #products .name { | |||
color: #333; | |||
} | |||
/* line 85, ../sass/site/_index.scss */ | |||
/* line 94, ../sass/site/_index.scss */ | |||
.site-index #products .name .the-name { | |||
font-family: "capsuularegular"; | |||
font-size: 20px; |
@@ -72,6 +72,15 @@ termes. | |||
} | |||
#products { | |||
h4 { | |||
font-family: "highvoltageregular" ; | |||
font-size: 22px ; | |||
line-height: 30px ; | |||
padding-top: 13px ; | |||
text-transform: uppercase !important ; | |||
} | |||
td.photo { | |||
width: 100px ; | |||
img.photo-product { |