diff --git a/app/Http/Controllers/Admin/Shop/ArticleController.php b/app/Http/Controllers/Admin/Shop/ArticleController.php
index 23318eaa..c228eaa7 100644
--- a/app/Http/Controllers/Admin/Shop/ArticleController.php
+++ b/app/Http/Controllers/Admin/Shop/ArticleController.php
@@ -101,5 +101,4 @@ class ArticleController extends Controller
$data = Articles::toggleHomepage($request->input('id'), ($request->input('homepage') == 'true') ? 1 : 0);
return response()->json(['error' => 0]);
}
-
}
diff --git a/app/Http/Controllers/Admin/Shop/ArticleNatureController.php b/app/Http/Controllers/Admin/Shop/ArticleNatureController.php
index 6007628a..4ff24bfe 100644
--- a/app/Http/Controllers/Admin/Shop/ArticleNatureController.php
+++ b/app/Http/Controllers/Admin/Shop/ArticleNatureController.php
@@ -41,4 +41,9 @@ class ArticleNatureController extends Controller
{
return ArticleNatures::destroy($id);
}
+
+ public static function getOptions($product_type)
+ {
+ return response()->json(['0' => ''] + ArticleNatures::getOptionsByProductType($product_type));
+ }
}
diff --git a/app/Http/Controllers/Admin/Shop/MerchandiseController.php b/app/Http/Controllers/Admin/Shop/MerchandiseController.php
index 0cda97b7..1bdd174e 100644
--- a/app/Http/Controllers/Admin/Shop/MerchandiseController.php
+++ b/app/Http/Controllers/Admin/Shop/MerchandiseController.php
@@ -9,8 +9,6 @@ use App\Repositories\Shop\Producers;
use App\Repositories\Shop\TagGroups;
use App\Datatables\Shop\MerchandisesDataTable;
-use App\Models\Shop\Merchandise;
-
class MerchandiseController extends Controller
{
public function index(MerchandisesDataTable $dataTable)
diff --git a/app/Models/Shop/ArticleNature.php b/app/Models/Shop/ArticleNature.php
index cb44600d..490ec75a 100644
--- a/app/Models/Shop/ArticleNature.php
+++ b/app/Models/Shop/ArticleNature.php
@@ -24,4 +24,19 @@ class ArticleNature extends Model
{
return $query->where($this->table . '.id', $id);
}
+
+ public function scopeByBotanic($query);
+ {
+ return $query->where($this->table . '.product_type', 1);
+ }
+
+ public function scopeByMerchandise($query);
+ {
+ return $query->where($this->table . '.product_type', 2);
+ }
+
+ public function scopeByProductType($query, $type)
+ {
+ return $query->where($this->table . '.product_type', $type);
+ }
}
diff --git a/app/Repositories/Shop/ArticleNatures.php b/app/Repositories/Shop/ArticleNatures.php
index b13f8d5a..08a5ae7b 100644
--- a/app/Repositories/Shop/ArticleNatures.php
+++ b/app/Repositories/Shop/ArticleNatures.php
@@ -11,6 +11,21 @@ class ArticleNatures
return ArticleNature::get()->pluck('name', 'id')->toArray();
}
+ public static function getOptionsByMerchandise()
+ {
+ return self::getOptionsByProductType(2);
+ }
+
+ public static function getOptionsByBotanic()
+ {
+ return self::getOptionsByProductType(1);
+ }
+
+ public static function getOptionsByProductType($type)
+ {
+ return ArticleNature::byProductType($type)->get()->pluck('name', 'id')->toArray();
+ }
+
public static function getAll()
{
return ArticleNature::orderBy('name', 'asc')->get();
diff --git a/build/css/site.css b/build/css/site.css
index 8e70b88d..e1f0729b 100644
--- a/build/css/site.css
+++ b/build/css/site.css
@@ -108,16 +108,13 @@ a.nav-link {
background-color: #f3f8f1;
}
-.green {
- color: #517C39;
-}
-
-a.green {
+.green, a.green {
color: #517C39 !important;
}
.green-dark, a.green-dark {
color: #335012;
+ text-decoration: none;
}
a.green-dark:hover {
diff --git a/resources/views/Admin/Shop/Articles/partials/characteristics.blade.php b/resources/views/Admin/Shop/Articles/partials/characteristics.blade.php
index 1a35f812..f8838499 100644
--- a/resources/views/Admin/Shop/Articles/partials/characteristics.blade.php
+++ b/resources/views/Admin/Shop/Articles/partials/characteristics.blade.php
@@ -39,6 +39,7 @@
{{ Form::label('article_nature_id', __('shop.article_natures.name')) }}
@include('components.form.select', [
'name' => 'article_nature_id',
+ 'id_name' => 'article_nature_id',
'list' => $natures_options,
'value' => $article['article_nature_id'] ?? null,
'class' => 'select2',
@@ -155,12 +156,15 @@
switch (product_type) {
case 'App\\Models\\Botanic\\Specie':
var url = '{{ route('Admin.Botanic.Species.getSelect') }}';
+ var product_type = 1;
break;
case 'App\\Models\\Botanic\\Variety':
var url = '{{ route('Admin.Botanic.Varieties.getSelect') }}';
+ var product_type = 1;
break;
case 'App\\Models\\Shop\\Merchandise':
var url = '{{ route('Admin.Shop.Merchandises.getSelect') }}';
+ var product_type = 2;
break;
}
loadProducts(url);
diff --git a/resources/views/Shop/Baskets/basket.blade.php b/resources/views/Shop/Baskets/basket.blade.php
index 9d2fdd14..d83a6e9f 100644
--- a/resources/views/Shop/Baskets/basket.blade.php
+++ b/resources/views/Shop/Baskets/basket.blade.php
@@ -38,6 +38,13 @@
+ @else
+
Déja client ? @@ -39,11 +39,13 @@ {!! Form::close() !!}