From 11f666d671babb1463d4f8dfadb4c56c08fe6995 Mon Sep 17 00:00:00 2001 From: Shohrat Date: Wed, 25 Oct 2023 16:09:40 +0000 Subject: [PATCH] all --- .../api/BlogPostsApiController.php | 95 +++- .../controllers/api/OrderApiController.php | 40 +- .../controllers/api/ProductsApiController.php | 7 +- plugins/ahmadfatoni/apigenerator/routes.php | 2 + plugins/rainlab/user/components/Account.php | 3 +- plugins/rainlab/user/models/User.php | 2 +- plugins/rainlab/user/models/user/fields.yaml | 7 +- plugins/tps/birzha/Plugin.php | 6 +- plugins/tps/birzha/classes/Product.php | 15 +- .../tps/birzha/components/CategoryProfile.php | 80 ++++ plugins/tps/birzha/components/Checkout.php | 8 +- .../birzha/components/FilteredProducts.php | 100 ++++- plugins/tps/birzha/components/MyOffers.php | 2 +- plugins/tps/birzha/components/OfferForm.php | 113 ++++- plugins/tps/birzha/components/Offers.php | 64 ++- plugins/tps/birzha/components/OrderDetail.php | 1 + .../tps/birzha/components/SearchOffers.php | 4 +- .../tps/birzha/components/ShopSettings.php | 3 + plugins/tps/birzha/components/SingleSale.php | 19 +- .../components/categoryprofile/default.htm | 267 ++++++++++-- .../birzha/components/checkout/default.htm | 132 +++--- .../birzha/components/checkout/success.htm | 14 + .../components/filteredproducts/default.htm | 184 ++++++-- .../birzha/components/messages/default.htm | 11 +- .../birzha/components/mycomments/default.htm | 24 +- .../components/myfavourites/default.htm | 22 +- .../birzha/components/myoffers/default.htm | 68 ++- .../birzha/components/myorders/default.htm | 28 +- .../birzha/components/offerform/default.htm | 27 +- .../components/offerform/editSuccess.htm | 14 + .../components/offerform/second_step_form.htm | 198 --------- .../birzha/components/offerform/success.htm | 17 + .../components/offerform/third_step_form.htm | 241 ---------- .../tps/birzha/components/offers/default.htm | 214 +++++++-- .../birzha/components/orderdetail/default.htm | 64 ++- .../components/searchoffers/default.htm | 54 ++- .../components/shopsettings/default.htm | 55 +-- .../birzha/components/singleoffer/default.htm | 57 ++- .../birzha/components/singlesale/default.htm | 122 ++++-- .../birzha/components/useroffers/default.htm | 24 +- .../birzha/components/vendorsales/default.htm | 24 +- .../birzha/console/AddKeywordToProducts.php | 64 +++ plugins/tps/birzha/models/Product.php | 9 + plugins/tps/birzha/models/product/fields.yaml | 15 +- ...er_table_update_tps_birzha_products_40.php | 23 + ...er_table_update_tps_birzha_products_41.php | 23 + plugins/tps/birzha/updates/version.yaml | 6 + themes/gurlushyk/assets/css/style.css | 4 +- .../assets/img/core-img/productAddSuccess.png | Bin 0 -> 20011 bytes themes/gurlushyk/content/AboutUs.htm | 1 + themes/gurlushyk/content/AboutUs.ru.htm | 2 + themes/gurlushyk/content/orderCancel.htm | 15 + themes/gurlushyk/content/privacy.htm | 15 + themes/gurlushyk/content/refund.htm | 15 + themes/gurlushyk/layouts/default.htm | 16 +- themes/gurlushyk/meta/menus/top-menu.yaml | 147 ++----- themes/gurlushyk/pages/about.htm | 15 +- themes/gurlushyk/pages/addProduct.htm | 410 +++++++++++++++++- themes/gurlushyk/pages/contact-us.htm | 91 +++- themes/gurlushyk/pages/haryt2.htm | 6 +- themes/gurlushyk/pages/index.htm | 4 +- themes/gurlushyk/pages/login.htm | 21 +- themes/gurlushyk/pages/my-offers.htm | 6 + themes/gurlushyk/pages/my-orders.htm | 6 + themes/gurlushyk/pages/order-cancel.htm | 19 +- themes/gurlushyk/pages/print.htm | 140 ++++++ themes/gurlushyk/pages/privacy.htm | 12 +- themes/gurlushyk/pages/register.htm | 25 +- themes/gurlushyk/pages/return.htm | 19 +- themes/gurlushyk/pages/user-page.htm | 7 + themes/gurlushyk/pages/vendor-settings.htm | 6 + themes/gurlushyk/partials/footer.htm | 36 +- themes/gurlushyk/partials/header.htm | 34 +- themes/gurlushyk/partials/home/parallax.htm | 6 +- .../gurlushyk/partials/product/card-item.htm | 14 +- themes/gurlushyk/partials/profile/modal.htm | 13 +- .../gurlushyk/partials/profile/parallax.htm | 2 +- themes/gurlushyk/partials/profile/style1.htm | 37 +- themes/gurlushyk/partials/profile/style2.htm | 27 +- themes/gurlushyk/partials/profile/style3.htm | 2 +- themes/gurlushyk/partials/profile/style4.htm | 2 +- themes/gurlushyk/partials/user/menu.htm | 14 + 82 files changed, 2633 insertions(+), 1128 deletions(-) create mode 100644 plugins/tps/birzha/components/checkout/success.htm create mode 100644 plugins/tps/birzha/components/offerform/editSuccess.htm delete mode 100644 plugins/tps/birzha/components/offerform/second_step_form.htm create mode 100644 plugins/tps/birzha/components/offerform/success.htm delete mode 100644 plugins/tps/birzha/components/offerform/third_step_form.htm create mode 100644 plugins/tps/birzha/console/AddKeywordToProducts.php create mode 100644 plugins/tps/birzha/updates/builder_table_update_tps_birzha_products_40.php create mode 100644 plugins/tps/birzha/updates/builder_table_update_tps_birzha_products_41.php create mode 100644 themes/gurlushyk/assets/img/core-img/productAddSuccess.png create mode 100644 themes/gurlushyk/content/AboutUs.htm create mode 100644 themes/gurlushyk/content/AboutUs.ru.htm create mode 100644 themes/gurlushyk/content/orderCancel.htm create mode 100644 themes/gurlushyk/content/privacy.htm create mode 100644 themes/gurlushyk/content/refund.htm create mode 100644 themes/gurlushyk/pages/print.htm create mode 100644 themes/gurlushyk/pages/user-page.htm create mode 100644 themes/gurlushyk/partials/user/menu.htm diff --git a/plugins/ahmadfatoni/apigenerator/controllers/api/BlogPostsApiController.php b/plugins/ahmadfatoni/apigenerator/controllers/api/BlogPostsApiController.php index db10f04..e0c2694 100644 --- a/plugins/ahmadfatoni/apigenerator/controllers/api/BlogPostsApiController.php +++ b/plugins/ahmadfatoni/apigenerator/controllers/api/BlogPostsApiController.php @@ -37,6 +37,76 @@ class BlogPostsApiController extends Controller } + public function onGetCategorySubs($catId){ + + $subs = $this->getSubCatsq($catId); + + $checkSubs = $this->checkSubs($subs); + + if($checkSubs == ''){ + $checkSubs = []; + } + + $allCats = $subs + $checkSubs; + + + //$subCatsAll = Category::whereIn("id", $allCats)->orderBy("primary_key", "ASC")->get(); + + return $allCats; + + } + + + protected function checkSubs($catIds){ + $data = ''; + $subCats = []; + foreach ($catIds as $id){ + $subs = $this->getSubCatsq($id); + if(count($subs) > 0){ + foreach($subs as $subId){ + array_unshift($subCats, $subId); + } + array_unshift($subCats, $id); + $data = $subCats; + } + } + return $data; + + } + + protected function getSubCatsq($catId){ + + $categoriesCustoms = Category::where("primary_key", $catId)->select("id", "primary_key")->get()->pluck("id")->toArray(); + return $categoriesCustoms; + + } + + + public function getProductsWithAllSubCats(Request $request){ + $data = $request->all(); + + $catIds = $this->onGetCategorySubs($data["category"]); + + $products = Product::with('categories:id,name')->whereHas('categories', function($q) use($catIds){ + $q->whereIn('id', $catIds); + }) + ->with([ + 'translations:locale,model_id,attribute_data', + 'images:attachment_id,attachment_type,disk_name,file_name', + 'place' + ]) + ->withCount(['comments as rating_avg' => function($query) { + $query->select(DB::raw('avg(rating)')); + }]) + ->approved() + ->orderBy("id", "DESC") + ->paginate(12); + + return response()->json(array("data"=>$products), 200); + + } + + public function getCategoryDatas(Request $request) { $path = 'https://gurlushyk.com.tm' . Config::get('cms.storage.media.path'); @@ -45,13 +115,15 @@ class BlogPostsApiController extends Controller - $accounts = Category::select("id","name", "icon", "is_file_category", "primary_key")->where('id', $data["category"])->with("users:id,name,email,username,type,logo,shop_title,slogan,work_time,short_description,is_instagram")->get(); + $accounts = Category::select("id","name", "icon", "is_file_category", "primary_key")->where('id', $data["category"]) + ->with(["users" => function($q){ + $q->where("type", "!=", "simple"); + }]) + ->get(); $banners = Category::select("id","name", "icon", "is_file_category", "primary_key")->where('id', $data["category"])->with(["users" => function($q){ - $q->where("is_category", 1)->select("category_id", "user_id", "logo", "banner", "is_instagram"); + $q->where("is_category", 1)->select("category_id", "user_id", "logo", "banner", "is_instagram"); }])->get(); - - $data = array( "path" => $path, "accounts" => $accounts, @@ -269,7 +341,7 @@ class BlogPostsApiController extends Controller $favourite = $this->Favourites::where('user_id', $currentUser->id) ->with(['product' => function($q){ - $q->approved()->with(['images', 'place', 'files', 'translations:locale,model_id,attribute_data']); + $q->approved()->withTrashed()->with(['images', 'place', 'files', 'translations:locale,model_id,attribute_data']); }])->paginate(9); //dd($favourite); @@ -352,10 +424,15 @@ class BlogPostsApiController extends Controller $data->pathUrl = 'https://gurlushyk.com.tm' . \Config::get('cms.storage.media.path'); - $data->categories[] = array( - "id" => 0, - "name"=> "Hemmesi", - ); + $all = array( + "id" => 0, + "name"=> "Hemmesi", + ); + + //array_unshift($data->categories, $all); + //$testq = is_array($data->categories); + + $data->categories->prepend($all); return response()->json($data, 200); } diff --git a/plugins/ahmadfatoni/apigenerator/controllers/api/OrderApiController.php b/plugins/ahmadfatoni/apigenerator/controllers/api/OrderApiController.php index 30b69f4..70e7bcf 100644 --- a/plugins/ahmadfatoni/apigenerator/controllers/api/OrderApiController.php +++ b/plugins/ahmadfatoni/apigenerator/controllers/api/OrderApiController.php @@ -10,6 +10,8 @@ use TPS\Birzha\Models\Orders; use TPS\Birzha\Models\OrderItems; use TPS\Birzha\Models\VendorSales; use RainLab\User\Models\User as UserClient; +use Sms\Sms\Models\SmsSender; +use RainLab\Translate\Models\Message; class OrderApiController extends Controller { @@ -51,6 +53,7 @@ class OrderApiController extends Controller $order->save(); + $this->sendSMS($currentUser->username, Message::trans('success.ordered')); // [{"item":34,"qty":1},{"item":35,"qty":3}] $orderItem = new OrderItems; @@ -72,6 +75,12 @@ class OrderApiController extends Controller } + $vendorPhones = VendorSales::where("order_id", $order->id)->with("vendor")->groupBy("vendor_id")->get(); + + for ($x = 0; $x < count($vendorPhones); $x++) { + $this->sendSMS($vendorPhones[$x]->vendor->username, Message::trans('success.ordered.vendor')); + } + if ($order && $orderItem && $vendorSale){ @@ -91,7 +100,25 @@ class OrderApiController extends Controller $currentUser = \JWTAuth::parseToken()->authenticate(); - $orders = Orders::where("user_id", $currentUser->id)->with("order_items")->orderBy('id', 'DESC')->paginate(12); + //$orders = Orders::where("user_id", $currentUser->id)->with(["order_items"])->orderBy('id', 'DESC')->paginate(12); + $orders = VendorSales::with("order")->whereHas('order', function ($query) use($currentUser) { + $query->where('user_id', $currentUser->id); + })->groupBy("order_id")->orderBy("id", "DESC")->paginate(12); + + for ($i = 0; $i < count($orders); $i++) { + + $products = VendorSales::where("order_id", $orders[$i]->order_id)->with(["product" => function($q){ + $q->with([ + 'translations:locale,model_id,attribute_data', + 'images:attachment_id,attachment_type,disk_name,file_name', + 'vendor:id,name,email,type,logo,banner,shop_title,slogan,is_instagram', + 'place', + ]); + }])->get(); + + + $orders[$i]->products = $products; + } return response()->json($orders, 200); //return $this->helpers->apiArrayResponseBuilder(200, 'ok', [$orders]); @@ -118,7 +145,7 @@ class OrderApiController extends Controller $currentUser = \JWTAuth::parseToken()->authenticate(); - $sales = VendorSales::where('vendor_id', $currentUser->id)->where('order_id', $data["order_id"])->with(['order.user', 'product'])->orderBy('id', 'DESC')->paginate(15); + $sales = VendorSales::where('vendor_id', $currentUser->id)->where('order_id', $data["order_id"])->with(['order.user', 'product.images:attachment_id,attachment_type,disk_name,file_name', 'product.place', 'product.vendor:id,name,email,type,logo,banner,shop_title,slogan,is_instagram'])->orderBy('id', 'DESC')->paginate(15); @@ -201,6 +228,15 @@ class OrderApiController extends Controller } } + + protected function sendSMS($phone, $message){ + + $smsSender = new SmsSender(); + $smsSender->phone = (string)'+993'.$phone; + $smsSender->message = strval($message); + $smsSender->save(); + + } public static function getAfterFilters() {return [];} public static function getBeforeFilters() {return [];} diff --git a/plugins/ahmadfatoni/apigenerator/controllers/api/ProductsApiController.php b/plugins/ahmadfatoni/apigenerator/controllers/api/ProductsApiController.php index 87aff7e..5b23b6a 100644 --- a/plugins/ahmadfatoni/apigenerator/controllers/api/ProductsApiController.php +++ b/plugins/ahmadfatoni/apigenerator/controllers/api/ProductsApiController.php @@ -47,7 +47,7 @@ class ProductsAPIController extends Controller $perPage = intval(input('custom_per_page')); // intval protects from injection try { - $products = Product::where('name', 'like', "%".$data["key"]."%")->orWhere('slug','LIKE','%'.$data["key"].'%')->with(['translations:locale,model_id,attribute_data', + $products = Product::where('keyword', 'like', "%".$data["key"]."%")->orWhere('name', 'like', "%".$data["key"]."%")->orWhere('slug','LIKE','%'.$data["key"].'%')->with(['translations:locale,model_id,attribute_data', 'images:attachment_id,attachment_type,disk_name,file_name', 'vendor:id,name,email,type,logo,banner,shop_title,slogan,is_instagram', 'place',])->where('status', 'approved')->paginate(15); @@ -144,7 +144,7 @@ class ProductsAPIController extends Controller $query->select(DB::raw('avg(rating)')); }]) ->where('vendor_id', $seller) - ->approved()->orderBy('ends_at', $sortOrder); + ->approved()->orderBy('id', $sortOrder); } @@ -405,6 +405,7 @@ class ProductsAPIController extends Controller $product->place_id = $data['place_id']; $product->price = $data['price']; $product->phone = $data['phone']; + $product->stock = $data['stock']; $product->is_file_product = $data['is_file']; @@ -690,6 +691,8 @@ class ProductsAPIController extends Controller $attachedProduct->phone = $data['phone']; + $attachedProduct->stock = $data['stock']; + $attachedProduct->is_file_product = $data['is_file']; $attachedProduct->save(); diff --git a/plugins/ahmadfatoni/apigenerator/routes.php b/plugins/ahmadfatoni/apigenerator/routes.php index b83a9ff..b0eca35 100644 --- a/plugins/ahmadfatoni/apigenerator/routes.php +++ b/plugins/ahmadfatoni/apigenerator/routes.php @@ -55,6 +55,8 @@ Route::group(['prefix' =>'api/v1','namespace' =>'AhmadFatoni\ApiGenerator\Contro Route::get('account/{id}/datas', 'BlogPostsApiController@getAccountDatas'); Route::get('get/category/datas', 'BlogPostsApiController@getCategoryDatas'); + + Route::get('get/all/sub/products', 'BlogPostsApiController@getProductsWithAllSubCats'); Route::middleware(['\Tymon\JWTAuth\Middleware\GetUserFromToken'])->group(function () { Route::delete('delete/account', 'VendorApiController@deleteVendor'); diff --git a/plugins/rainlab/user/components/Account.php b/plugins/rainlab/user/components/Account.php index 2ad9fc4..b33e3bd 100644 --- a/plugins/rainlab/user/components/Account.php +++ b/plugins/rainlab/user/components/Account.php @@ -236,7 +236,7 @@ class Account extends ComponentBase $rules['login'] = $this->loginAttribute() == UserSettings::LOGIN_USERNAME ? 'required|between:2,255' - : 'required|email|between:6,255'; + : 'email|between:6,255'; $rules['password'] = 'required|between:' . UserModel::getMinPasswordLength() . ',255'; @@ -311,6 +311,7 @@ class Account extends ComponentBase * Validate input */ $data = post(); + $data['email'] = $data['username']; if (!array_key_exists('password_confirmation', $data)) { $data['password_confirmation'] = post('password'); diff --git a/plugins/rainlab/user/models/User.php b/plugins/rainlab/user/models/User.php index be55c45..380b440 100644 --- a/plugins/rainlab/user/models/User.php +++ b/plugins/rainlab/user/models/User.php @@ -24,7 +24,7 @@ class User extends UserBase * Validation rules */ public $rules = [ - 'email' => 'required|between:6,255|unique:users', + 'email' => 'between:6,255|unique:users', 'avatar' => 'nullable|image|max:4000', 'username' => 'required|between:2,255|unique:users', 'password' => 'required:create|between:8,255|confirmed', diff --git a/plugins/rainlab/user/models/user/fields.yaml b/plugins/rainlab/user/models/user/fields.yaml index 56f1ab4..2445de0 100644 --- a/plugins/rainlab/user/models/user/fields.yaml +++ b/plugins/rainlab/user/models/user/fields.yaml @@ -191,7 +191,12 @@ tabs: span: auto default: variant1 type: balloon-selector - tab: 'Web Wariantlar' + tab: 'Web Wariantlar we skidka' + web2: + label: 'Skidka prosentda gorkez' + span: auto + type: number + tab: 'Web Wariantlar we skidka' secondaryTabs: fields: avatar: diff --git a/plugins/tps/birzha/Plugin.php b/plugins/tps/birzha/Plugin.php index 4de8e48..3055063 100644 --- a/plugins/tps/birzha/Plugin.php +++ b/plugins/tps/birzha/Plugin.php @@ -17,7 +17,7 @@ use Illuminate\Http\Resources\Json\Resource; use Session; use TPS\Birzha\Actions\MakeGiftAction; use Tps\Birzha\Console\MakeGiftToUsers; - +use Tps\Birzha\Console\AddKeywordToProducts; /** * Birzha Plugin Information File */ @@ -47,6 +47,7 @@ class Plugin extends PluginBase { $this->registerConsoleCommand('birzha:databasebackup', DatabaseBackUp::class); $this->registerConsoleCommand('birzha:gifttousers', MakeGiftToUsers::class); + $this->registerConsoleCommand('birzha:addkeywordtoproducts', AddKeywordToProducts::class); } public function registerListColumnTypes() { @@ -59,8 +60,7 @@ class Plugin extends PluginBase ]; } - - + public function registerMarkupTags() { return [ diff --git a/plugins/tps/birzha/classes/Product.php b/plugins/tps/birzha/classes/Product.php index 17ddbed..6fbca41 100644 --- a/plugins/tps/birzha/classes/Product.php +++ b/plugins/tps/birzha/classes/Product.php @@ -2,19 +2,28 @@ namespace TPS\Birzha\Classes; use TPS\Birzha\Models\Product as ProductItem; - +use Illuminate\Support\Facades\Log; class Product { public static function getName($id) { $product = ProductItem::find($id); - return $product->name; + if($product){ + return $product->name; + } + + return ""; } public static function getImage($id) { + Log::info("product id ".$id); $product = ProductItem::find($id); - return $product->images[0]->path; + if($product){ + return $product->images[0]->path; + } + return null; + } } \ No newline at end of file diff --git a/plugins/tps/birzha/components/CategoryProfile.php b/plugins/tps/birzha/components/CategoryProfile.php index ff5dc32..ecee6b3 100644 --- a/plugins/tps/birzha/components/CategoryProfile.php +++ b/plugins/tps/birzha/components/CategoryProfile.php @@ -20,6 +20,8 @@ class CategoryProfile extends ComponentBase public $users; public $products; public $subcategories; + public $categories; + public $cities; public function componentDetails() { return [ @@ -48,6 +50,18 @@ class CategoryProfile extends ComponentBase $this->users = $this->getCategoryUsers(); $this->category = $this->getCategory(); $this->subcategories = $this->getSubs(); + $this->categories = $this->getCategories(); + $this->cities = $this->getCities(); + } + + protected function getCategories(){ + $categories = Category::where('primary_key', 0)->get(); + return $categories; + } + + protected function getCities(){ + $cities = City::all(); + return $cities; } protected function getCategory(){ @@ -99,4 +113,70 @@ class CategoryProfile extends ComponentBase $favourite->save(); Flash::success("Haryt halanlaryma goşuldy"); } + + public function onGetCategorySubs(){ + + $data = post(); + + $catgegory = null; + if(strlen($data["mainCat"]) > 0){ + $category = Category::where('slug', $data["mainCat"])->first(); + } + + $subs = $this->getSubCatsq($category ? $category->id : $data["mainCat"]); + + $checkSubs = $this->checkSubs($subs); + + if($checkSubs == ''){ + $checkSubs = []; + } + + $allCats = $subs + $checkSubs; + + $subCatsAll = Category::whereIn("id", $allCats)->orderBy("primary_key", "ASC")->get(); + + return $subCatsAll; + + } + + protected function checkSubs($catIds){ + $data = ''; + $subCats = []; + foreach ($catIds as $id){ + $subs = $this->getSubCatsq($id); + if(count($subs) > 0){ + foreach($subs as $subId){ + array_unshift($subCats, $subId); + } + array_unshift($subCats, $id); + $data = $subCats; + } + } + return $data; + } + + protected function getSubCatsq($catId){ + + $categoriesCustoms = Category::where("primary_key", $catId)->select("id", "primary_key")->get()->pluck("id")->toArray(); + return $categoriesCustoms; + + } + + +//---------- + + protected function checking($catIds){ + $data=[]; + foreach ($catIds as $id){ + + $subs = $this->getSubCatsq($id); + $data[] = $id; + if(count($subs) > 0){ + $data[] = $subs; + } + + } + } + + } diff --git a/plugins/tps/birzha/components/Checkout.php b/plugins/tps/birzha/components/Checkout.php index d9a14d1..ccf2f73 100644 --- a/plugins/tps/birzha/components/Checkout.php +++ b/plugins/tps/birzha/components/Checkout.php @@ -14,6 +14,7 @@ use TPS\Birzha\Models\OrderItems; use TPS\Birzha\Models\VendorSales; use Flash; use Sms\Sms\Models\SmsSender; +use RainLab\Translate\Models\Message; class Checkout extends ComponentBase { @@ -51,7 +52,7 @@ class Checkout extends ComponentBase $userPhone= \Auth::user()->username; - $this->sendSMS($userPhone, "Siz üstünlikli sargyt etdiňiz."); + $this->sendSMS($userPhone, Message::trans('success.ordered')); $orderItem = new OrderItems; $orderItem->order_id = $order->id; @@ -73,11 +74,14 @@ class Checkout extends ComponentBase $vendorPhones = VendorSales::where("order_id", $order->id)->with("vendor")->groupBy("vendor_id")->get(); for ($x = 0; $x < count($vendorPhones); $x++) { - $this->sendSMS($vendorPhones[$x]->vendor->username, "Size Gurluşyk platformasyndan sargyt geldi"); + $this->sendSMS($vendorPhones[$x]->vendor->username, Message::trans('success.ordered.vendor')); } if ($order && $orderItem && $vendorSale){ Flash::success('Sargyt ugradyldy'); + return [ + '#checkoutMainDiv' => $this->renderPartial('@success') + ]; }else{ Flash::error('Sargyt ugradylmady'); return 500; diff --git a/plugins/tps/birzha/components/FilteredProducts.php b/plugins/tps/birzha/components/FilteredProducts.php index 05be8c8..5ffdca6 100644 --- a/plugins/tps/birzha/components/FilteredProducts.php +++ b/plugins/tps/birzha/components/FilteredProducts.php @@ -22,6 +22,8 @@ class FilteredProducts extends ComponentBase public $products; public $params; public $category; + public $city; + public $subCategory; public $categories; public $cities; @@ -75,10 +77,19 @@ class FilteredProducts extends ComponentBase $this->params = $params; $this->products = $this->loadFiltered(); - $this->category = $this->getSubCategory(); + $this->category = $this->getCategory(); + $this->city = $this->getCity(); + $this->subCategory = $this->getSubCategory(); $this->categories = $this->getCategories(); $this->cities = $this->getCities(); } + + protected function getCategory() + { + $cSlug = \Input::get('category'); + $category = Category::transWhere('slug', $cSlug, Session::get('rainlab.translate.locale'))->first(); + return $category; + } protected function getSubCategory() { @@ -89,9 +100,16 @@ class FilteredProducts extends ComponentBase protected function getCategories() { - $categories = Category::all(); + $categories = Category::where('primary_key', '=', 0)->get(); return $categories; } + + protected function getCity() + { + $cityId = \Input::get('city'); + $city = City::find($cityId); + return $city; + } protected function getCities() { @@ -113,8 +131,14 @@ class FilteredProducts extends ComponentBase $perPage = $this->property('perPage'); $products = Product::query(); - - $cSlug = \Input::get('subcategory'); + $subCat = \Input::get('subcategory'); + + $cSlug = null; + if(isset($subCat) && $subCat != ''){ + $cSlug = $subCat; + }else{ + $cSlug = \Input::get('category'); + } $city = \Input::get('city'); $minPrice = \Input::get('min_price'); $maxPrice = \Input::get('max_price'); @@ -124,7 +148,6 @@ class FilteredProducts extends ComponentBase $category = Category::transWhere('slug', $cSlug, Session::get('rainlab.translate.locale'))->first(); if ($category) { $products = $category->products(); - // $products->withPath("filter?category=".$category->slug); } else { $products = null; } @@ -177,4 +200,71 @@ class FilteredProducts extends ComponentBase $favourite->save(); Flash::success("Haryt halanlaryma goşuldy"); } + + public function onGetCategorySubs(){ + + $data = post(); + + $catgegory = null; + if(strlen($data["mainCat"]) > 0){ + $category = Category::where('slug', $data["mainCat"])->first(); + } + + $subs = $this->getSubCatsq($category ? $category->id : $data["mainCat"]); + + $checkSubs = $this->checkSubs($subs); + + if($checkSubs == ''){ + $checkSubs = []; + } + + $allCats = $subs + $checkSubs; + + $subCatsAll = Category::whereIn("id", $allCats)->orderBy("primary_key", "ASC")->get(); + + return $subCatsAll; + + } + + protected function checkSubs($catIds){ + $data = ''; + $subCats = []; + foreach ($catIds as $id){ + $subs = $this->getSubCatsq($id); + if(count($subs) > 0){ + foreach($subs as $subId){ + array_unshift($subCats, $subId); + } + array_unshift($subCats, $id); + $data = $subCats; + } + } + return $data; + + } + + protected function getSubCatsq($catId){ + + $categoriesCustoms = Category::where("primary_key", $catId)->select("id", "primary_key")->get()->pluck("id")->toArray(); + return $categoriesCustoms; + + } + + +//---------- + + protected function checking($catIds){ + $data=[]; + foreach ($catIds as $id){ + + $subs = $this->getSubCatsq($id); + $data[] = $id; + if(count($subs) > 0){ + $data[] = $subs; + } + + } + } + + } diff --git a/plugins/tps/birzha/components/MyOffers.php b/plugins/tps/birzha/components/MyOffers.php index 6abec79..53cc3e0 100644 --- a/plugins/tps/birzha/components/MyOffers.php +++ b/plugins/tps/birzha/components/MyOffers.php @@ -62,7 +62,7 @@ class MyOffers extends ComponentBase $perPage = $this->property('perPage'); return \Auth::user()->products() ->orderBy('updated_at', 'desc') - ->paginate($perPage); + ->paginate(6); } diff --git a/plugins/tps/birzha/components/OfferForm.php b/plugins/tps/birzha/components/OfferForm.php index 7684fee..3c88f85 100644 --- a/plugins/tps/birzha/components/OfferForm.php +++ b/plugins/tps/birzha/components/OfferForm.php @@ -17,6 +17,9 @@ use Str; use ValidationException; use Carbon\Carbon; use RainLab\User\Facades\Auth; +use Illuminate\Support\Arr; +use Illuminate\Support\Facades\Log; + class OfferForm extends ComponentBase { @@ -67,10 +70,11 @@ class OfferForm extends ComponentBase 'name' => 'required', 'price' => 'required|numeric', 'state_id' => 'required', + 'stock' => 'required|numeric|min:0|max:1', 'description' => 'required', 'new_img' => 'array|required', // 'is_file' => 'required', - 'new_img.*' => 'mimes:jpg,png|max:1024', + 'new_img.*' => 'mimes:jpg,png', 'category_id' => [ 'required', 'exists:tps_birzha_categories,id', @@ -91,12 +95,22 @@ class OfferForm extends ComponentBase } $category = null; + $keyword = $data['name']; if(isset($data["subcategory_id"]) && $data["subcategory_id"] != 'null'){ $category = Category::find($data['subcategory_id']); }else{ $category = Category::find($data['category_id']); } + $keyword = $keyword.' '.$category->name.' '.$category->slug; + if($category->primary_key > 0){ + $keyword = $keyword.' '.$category->parent->name.' '.$category->parent->slug; + if($category->parent->primary_key > 0){ + $keyword = $keyword.' '.$category->parent->parent->name.' '.$category->parent->parent->slug; + } + } + + $place = null; if(isset($data["city_id"]) && $data["city_id"] != 'null'){ $place = $data['city_id']; @@ -114,6 +128,8 @@ class OfferForm extends ComponentBase $product->price = $data['price']; $product->phone = $data['phone']; $product->is_file_product = $data['is_file']; + $product->stock = $data['stock']; + $product->keyword = $keyword; $product->created_at = Carbon::now(); $product->updated_at = Carbon::now(); @@ -157,6 +173,9 @@ class OfferForm extends ComponentBase } $product->save(); Flash::success('Haryt goşuldy'); + return [ + '#mainDiv' => $this->renderPartial('@success') + ]; } @@ -166,10 +185,11 @@ class OfferForm extends ComponentBase 'name' => 'required', 'price' => 'required|numeric', 'state_id' => 'required', + 'stock' => 'required|numeric|min:0|max:1', 'description' => 'required', 'new_img' => 'array', // 'is_file' => 'required', - 'new_img.*' => 'mimes:jpg,png|max:1024', + 'new_img.*' => 'mimes:jpg,png', 'category_id' => [ 'required', 'exists:tps_birzha_categories,id', @@ -195,6 +215,18 @@ class OfferForm extends ComponentBase if(!$product){ Flash::error('Haryt tapylmady'); } + + $keyword = $data["name"]; + + $keyword = $keyword.' '.$category->name.' '.$category->slug; + if($category->primary_key > 0){ + $keyword = $keyword.' '.$category->parent->name.' '.$category->parent->slug; + if($category->parent->primary_key > 0){ + $keyword = $keyword.' '.$category->parent->parent->name.' '.$category->parent->parent->slug; + } + } + + $product->name = $data['name']; $product->description = $data['description']; $product->short_description = $data['short_description']; @@ -204,6 +236,8 @@ class OfferForm extends ComponentBase $product->price = $data['price']; $product->phone = $data['phone']; $product->is_file_product = $data['is_file']; + $product->stock = $data['stock']; + $product->keyword = $keyword; $product->updated_at = Carbon::now(); if(isset($data['new_file'])){ @@ -238,7 +272,9 @@ class OfferForm extends ComponentBase } $product->save(); Flash::success('Haryt maglumaty üýtgedildi. Tassyklanýança garaşmagyňyzy haýyş edýäris.'); - return \Redirect::back(); + return [ + '#mainDiv' => $this->renderPartial('@editSuccess') + ]; } // step 2 @@ -391,7 +427,7 @@ class OfferForm extends ComponentBase } public function onRun() { - $this->categories = Category::where('status',1)->where('primary_key', '=', 0)->get(); + $this->categories = Category::where('status',1)->where('primary_key', 0)->get(); $this->subcategories = Category::where('primary_key','>', 0)->get(); $this->states = City::where('primary_key','=', 0)->get(); $this->cities = City::where('primary_key','>', 0)->get(); @@ -407,4 +443,73 @@ class OfferForm extends ComponentBase $this->productForEditing = null; } } + + + public function onGetCategorySubs(){ + + $data = post(); + + $subs = $this->getSubCatsq($data["mainCat"]); + + $checkSubs = $this->checkSubs($subs); + + if($checkSubs == ''){ + $checkSubs = []; + } + + $allCats = $subs + $checkSubs; + + + $subCatsAll = Category::whereIn("id", $allCats)->orderBy("primary_key", "ASC")->get(); + + return $subCatsAll; + + } + + + protected function checkSubs($catIds){ + $data = ''; + $subCats = []; + foreach ($catIds as $id){ + $subs = $this->getSubCatsq($id); + if(count($subs) > 0){ + foreach($subs as $subId){ + array_unshift($subCats, $subId); + } + array_unshift($subCats, $id); + $data = $subCats; + } + } + return $data; + + } + + protected function getSubCatsq($catId){ + + $categoriesCustoms = Category::where("primary_key", $catId)->select("id", "primary_key")->get()->pluck("id")->toArray(); + return $categoriesCustoms; + + } + + +//---------- + + protected function checking($catIds){ + $data=[]; + foreach ($catIds as $id){ + + $subs = $this->getSubCatsq($id); + $data[] = $id; + if(count($subs) > 0){ + $data[] = $subs; + } + + } + } + + + + + + } diff --git a/plugins/tps/birzha/components/Offers.php b/plugins/tps/birzha/components/Offers.php index 050032a..a966e30 100644 --- a/plugins/tps/birzha/components/Offers.php +++ b/plugins/tps/birzha/components/Offers.php @@ -96,7 +96,7 @@ class Offers extends ComponentBase } protected function getCategories(){ - $categories = Category::all(); + $categories = Category::where('primary_key', '=', 0)->get(); return $categories; } @@ -173,6 +173,68 @@ class Offers extends ComponentBase Flash::success("Haryt halanlaryma goşuldy"); } + public function onGetCategorySubs(){ + + $data = post(); + + $catgegory = null; + if(strlen($data["mainCat"]) > 0){ + $category = Category::where('slug', $data["mainCat"])->first(); + } + + $subs = $this->getSubCatsq($category ? $category->id : $data["mainCat"]); + + $checkSubs = $this->checkSubs($subs); + + if($checkSubs == ''){ + $checkSubs = []; + } + + $allCats = $subs + $checkSubs; + + $subCatsAll = Category::whereIn("id", $allCats)->orderBy("primary_key", "ASC")->get(); + + return $subCatsAll; + + } + + protected function checkSubs($catIds){ + $data = ''; + $subCats = []; + foreach ($catIds as $id){ + $subs = $this->getSubCatsq($id); + if(count($subs) > 0){ + foreach($subs as $subId){ + array_unshift($subCats, $subId); + } + array_unshift($subCats, $id); + $data = $subCats; + } + } + return $data; + + } + + protected function getSubCatsq($catId){ + + $categoriesCustoms = Category::where("primary_key", $catId)->select("id", "primary_key")->get()->pluck("id")->toArray(); + return $categoriesCustoms; + + } + + protected function checking($catIds){ + $data=[]; + foreach ($catIds as $id){ + + $subs = $this->getSubCatsq($id); + $data[] = $id; + if(count($subs) > 0){ + $data[] = $subs; + } + + } + } + } diff --git a/plugins/tps/birzha/components/OrderDetail.php b/plugins/tps/birzha/components/OrderDetail.php index 15e04ea..5a60625 100644 --- a/plugins/tps/birzha/components/OrderDetail.php +++ b/plugins/tps/birzha/components/OrderDetail.php @@ -14,6 +14,7 @@ use Validator; class OrderDetail extends ComponentBase { public $order; + public $total = 0; public function componentDetails() { diff --git a/plugins/tps/birzha/components/SearchOffers.php b/plugins/tps/birzha/components/SearchOffers.php index c0de028..a3f5383 100644 --- a/plugins/tps/birzha/components/SearchOffers.php +++ b/plugins/tps/birzha/components/SearchOffers.php @@ -67,9 +67,9 @@ class SearchOffers extends ComponentBase if (isset($sort) && $sort != '') { $sort = self::getSort($sort); - $products = $products->where('name', 'like', '%'.$title.'%')->withCount("images")->orderBy( $sort[0], $sort[1]); + $products = $products->where('keyword', 'like', '%'.$title.'%')->withCount("images")->orderBy( $sort[0], $sort[1]); }else{ - $products = $products->where('name', 'like', '%'.$title.'%')->withCount("images"); + $products = $products->where('keyword', 'like', '%'.$title.'%')->withCount("images"); } $products = $products->with("vendor")->paginate($perPage); diff --git a/plugins/tps/birzha/components/ShopSettings.php b/plugins/tps/birzha/components/ShopSettings.php index 27b476a..470337e 100644 --- a/plugins/tps/birzha/components/ShopSettings.php +++ b/plugins/tps/birzha/components/ShopSettings.php @@ -41,15 +41,18 @@ class ShopSettings extends ComponentBase 'slogan' => 'required', 'description' => 'required', 'workTime' => 'required', + 'discount' => 'numeric' ]; $this->validateForm($data, $rules); + $user = User::find(\Auth::user()->id); $user->shop_title = $data['vendorName']; $user->slogan = $data['slogan']; $user->description = $data['description']; $user->work_time = $data['workTime']; + $user->web2 = $data['discount'] ? number_format($data['discount'], 2, '.', '') : null; $user->save(); Flash::success('Maglumatlar üýtgedildi'); diff --git a/plugins/tps/birzha/components/SingleSale.php b/plugins/tps/birzha/components/SingleSale.php index 459d6cd..36dfe4e 100644 --- a/plugins/tps/birzha/components/SingleSale.php +++ b/plugins/tps/birzha/components/SingleSale.php @@ -2,6 +2,7 @@ use Cms\Classes\ComponentBase; use TPS\Birzha\Models\Product; +use TPS\Birzha\Models\Orders; use TPS\Birzha\Models\VendorSales as VSales; use Input; use Flash; @@ -48,20 +49,28 @@ class SingleSale extends ComponentBase $vendorOrders = VSales::where('order_id', $data["order_id"])->get(); if((count($vendorOrders) != 0) && ($vendorOrders[0]->vendor_id == \Auth::user()->id)){ + for ($i = 0; $i < count($vendorOrders); $i++) { $vendorOrders[$i]->status = "completed"; $vendorOrders[$i]->save(); } + + $order = Orders::find($data["order_id"]); + $order->status = "completed"; + $order->save(); + Flash::success('Zakaz kabul edildi'); + return \Redirect::back(); }else{ Flash::error('Ýalňyşlyk ýüze çykdy'); + return \Redirect::back(); } } public function onRun() { - $this->order = $this->property('id'); + $this->order = $this->loadOrder(); $this->sales = $this->loadSaleOrderDetail(); } @@ -73,8 +82,16 @@ class SingleSale extends ComponentBase ->with(['order.user', 'product']) ->orderBy('id', 'DESC') ->paginate(15); + //dd($sales); return $sales; } + + protected function loadOrder() { + $order = Orders::where('id', $this->property('id'))->first(); + return $order; + } + + } diff --git a/plugins/tps/birzha/components/categoryprofile/default.htm b/plugins/tps/birzha/components/categoryprofile/default.htm index 7cfd54a..e702c8b 100644 --- a/plugins/tps/birzha/components/categoryprofile/default.htm +++ b/plugins/tps/birzha/components/categoryprofile/default.htm @@ -1,14 +1,17 @@ {% set category = __SELF__.category %} +{% set categories = __SELF__.categories %} {% set users = __SELF__.users %} {% set subs = __SELF__.subcategories %} +{% set cities = __SELF__.cities %} +{% set counter = 0 %}
-
Kategoriýa
+
{{ 'category.Kategoriya'|_ }}
@@ -342,11 +511,11 @@
{% if user %} {% else %} {% endif %} @@ -376,3 +545,45 @@ {% endif %} {% endfor %} {% endif %} + +{% put scripts %} + +{% endput %} diff --git a/plugins/tps/birzha/components/checkout/default.htm b/plugins/tps/birzha/components/checkout/default.htm index 8b1b4c0..016c038 100644 --- a/plugins/tps/birzha/components/checkout/default.htm +++ b/plugins/tps/birzha/components/checkout/default.htm @@ -3,10 +3,10 @@
-
Sebedim
+
{{ 'footer.sebedim'|_ }}
@@ -15,8 +15,8 @@ -
-
+
+
- Surat - Haryt ady - Bahasy - Mukdary - Jemi + {{ 'checkout.Surat'|_ }} + {{ 'checkout.HarytAdy'|_ }} + {{ 'checkout.Bahasy'|_ }} + {{ 'checkout.Mukdary'|_ }} + {{ 'checkout.Jemi'|_ }} @@ -49,22 +49,23 @@
- - - + + +993 + +
-
Sebet jemi
+
{{ 'checkout.SebetJemi'|_ }}
- + @@ -72,7 +73,7 @@ - + @@ -84,12 +85,10 @@ {% put scripts %} - - diff --git a/plugins/tps/birzha/components/offerform/success.htm b/plugins/tps/birzha/components/offerform/success.htm new file mode 100644 index 0000000..16eb73c --- /dev/null +++ b/plugins/tps/birzha/components/offerform/success.htm @@ -0,0 +1,17 @@ +
+
+
+
+ Gurluşyk, Gurluşyk platform, bezeg gurluşyk, gipsler merkezi +
+
+
+
+

{{ 'product.UstunlikliGosuldy'|_ }}

+
+
+

{{ 'product.BosSmsUgratmak'|_ }}

+
+
+
+
\ No newline at end of file diff --git a/plugins/tps/birzha/components/offerform/third_step_form.htm b/plugins/tps/birzha/components/offerform/third_step_form.htm deleted file mode 100644 index e5e57c6..0000000 --- a/plugins/tps/birzha/components/offerform/third_step_form.htm +++ /dev/null @@ -1,241 +0,0 @@ -
- {{'account.add_post'|_({ step_number: 3 })}} -
- -{% flash error %} -

- {{ message }} -

-{% endflash %} - -
-
-
-
-

- {{'account.lot_title'|_}} (RU) -

-
-
-

- {{ product.lang('ru').name }} -

-
-
-
-
-

- {{'account.lot_title'|_}} (EN) -

-
-
-

- {{ product.lang('en').name }} -

-
-
-
-
-

- {{'account.lot_title'|_}} (TM) -

-
-
-

- {{ product.lang('tm').name }} -

-
-
-
-
-

- {{'page.prod_mark'|_}} -

-
-
-

- {{ product.mark }} -

-
-
-
-
-

- {{'page.prod_vendor'|_}} -

-
-
-

- {{ product.manufacturer }} -

-
-
-
-
-

- {{'account.category'|_}} -

-
-
-

- {{ product.categories.first.name }} -

-
-
-
-
-

- {{'page.prod_vendor_country'|_}} -

-
-
-

- {{ product.country }} -

-
-
-
-
-

- {{'page.market_type'|_}} -

-
-
-

- {% if product and product.market_type == 'in' %} - {{'page.market_type_option_in'|_}} - {% endif %} - {% if product and product.market_type == 'out' %} - {{'page.market_type_option_out'|_}} - {% endif %} -

-
-
-
-
-

- {{'page.measure'|_}} -

-
-
-

- {{ product.measure.name }} -

-
-
-
-
-

- {{'page.prod_amount_2'|_}} -

-
-
-

- {{ product.quantity }} -

-
-
-
-
-

- {{'account.currency'|_}} -

-
-
-

- {{ product.currency.name }} -

-
-
-
-
-

- {{'page.prod_price'|_}} -

-
-
-

- {{ product.price }} -

-
-
-
-
-

- {{'page.delivery_cond'|_}} -

-
-
-

- {{ product.delivery_term.name }} -

-
-
-
-
-

- {{'page.delivery_point'|_}} -

-
-
-

- {{ product.place }} -

-
-
-
-
-

- {{'page.packaging'|_}} -

-
-
-

- {% if product.packaging == "yes" %} - {{'page.packaging_yes'|_}} - {% endif %} - {% if product.packaging == "no" %} - {{'page.packaging_no'|_}} - {% endif %} -

-
-
-
-
-

- {{'page.payment_cond'|_}} -

-
-
-

- {{ product.payment_term.name }} -

-
-
-
-
- - - -
- Стоимость -
-
-
-
- Цена за пост: -
-
- {{ fee }} TMT -
-
- -
- -
- - - - diff --git a/plugins/tps/birzha/components/offers/default.htm b/plugins/tps/birzha/components/offers/default.htm index c026cd7..23f7091 100644 --- a/plugins/tps/birzha/components/offers/default.htm +++ b/plugins/tps/birzha/components/offers/default.htm @@ -4,6 +4,7 @@ {% set cities = __SELF__.cities %} + {% for product in products %} -
{{ product.price }} TMT
+
+ {% if product.vendor.web2 > 0 %} + {{ product.price }} TMT + {{ product.getDiscountedPrice(product.vendor.web2) }} TMT + {% else %} + {{ product.price }} TMT + {% endif %} +
{{ product.stock == 0 ? 'productAdd.ZakazaGelyar'|_ : 'productAdd.ElimizdeBar'|_ }}

{{ html_limit(product.description, 100) }}

- Giňişleýin maglumat + {{ 'modal.GinisleyinMaglumat'|_ }} @@ -45,11 +53,11 @@ {% if user %} {% else %} {% endif %} @@ -86,9 +94,10 @@
-
Harytlar
+
{{ 'breadcrumbHarytlar'|_ }}
+ + +
+
+
+
+ +
+
+
+
+ + + + +
@@ -120,7 +210,7 @@
-

Şu wagtlykça haryt ýok

+

{{ 'product.SuwagtlykcaHarytYok'|_ }}

@@ -129,26 +219,39 @@
- - {% if category.subs|length > 0 %} + + +
+
{{ 'filter.Kategoriyalar'|_ }}
+
+ +
+
+ +
-
Sub kategoriýalar
+
{{ 'productAdd.IkinjiKategoriya'|_ }}
- {% endif %} +
-
Şäherler
+
{{ 'filter.Saherler'|_ }}
- +
@@ -183,12 +286,12 @@
- + + + + +
@@ -237,20 +340,28 @@ {% if user %} {% else %} {% endif %}

{{product.vendor.shop_title}}

{{ product.name }} -
{{ product.price }} TMT
+
+ {% if product.vendor.web2 > 0 %} + {{ product.price }} TMT + {{ product.getDiscountedPrice(product.vendor.web2) }} TMT + {% else %} + {{ product.price }} TMT + {% endif %} +
+ {{ product.stock == 0 ? 'productAdd.ZakazaGelyar'|_ : 'productAdd.ElimizdeBar'|_ }}
@@ -263,7 +374,7 @@ @@ -289,4 +400,47 @@ {% endif %} - \ No newline at end of file + + + +{% put scripts %} + +{% endput %} \ No newline at end of file diff --git a/plugins/tps/birzha/components/orderdetail/default.htm b/plugins/tps/birzha/components/orderdetail/default.htm index 04f16cc..b0f6f24 100644 --- a/plugins/tps/birzha/components/orderdetail/default.htm +++ b/plugins/tps/birzha/components/orderdetail/default.htm @@ -1,13 +1,15 @@ {% set order = __SELF__.order %} +{% set total = __SELF__.total %}
-
Zakaz
+
{{ 'zakaz.Zakaz'|_ }}
@@ -25,11 +27,11 @@
Harytlaryň jemi{{ 'checkout.HarytlarynJemi'|_ }} 0 TMT
- - - - - + + + + + @@ -45,6 +47,7 @@ + {% set total = total + (item.price * item.qty) %} {% endfor %} @@ -52,38 +55,25 @@ - -
-
-
Cart Totals
-
-
SuratHaryt adyMukdaryBahasyJemi{{ 'product.Surat'|_ }}{{ 'product.HarytAdy'|_ }}{{ 'checkout.Mukdary'|_ }}{{ 'checkout.Bahasy'|_ }}{{ 'checkout.Jemi'|_ }}
{{ item.price }} TMT {{ item.qty * item.price }} TMT
- - - - - - - - - - - - - - - - - - -
Sub Total$56.00
Shipping$10.00
VAT (10%)$5.60
Total$71.60
-
-
- Go Back - Confirm +
+
+
{{ 'checkout.Jemi'|_ }}
+
+ + + + + + + +
{{ 'checkout.HarytlarynJemi'|_ }}{{ total }} TMT
+
+ + +
diff --git a/plugins/tps/birzha/components/searchoffers/default.htm b/plugins/tps/birzha/components/searchoffers/default.htm index 282375c..60198e2 100644 --- a/plugins/tps/birzha/components/searchoffers/default.htm +++ b/plugins/tps/birzha/components/searchoffers/default.htm @@ -33,9 +33,17 @@
-
{{ product.price }} TMT
+
+ {% if product.vendor.web2 > 0 %} + {{ product.price }} TMT + {{ product.getDiscountedPrice(product.vendor.web2) }} TMT + {% else %} + {{ product.price }} TMT + {% endif %} +
+ {{ product.stock == 0 ? 'productAdd.ZakazaGelyar'|_ : 'productAdd.ElimizdeBar'|_ }}

{{ html_limit(product.description, 100) }}

- Giňişleýin maglumat + {{ 'modal.GinisleyinMaglumat'|_ }}
@@ -45,11 +53,11 @@
{% if user %} {% else %} {% endif %} @@ -87,10 +95,10 @@
-
Harytlar
+
{{ 'breadcrumbHarytlar'|_ }}
@@ -112,7 +120,7 @@
-

Şu wagtlykça bu bölümde haryt ýok

+

{{ 'product.BrandMagazinlarynHarytlaryYuklenyar'|_ }}

@@ -131,11 +139,11 @@
@@ -179,20 +187,28 @@ {% if user %} {% else %} {% endif %}

{{product.vendor.shop_title}}

{{ product.name }} -
{{ product.price }} TMT
+
+ {% if product.vendor.web2 > 0 %} + {{ product.price }} TMT + {{ product.getDiscountedPrice(product.vendor.web2) }} TMT + {% else %} + {{ product.price }} TMT + {% endif %} +
+ {{ product.stock == 0 ? 'productAdd.ZakazaGelyar'|_ : 'productAdd.ElimizdeBar'|_ }}
@@ -205,7 +221,7 @@ diff --git a/plugins/tps/birzha/components/shopsettings/default.htm b/plugins/tps/birzha/components/shopsettings/default.htm index 9d1d7b6..37dbe2a 100644 --- a/plugins/tps/birzha/components/shopsettings/default.htm +++ b/plugins/tps/birzha/components/shopsettings/default.htm @@ -4,9 +4,9 @@
-
Dükanyň sazlamalary
+
{{ 'profileDropdown.DukanSazlamalary'|_ }}
@@ -21,23 +21,18 @@
-
+ {% partial "user/menu" %} + +
- - - -
- +
+ +
diff --git a/plugins/tps/birzha/components/singleoffer/default.htm b/plugins/tps/birzha/components/singleoffer/default.htm index 69bc234..47a2d40 100644 --- a/plugins/tps/birzha/components/singleoffer/default.htm +++ b/plugins/tps/birzha/components/singleoffer/default.htm @@ -6,10 +6,10 @@
-
Haryt barada giňişleýin maglumat
+
{{ 'modal.GinisleyinMaglumat'|_ }}
@@ -66,14 +66,21 @@ {% endif %} - ({{ product.comments_count }} teswir) + ({{ product.comments_count }} {{ 'product.Kammentaria'|_ }})
-

{{ product.price }} TMT

+

+ {% if product.vendor.web2 > 0 %} + {{ product.price }} TMT + {{ product.getDiscountedPrice(product.vendor.web2) }} TMT + {% else %} + {{ product.price }} TMT + {% endif %} +

{{ product.stock == 0 ? 'productAdd.ZakazaGelyar'|_ : 'productAdd.ElimizdeBar'|_ }}

{{ product.description|raw }}

@@ -91,13 +98,13 @@
{% else %} {% endif %} {% if product.files.count > 0 %} {% endif %} @@ -112,9 +119,9 @@ data-request-data="product_id: {{ product.id }}" href="#"> {% else %} - Halanlaryma + {{ 'footer.Halanlarym'|_ }} {% endif %} - +
@@ -129,25 +136,25 @@
-
Giňişleýin maglumat
+
{{ 'modal.GinisleyinMaglumat'|_ }}

{{ product.description|raw }}

@@ -178,7 +185,7 @@
-

Teswir ýazmak

+

{{ 'product.KammentariaYazmak'|_ }}

- +
@@ -215,26 +222,14 @@
-
Goşmaça maglumatlar
+
{{ 'product.GosmacaMaglumat'|_ }}

{{ product.description|raw }}

-
Harydy yzyna gaýtarmak
-

Gowy hilli harytlary yzyna gaýtarmagyň möhleti, haryt satylanda başgaça ylalaşylmadyk bolsa, haryt alnan gününden 10 gün. Satyn alyjy tarapyndan harytlary yzyna gaýtarmagyň sebäpleri aşakdakylar bolup biler:

- -
Sebäpler
-
    -
  • Hili pes
  • -
  • Dostawka haýal
  • -
  • Başga haryt geldi
  • - -
- -
Sorag. Gelen harydyň hili pes bolan ýagdaýynda näme edip bilerin?
-

Satyn alyjy tarapyndan harytlaryň yzyna gaýtarylmagynyň sebäbi harytlaryň önümçilik kemçiligi (nikasy) bolup biler. Satyn alyjy öndüriji tarapyndan kesgitlenen kepillik möhletinde şeýle harytlaryň yzyna gaýtarylmagyny talap edip biler. Önüm üçin kepillik möhleti öndüriji tarapyndan kesgitlenmedik bolsa, şeýle harytlary yzyna gaýtarmak möhleti 2 (iki) aý.

+ {% content 'refund' %}
diff --git a/plugins/tps/birzha/components/singlesale/default.htm b/plugins/tps/birzha/components/singlesale/default.htm index 8330f51..ad1109c 100644 --- a/plugins/tps/birzha/components/singlesale/default.htm +++ b/plugins/tps/birzha/components/singlesale/default.htm @@ -6,10 +6,12 @@
-
Sargyt maglumaty
+
{{ 'order.SargytMaglumaty'|_ }}
@@ -24,36 +26,36 @@
-
Harytlar
+
{{ 'breadcrumbHarytlar'|_ }}
- - - - - + + + + + {% set total_price = 0 %} - {% for order in sales %} + {% for saleOrder in sales %} - - - - {% set total_price = total_price + (order.product.price * order.qty) %} + + + + {% set total_price = total_price + (saleOrder.product.price * saleOrder.qty) %} {% endfor %} @@ -62,33 +64,73 @@ - -
-
-
Zakaz jemi
-
-
SuratHaryt adyBahasyMukdaryUmumy{{ 'checkout.Surat'|_ }}{{ 'checkout.HarytAdy'|_ }}{{ 'checkout.Bahasy'|_ }}{{ 'checkout.Mukdary'|_ }}{{ 'checkout.Umumy'|_ }}
- - Gurluşyk, Gurluşyk platform, bezeg gurluşyk, gipsler merkezi, {{ order.product.name }} + + Gurluşyk, Gurluşyk platform, bezeg gurluşyk, gipsler merkezi, {{ saleOrder.product.name }} - {{ order.product.name }} + {{ saleOrder.product.name }} {{ order.product.price }} TMT{{ order.qty }}{{ order.product.price * order.qty }} TMT{{ saleOrder.product.price }} TMT{{ saleOrder.qty }}{{ saleOrder.product.price * saleOrder.qty }} TMT
- - - - - - -
Jemi{{ total_price }} TMT
+ +
+ +
+
+
+
{{ 'checkout.BeylekiMaglumatlar'|_ }}
+ +
+ + + + + + + + + + + + + + + + + + + + +
{{ 'checkout.Ulanyjy'|_ }}{{ order.user.name }}
{{ 'footer.TelefonTitle'|_ }}+993 {{ order.user.username }}
{{ 'checkout.Address'|_ }}{{ order.address }}
{{ 'checkout.Bellik'|_ }}{{ order.note }}
+
-
-
- - -
+
+ +
+ +
+
{{ 'checkout.Jemi'|_ }}
+
+ + + + + + + +
{{ 'checkout.Jemi'|_ }}{{ total_price }} TMT
+
+
+
+ + {% if order.status != 'new' %} + {{ 'order.Print'|_ }} + {% else %} + + {% endif %} +
+
-
+ +
diff --git a/plugins/tps/birzha/components/useroffers/default.htm b/plugins/tps/birzha/components/useroffers/default.htm index 6189f7a..71979e9 100644 --- a/plugins/tps/birzha/components/useroffers/default.htm +++ b/plugins/tps/birzha/components/useroffers/default.htm @@ -40,9 +40,17 @@
-
{{ product.price }} TMT
+
+ {% if product.vendor.web2 > 0 %} + {{ product.price }} TMT + + {{ product.vendor.web2 }} + {% else %} + {{ product.price }} TMT + {% endif %} +
{{ product.stock == 0 ? 'productAdd.ZakazaGelyar'|_ : 'productAdd.ElimizdeBar'|_ }}

{{ html_limit(product.description, 100) }}

- Giňişleýin maglumat + {{ 'modal.GinisleyinMaglumat'|_ }}
@@ -51,11 +59,11 @@
{% if user %}
- Sebede goş + {{ 'product.SebedeGos'|_ }}
{% else %}
- Sebede goş + {{ 'product.SebedeGos'|_ }}
{% endif %} @@ -94,8 +102,8 @@
@@ -126,7 +134,7 @@