From e7e87f5dd9ecf60ed31a62924f69708865753dc0 Mon Sep 17 00:00:00 2001 From: soufiane Date: Wed, 5 Jul 2023 17:33:17 +0200 Subject: [PATCH] done #6105 @0:30 --- .../Controllers/Admin/ProductBaseController.php | 2 +- app/Models/Client.php | 13 +++++++++---- app/SubForms/Address.php | 12 ++++++------ 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/app/Http/Controllers/Admin/ProductBaseController.php b/app/Http/Controllers/Admin/ProductBaseController.php index e6d15fc..5820f8a 100644 --- a/app/Http/Controllers/Admin/ProductBaseController.php +++ b/app/Http/Controllers/Admin/ProductBaseController.php @@ -126,7 +126,7 @@ class ProductBaseController extends CubistMagicController { foreach ($specifications as $product => $specification) { $data[$product]['json'] = json_encode($specification); } - + $product = Product::find($id); if($product) { $changes = $this->storeAndReturnChanges($data); diff --git a/app/Models/Client.php b/app/Models/Client.php index f5a186c..577d9c0 100644 --- a/app/Models/Client.php +++ b/app/Models/Client.php @@ -71,7 +71,7 @@ class Client extends CubistMagicAbstractModel 'label' => 'Adresse', 'type' => 'BunchOfFieldsMultiple', 'bunch' => 'App\SubForms\Address', - 'column' => true, + 'column' => false, 'tab' => 'Informations client', 'edit_label' => 'Éditer « %city »' ]); @@ -96,9 +96,8 @@ class Client extends CubistMagicAbstractModel $this->addField([ 'name' => 'remember_token', 'label' => 'remember_token', - 'type' => 'Text', - 'column' => true, - 'tab' => 'Informations client' + 'type' => 'Hidden', + 'column' => false, ]); } @@ -131,6 +130,12 @@ class Client extends CubistMagicAbstractModel $discount_array = array_combine($discount_array_save_keys,$discount_array); + dump($categoryProduct); + + if(!in_array($categoryProduct, $discount_array)) { + $categoryProduct = 'A'; + } + if($categoryProduct && $categoryClient) { return $discount_array[$categoryProduct][$categoryClient]; } diff --git a/app/SubForms/Address.php b/app/SubForms/Address.php index 21f70f2..fedef77 100644 --- a/app/SubForms/Address.php +++ b/app/SubForms/Address.php @@ -22,9 +22,9 @@ class Address extends SubForm { ]); $this->addField([ - 'name' => 'address', - 'label' => "Adresse", - 'type' => 'Textarea' + 'name' => 'firstname', + 'label' => "Prénom", + 'type' => 'Text' ]); $this->addField([ @@ -34,9 +34,9 @@ class Address extends SubForm { ]); $this->addField([ - 'name' => 'firstname', - 'label' => "Prénom", - 'type' => 'Text' + 'name' => 'address', + 'label' => "Adresse", + 'type' => 'Textarea' ]); $this->addField([ -- 2.39.5