From 291a1a23ed4c1d4b0b01a45d88e697ea0dd7b28a Mon Sep 17 00:00:00 2001 From: saparatayev Date: Thu, 15 Jul 2021 11:52:59 +0500 Subject: [PATCH] fix bug with fetching ru,en product names --- plugins/tps/birzha/components/OfferForm.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/tps/birzha/components/OfferForm.php b/plugins/tps/birzha/components/OfferForm.php index 163ad51ec..69ad60db1 100644 --- a/plugins/tps/birzha/components/OfferForm.php +++ b/plugins/tps/birzha/components/OfferForm.php @@ -71,10 +71,12 @@ class OfferForm extends ComponentBase $product_en = DB::table('rainlab_translate_attributes') ->where('model_id',$product->id) + ->where('model_type', 'TPS\Birzha\Models\Product') ->where('locale','en')->first(); $product_ru = DB::table('rainlab_translate_attributes') ->where('model_id',$product->id) + ->where('model_type', 'TPS\Birzha\Models\Product') ->where('locale','ru')->first(); @@ -170,7 +172,7 @@ class OfferForm extends ComponentBase ]; $this->validateFileType($data, $rules); - // seaparate validation for image size + // separate validation for image size $rules = [ 'new_img.*' => 'max:1024' ]; @@ -218,7 +220,7 @@ class OfferForm extends ComponentBase DB::table('system_files')->insert($insertionArray); } else { //completely new product - // seaprate validation for image requirement + // separate validation for image requirement $rules = [ 'new_img' => 'required' ]; @@ -231,6 +233,8 @@ class OfferForm extends ComponentBase } } + // $this->page['draft_offers'] = \Auth::user()->offers()->where('status','draft')->get(); + return [ '#form-steps' => $this->renderPartial('@basket') ];