From 46ad2a291724a0ccf01cfd3e383ce308729bf69a Mon Sep 17 00:00:00 2001 From: Ludovic CANDELLIER Date: Fri, 2 Apr 2021 17:00:22 +0200 Subject: [PATCH] Fixes --- .../Controllers/Shop/Admin/ArticleController.php | 5 ++++- app/Repositories/Shop/ArticlePrices.php | 3 +++ app/Repositories/Shop/Articles.php | 2 +- .../block_generic_price_new.blade.php | 4 +--- .../generic_prices/generic_prices.blade.php | 13 ++++++++----- .../partials/prices/block_price_new.blade.php | 2 +- resources/views/load/set_options.blade.php | 2 +- routes/Botanic/Admin/Families.php | 2 +- routes/Botanic/Admin/Genres.php | 2 +- routes/Botanic/Admin/Species.php | 2 +- routes/Botanic/Admin/Varieties.php | 2 +- routes/Shop/Admin/ArticleAttributes.php | 4 ---- routes/Shop/Admin/ArticleFamilies.php | 2 +- routes/Shop/Admin/Articles.php | 2 +- routes/Shop/Admin/Categories.php | 2 +- routes/Shop/Admin/Customers.php | 2 +- routes/Shop/Admin/PriceGenerics.php | 2 +- routes/Shop/Admin/TagGroups.php | 2 +- routes/Shop/Admin/Tags.php | 2 +- 19 files changed, 30 insertions(+), 27 deletions(-) delete mode 100644 routes/Shop/Admin/ArticleAttributes.php diff --git a/app/Http/Controllers/Shop/Admin/ArticleController.php b/app/Http/Controllers/Shop/Admin/ArticleController.php index 4926dd87..4c9cb55b 100644 --- a/app/Http/Controllers/Shop/Admin/ArticleController.php +++ b/app/Http/Controllers/Shop/Admin/ArticleController.php @@ -28,7 +28,10 @@ class ArticleController extends Controller public function store(Request $request) { - Articles::storeFull($request->all()); + $data = $request->all(); + dump($data); + exit; + Articles::storeFull($data); return redirect()->route('Shop.Admin.Articles.index'); } diff --git a/app/Repositories/Shop/ArticlePrices.php b/app/Repositories/Shop/ArticlePrices.php index 1c3b6d02..aac3f414 100644 --- a/app/Repositories/Shop/ArticlePrices.php +++ b/app/Repositories/Shop/ArticlePrices.php @@ -41,6 +41,9 @@ class ArticlePrices public static function storePrices($article_id, $prices) { + dump($article_id); + dump($prices); + exit; if ($prices) { foreach ($prices as $key => $price) { $price['article_attribute']['article_attribute_value_id'] = $price['attribute']['attribute_value_id']; diff --git a/app/Repositories/Shop/Articles.php b/app/Repositories/Shop/Articles.php index 5eeda1c1..6bd97dd5 100644 --- a/app/Repositories/Shop/Articles.php +++ b/app/Repositories/Shop/Articles.php @@ -39,7 +39,7 @@ class Articles public static function getMeta(&$data = []) { - $data['products'] = ($data['product_type'] == 'App\Models\Botanic\Variety') ? Varieties::getOptionsWithSpecie() : Species::getOptions(); + $data['products'] = ( ($data['product_type'] ?? false) == 'App\Models\Botanic\Variety') ? Varieties::getOptionsWithSpecie() : Species::getOptions(); $data['categories_options'] = Categories::getOptions(); $data['price_generics'] = PriceGenericCategories::getOptionsWithChildrens(); $data['families_options'] = ArticleFamilies::getOptions(); diff --git a/resources/views/Shop/Admin/Articles/partials/generic_prices/block_generic_price_new.blade.php b/resources/views/Shop/Admin/Articles/partials/generic_prices/block_generic_price_new.blade.php index 81906018..b04a8520 100644 --- a/resources/views/Shop/Admin/Articles/partials/generic_prices/block_generic_price_new.blade.php +++ b/resources/views/Shop/Admin/Articles/partials/generic_prices/block_generic_price_new.blade.php @@ -1,7 +1,5 @@
- - - + @include('Shop.Admin.PriceGenerics.partials.table-prices', ['generic' => $generic['generic'] ?? null ])
\ No newline at end of file diff --git a/resources/views/Shop/Admin/Articles/partials/generic_prices/generic_prices.blade.php b/resources/views/Shop/Admin/Articles/partials/generic_prices/generic_prices.blade.php index 210d73d5..412b9328 100644 --- a/resources/views/Shop/Admin/Articles/partials/generic_prices/generic_prices.blade.php +++ b/resources/views/Shop/Admin/Articles/partials/generic_prices/generic_prices.blade.php @@ -4,11 +4,14 @@ @include('Shop.Admin.Articles.partials.generic_prices.list-generic_prices') - - - -@include('components.select-tree', ['name' => "article_price_generic_id", 'value' => $price['article_price_generic_id'] ?? null, 'list' => $price_generics ?? null, 'required' => false, 'class' => 'form-control-sm w-100']) - +
+
+ @include('components.select-tree', ['name' => "article_price_generic_id", 'value' => $price['article_price_generic_id'] ?? null, 'list' => $price_generics ?? null, 'required' => false, 'class' => 'form-control-sm w-100']) +
+
+ +
+
@push('js')