diff --git a/plugins/ahmadfatoni/apigenerator/controllers/api/BlogPostsApiController.php b/plugins/ahmadfatoni/apigenerator/controllers/api/BlogPostsApiController.php
index 668482d..cf7f4c4 100644
--- a/plugins/ahmadfatoni/apigenerator/controllers/api/BlogPostsApiController.php
+++ b/plugins/ahmadfatoni/apigenerator/controllers/api/BlogPostsApiController.php
@@ -151,7 +151,9 @@ class BlogPostsApiController extends Controller
$accounts = Category::select("id","name", "icon", "is_file_category", "primary_key")
->where('id', $data["category"])
//->whereIn('id', $cats)
- ->with('users')
+ ->with(["users" => function($q){
+ $q->select("category_id", "user_id", "logo", "banner", "is_instagram");
+ }])
//->whereHas('users.categories', function($q) use($cats){
// $q->whereIn('id', $cats);
//})
@@ -165,13 +167,13 @@ class BlogPostsApiController extends Controller
//}])
->get();
- $userAccounts = User::where('type', '!=', 'simple')
- ->whereHas('categories', function($q) use($catIds){
- $q->whereIn('category_id', $catIds);
- })
- ->get();
+ //$userAccounts = User::where('type', '!=', 'simple')
+ // ->whereHas('categories', function($q) use($catIds){
+ // $q->whereIn('category_id', $catIds);
+ // })
+ // ->get();
- $accounts[0]->users = $userAccounts;
+ //$accounts[0]->users = $userAccounts;
$banners = Category::select("id","name", "icon", "is_file_category", "primary_key")
->where('id', $data["category"])
@@ -522,22 +524,23 @@ class BlogPostsApiController extends Controller
$data = $request->all();
$dataAccounts = User::where('type', '!=', 'simple')->select('id', 'name', 'email', 'username', 'type', 'logo', 'shop_title', 'slogan', 'work_time', 'short_description', 'description', 'map', 'banner', 'is_instagram')
+ //->where('is_category', 1)
->with('categories:id,name,slug,icon')
- ->paginate(9);
+ ->paginate(99);
if($data && $data["type"] == "home"){
$dataAccounts = User::where('is_featured', 1)
- ->select('id', 'name', 'email', 'username', 'type', 'logo', 'shop_title', 'slogan', 'work_time', 'short_description', 'description', 'map', 'banner', 'is_instagram')
+ ->select('id', 'name', 'email', 'username', 'type', 'logo', 'shop_title', 'slogan', 'work_time', 'short_description', 'description', 'map', 'banner', 'is_instagram', 'banner')
->with('categories:id,name,slug,icon')
- ->paginate(9);
+ ->paginate(99);
}elseif($data && $data["type"] == "category"){
$dataAccounts = User::where('is_category', 1)
- ->select('id', 'name', 'email', 'username', 'type', 'logo', 'shop_title', 'slogan', 'work_time', 'short_description', 'description', 'map', 'is_instagram')
+ ->select('id', 'name', 'email', 'username', 'type', 'logo', 'shop_title', 'slogan', 'work_time', 'short_description', 'description', 'map', 'is_instagram', 'banner')
->with('categories:id,name,slug,icon')
- ->paginate(9);
+ ->paginate(99);
}
//$dataSlider["img"] = $path.$dataSlider["img"];
diff --git a/plugins/ahmadfatoni/apigenerator/controllers/api/ProductsApiController.php b/plugins/ahmadfatoni/apigenerator/controllers/api/ProductsApiController.php
index 5f1d069..70dc179 100644
--- a/plugins/ahmadfatoni/apigenerator/controllers/api/ProductsApiController.php
+++ b/plugins/ahmadfatoni/apigenerator/controllers/api/ProductsApiController.php
@@ -309,7 +309,7 @@ class ProductsAPIController extends Controller
$data->map(function ($product) {
$image = new Image($product->images[0]->path);
- $product->images[0]->compressed_image = $image->resize(510)->getCachedImagePath(true);
+ $product->images[0]->compressed_image = $image->resize(310)->getCachedImagePath(true);
return $product;
@@ -356,6 +356,8 @@ class ProductsAPIController extends Controller
// step1
public function store(Request $request){
$data = $request->all();
+
+ $currentUser = \JWTAuth::parseToken()->authenticate();
// dd($data);
$rules = [
//'name_ru' => 'required',
@@ -425,14 +427,20 @@ class ProductsAPIController extends Controller
$product->description = $data['description_tm'];
- $product->short_description = $data['short_description'];
+ //$product->short_description = $data['short_description'];
$product->slug = \Str::slug($data['name_tm'],'-');
$product->status = 'new';
$product->place_id = $data['place_id'];
$product->price = $data['price'];
- $product->phone = $data['phone'];
+
+ if($data['phone'] == $currentUser->username){
+ $product->phone = null;
+ }else{
+ $product->phone = $data['phone'];
+ }
+
$product->stock = $data['stock'];
$product->is_file_product = $data['is_file'];
@@ -707,7 +715,7 @@ class ProductsAPIController extends Controller
$attachedProduct->description = $data['description_tm'];
- $attachedProduct->short_description = $data['short_description'];
+ //$attachedProduct->short_description = $data['short_description'];
$attachedProduct->slug = \Str::slug($data['name_tm'],'-');
@@ -723,7 +731,14 @@ class ProductsAPIController extends Controller
$attachedProduct->is_file_product = $data['is_file'];
- $attachedProduct->save();
+ $category = Category::find($data['category_id']);
+
+ // detach from all other categories
+ $attachedProduct->categories()->detach();
+ // attach to a new category
+ $category->products()->save($attachedProduct);
+
+ $attachedProduct->save();
return $attachedProduct;
}
@@ -839,6 +854,16 @@ class ProductsAPIController extends Controller
->orderBy('updated_at', 'desc')
->paginate($perPage);
+
+ $products->map(function ($product) {
+
+ $image = new Image($product->images[0]->path);
+ $product->images[0]->compressed_image = $image->resize(510)->getCachedImagePath(true);
+
+ return $product;
+
+
+ });
} catch (\Throwable $th) {
return $this->helpers->apiArrayResponseBuilder(500, 'server error', ['message' => 'Something went wrong']);
diff --git a/plugins/rainlab/user/models/User.php b/plugins/rainlab/user/models/User.php
index ed21fa3..c87896e 100644
--- a/plugins/rainlab/user/models/User.php
+++ b/plugins/rainlab/user/models/User.php
@@ -266,7 +266,7 @@ class User extends UserBase
public function scopeIsFeatured($query)
{
- return $query->where('is_featured', 1)->where('type', '!=', 'simple');
+ return $query->where('is_featured', 1)->where('type', '!=', 'simple')->where('banner', '!=', '');
}
/**
diff --git a/plugins/tps/birzha/components/Messages.php b/plugins/tps/birzha/components/Messages.php
index 13ee086..891b62e 100644
--- a/plugins/tps/birzha/components/Messages.php
+++ b/plugins/tps/birzha/components/Messages.php
@@ -32,8 +32,10 @@ class Messages extends ComponentBase
$room->message_partner = $room->users()->where('users.id','!=',Auth::user()->id)->first();
$room->count_unread_messages = $room->messages()->where('read_at',null)->where('reciver_id',Auth::user()->id)->count();
- if($room->message_partner->id == $sellerId) {
- $newChatRoomNeeded = false;
+ if($room->message_partner){
+ if($room->message_partner->id == $sellerId) {
+ $newChatRoomNeeded = false;
+ }
}
}
// dump($this->chatrooms);
diff --git a/plugins/tps/birzha/components/OfferForm.php b/plugins/tps/birzha/components/OfferForm.php
index 3c88f85..54fbf33 100644
--- a/plugins/tps/birzha/components/OfferForm.php
+++ b/plugins/tps/birzha/components/OfferForm.php
@@ -62,6 +62,75 @@ class OfferForm extends ComponentBase
],
];
}
+
+
+ public function onSetCategoryModal(){
+
+ $categories = Category::where('primary_key', 0)->get();
+
+
+ $html = '';
+
+ for ($x = 0; $x < count($categories); $x++) {
+
+ $html .= '
';
+
+ }
+
+
+ return [
+ '#modal_content' => $html
+ ];
+
+ }
+
+
+ public function onGetSubCategory(){
+
+ $data = post();
+
+ $categories = Category::where('primary_key', $data['id'])->get();
+
+ $html='';
+
+ if(count($categories) != 0){
+
+ for ($x = 0; $x < count($categories); $x++) {
+
+ $html .= '';
+
+ }
+
+ return [
+ '#modal_content' => $html,
+ ];
+
+ }else{
+
+ $selected = Category::where('id', $data['id'])->first();
+
+ $setCategory = $this->renderPartial('@setCat', ['catId' => $selected->id]);
+
+ return [
+ '#close_modal' => $this->renderPartial('@close_modal'),
+ '#set_cat' => $setCategory,
+ '#category_title' => $selected->name
+ ];
+
+
+ }
+
+
+ }
+
public function onSave(){
@@ -70,7 +139,7 @@ class OfferForm extends ComponentBase
'name' => 'required',
'price' => 'required|numeric',
'state_id' => 'required',
- 'stock' => 'required|numeric|min:0|max:1',
+ 'stock' => 'required|',
'description' => 'required',
'new_img' => 'array|required',
// 'is_file' => 'required',
@@ -118,15 +187,20 @@ class OfferForm extends ComponentBase
$place = $data['state_id'];
}
+ $phone = null;
+ if($data["phone"] != "" && $data["phone"] != Auth::user()->username){
+ $phone = $data["phone"];
+ }
+
$product = new Product;
$product->name = $data['name'];
$product->description = $data['description'];
- $product->short_description = $data['short_description'];
+ //$product->short_description = $data['short_description'];
$product->slug = \Str::slug($data['name'],'-');
$product->status = 'new';
$product->place_id = $place;
$product->price = $data['price'];
- $product->phone = $data['phone'];
+ $product->phone = $phone;
$product->is_file_product = $data['is_file'];
$product->stock = $data['stock'];
$product->keyword = $keyword;
@@ -185,7 +259,7 @@ class OfferForm extends ComponentBase
'name' => 'required',
'price' => 'required|numeric',
'state_id' => 'required',
- 'stock' => 'required|numeric|min:0|max:1',
+ 'stock' => 'required',
'description' => 'required',
'new_img' => 'array',
// 'is_file' => 'required',
@@ -226,15 +300,21 @@ class OfferForm extends ComponentBase
}
}
+ $phone = null;
+ if($data["phone"] != "" && $data["phone"] != Auth::user()->username){
+ $phone = $data["phone"];
+ }
+
+
$product->name = $data['name'];
$product->description = $data['description'];
- $product->short_description = $data['short_description'];
+ //$product->short_description = $data['short_description'];
$product->slug = \Str::slug($data['name'],'-');
$product->status = 'new';
$product->place_id = $data['city_id'] == 'null' ? $data['state_id'] : $data['city_id'];
$product->price = $data['price'];
- $product->phone = $data['phone'];
+ $product->phone = $phone;
$product->is_file_product = $data['is_file'];
$product->stock = $data['stock'];
$product->keyword = $keyword;
@@ -435,7 +515,7 @@ class OfferForm extends ComponentBase
if($this->productIdOption) {
- $this->productForEditing = Product::where("vendor_id", \Auth::user()->id)->where("id", $this->productIdOption)->first();
+ $this->productForEditing = Product::where("vendor_id", \Auth::user()->id)->with('categories')->where("id", $this->productIdOption)->first();
if(!$this->productForEditing){
return \Redirect::to('/');
}
diff --git a/plugins/tps/birzha/components/UserOffers.php b/plugins/tps/birzha/components/UserOffers.php
index 2884ef9..726c868 100644
--- a/plugins/tps/birzha/components/UserOffers.php
+++ b/plugins/tps/birzha/components/UserOffers.php
@@ -195,8 +195,10 @@ class UserOffers extends ComponentBase
$chatrooms = \Auth::user()->chatrooms;
foreach($chatrooms as $room) {
$room->message_partner = $room->users()->where('users.id','!=',\Auth::user()->id)->first();
- if($room->message_partner->id == $this->property('id')) {
- return $room;
+ if($room->message_partner){
+ if($room->message_partner->id == $this->property('id')) {
+ return $room;
+ }
}
}
$seller = User::findOrFail($this->property('id'));
diff --git a/plugins/tps/birzha/components/categoryprofile/default.htm b/plugins/tps/birzha/components/categoryprofile/default.htm
index 9455590..af505a1 100644
--- a/plugins/tps/birzha/components/categoryprofile/default.htm
+++ b/plugins/tps/birzha/components/categoryprofile/default.htm
@@ -307,7 +307,7 @@
{% if user %}
-
+
@@ -330,7 +330,9 @@
{{ product.price }} TMT
{% endif %}
-
{{ product.stock == 0 ? 'productAdd.ZakazaGelyar'|_ : 'productAdd.ElimizdeBar'|_ }}
+ {% if product.stock != 'not_selected' %}
+
{{ product.stock == 0 ? 'productAdd.ZakazaGelyar'|_ : 'productAdd.ElimizdeBar'|_ }}
+ {% endif %}
@@ -370,7 +372,7 @@
{% if user %}
-
+
@@ -393,7 +395,9 @@
{{ product.price }} TMT
{% endif %}
-
{{ product.stock == 0 ? 'productAdd.ZakazaGelyar'|_ : 'productAdd.ElimizdeBar'|_ }}
+ {% if product.stock != 'not_selected' %}
+
{{ product.stock == 0 ? 'productAdd.ZakazaGelyar'|_ : 'productAdd.ElimizdeBar'|_ }}
+ {% endif %}
@@ -458,11 +462,11 @@
{% if user %}
-
+
{% else %}
-
{% if user %}
-
+
{% else %}
-
+
{% endif %}
diff --git a/plugins/tps/birzha/components/filteredproducts/default.htm b/plugins/tps/birzha/components/filteredproducts/default.htm
index 76428d4..b3ad44f 100644
--- a/plugins/tps/birzha/components/filteredproducts/default.htm
+++ b/plugins/tps/birzha/components/filteredproducts/default.htm
@@ -216,7 +216,10 @@
{% else %}
{{ product.price }} TMT
{% endif %}
-
{{ product.stock == 0 ? 'productAdd.ZakazaGelyar'|_ : 'productAdd.ElimizdeBar'|_ }}
+
+ {% if product.stock != 'not_selected' %}
+
{{ product.stock == 0 ? 'productAdd.ZakazaGelyar'|_ : 'productAdd.ElimizdeBar'|_ }}
+ {% endif %}
{{ html_limit(product.description, 100) }}
{{ 'modal.GinisleyinMaglumat'|_ }}
@@ -226,11 +229,11 @@
{% if user %}
-
+
{% else %}
-
+
{% endif %}
@@ -311,7 +314,7 @@
{% if user %}
-
+
@@ -334,7 +337,9 @@
{{ product.price }} TMT
{% endif %}
-
{{ product.stock == 0 ? 'productAdd.ZakazaGelyar'|_ : 'productAdd.ElimizdeBar'|_ }}
+ {% if product.stock != 'not_selected' %}
+
{{ product.stock == 0 ? 'productAdd.ZakazaGelyar'|_ : 'productAdd.ElimizdeBar'|_ }}
+ {% endif %}
diff --git a/plugins/tps/birzha/components/offerform/close_modal.htm b/plugins/tps/birzha/components/offerform/close_modal.htm
new file mode 100644
index 0000000..b1914fd
--- /dev/null
+++ b/plugins/tps/birzha/components/offerform/close_modal.htm
@@ -0,0 +1,5 @@
+
\ No newline at end of file
diff --git a/plugins/tps/birzha/components/offerform/setCat.htm b/plugins/tps/birzha/components/offerform/setCat.htm
new file mode 100644
index 0000000..0ff6edc
--- /dev/null
+++ b/plugins/tps/birzha/components/offerform/setCat.htm
@@ -0,0 +1,6 @@
+
\ No newline at end of file
diff --git a/plugins/tps/birzha/components/offers/default.htm b/plugins/tps/birzha/components/offers/default.htm
index 5fac77f..34cf571 100644
--- a/plugins/tps/birzha/components/offers/default.htm
+++ b/plugins/tps/birzha/components/offers/default.htm
@@ -42,7 +42,10 @@
{% else %}
{{ product.price }} TMT
{% endif %}
-
{{ product.stock == 0 ? 'productAdd.ZakazaGelyar'|_ : 'productAdd.ElimizdeBar'|_ }}
+
+ {% if product.stock != 'not_selected' %}
+
{{ product.stock == 0 ? 'productAdd.ZakazaGelyar'|_ : 'productAdd.ElimizdeBar'|_ }}
+ {% endif %}
{{ html_limit(product.description, 100) }}
{{ 'modal.GinisleyinMaglumat'|_ }}
@@ -52,11 +55,11 @@
{% if user %}
-
+
{% else %}
-
+
{% endif %}
@@ -338,7 +341,7 @@
{% if user %}
-
+
@@ -361,7 +364,9 @@
{{ product.price }} TMT
{% endif %}
-
{{ product.stock == 0 ? 'productAdd.ZakazaGelyar'|_ : 'productAdd.ElimizdeBar'|_ }}
+ {% if product.stock != 'not_selected' %}
+
{{ product.stock == 0 ? 'productAdd.ZakazaGelyar'|_ : 'productAdd.ElimizdeBar'|_ }}
+ {% endif %}
diff --git a/plugins/tps/birzha/components/searchoffers/default.htm b/plugins/tps/birzha/components/searchoffers/default.htm
index 60198e2..1e6b94d 100644
--- a/plugins/tps/birzha/components/searchoffers/default.htm
+++ b/plugins/tps/birzha/components/searchoffers/default.htm
@@ -41,7 +41,9 @@
{{ product.price }} TMT
{% endif %}
-
{{ product.stock == 0 ? 'productAdd.ZakazaGelyar'|_ : 'productAdd.ElimizdeBar'|_ }}
+ {% if product.stock != 'not_selected' %}
+
{{ product.stock == 0 ? 'productAdd.ZakazaGelyar'|_ : 'productAdd.ElimizdeBar'|_ }}
+ {% endif %}
{{ html_limit(product.description, 100) }}
{{ 'modal.GinisleyinMaglumat'|_ }}
@@ -52,11 +54,11 @@
{% if user %}
-
+
{% else %}
-
+
{% endif %}
@@ -185,7 +187,7 @@
{% if user %}
-
+
@@ -208,7 +210,9 @@
{{ product.price }} TMT
{% endif %}
-
{{ product.stock == 0 ? 'productAdd.ZakazaGelyar'|_ : 'productAdd.ElimizdeBar'|_ }}
+ {% if product.stock != 'not_selected' %}
+
{{ product.stock == 0 ? 'productAdd.ZakazaGelyar'|_ : 'productAdd.ElimizdeBar'|_ }}
+ {% endif %}
diff --git a/plugins/tps/birzha/components/singleoffer/default.htm b/plugins/tps/birzha/components/singleoffer/default.htm
index 2c1ee69..84d5941 100644
--- a/plugins/tps/birzha/components/singleoffer/default.htm
+++ b/plugins/tps/birzha/components/singleoffer/default.htm
@@ -102,7 +102,10 @@
{% else %}
{{ product.price }} TMT
{% endif %}
-
{{ product.stock == 0 ? 'productAdd.ZakazaGelyar'|_ : 'productAdd.ElimizdeBar'|_ }}
+
+ {% if product.stock != 'not_selected' %}
+
{{ product.stock == 0 ? 'productAdd.ZakazaGelyar'|_ : 'productAdd.ElimizdeBar'|_ }}
+ {% endif %}
@@ -128,11 +131,11 @@
{% if user %}
-
+
{% else %}
-
+
{% endif %}
diff --git a/plugins/tps/birzha/components/useroffers/default.htm b/plugins/tps/birzha/components/useroffers/default.htm
index 1e7dd4d..866b9d0 100644
--- a/plugins/tps/birzha/components/useroffers/default.htm
+++ b/plugins/tps/birzha/components/useroffers/default.htm
@@ -48,7 +48,10 @@
{% else %}
{{ product.price }} TMT
{% endif %}
-
{{ product.stock == 0 ? 'productAdd.ZakazaGelyar'|_ : 'productAdd.ElimizdeBar'|_ }}
+
+ {% if product.stock != 'not_selected' %}
+
{{ product.stock == 0 ? 'productAdd.ZakazaGelyar'|_ : 'productAdd.ElimizdeBar'|_ }}
+ {% endif %}
{{ html_limit(product.description, 100) }}
{{ 'modal.GinisleyinMaglumat'|_ }}
@@ -58,11 +61,11 @@
{% if user %}
-
+
{% else %}
-
+
{% endif %}
diff --git a/plugins/tps/birzha/components/vipproducts/default.htm b/plugins/tps/birzha/components/vipproducts/default.htm
index c8b8202..338ef7d 100644
--- a/plugins/tps/birzha/components/vipproducts/default.htm
+++ b/plugins/tps/birzha/components/vipproducts/default.htm
@@ -45,7 +45,10 @@
{% else %}
{{ product.price }} TMT
{% endif %}
-
{{ product.stock == 0 ? 'productAdd.ZakazaGelyar'|_ : 'productAdd.ElimizdeBar'|_ }}
+
+ {% if product.stock != 'not_selected' %}
+
{{ product.stock == 0 ? 'productAdd.ZakazaGelyar'|_ : 'productAdd.ElimizdeBar'|_ }}
+ {% endif %}
{{ html_limit(product.description, 100) }}
{{ 'modal.GinisleyinMaglumat'|_ }}
@@ -55,11 +58,11 @@
{% if user %}
-
+
{% else %}
-
+
{% endif %}
@@ -253,7 +256,7 @@
{% if user %}
-
+
@@ -276,7 +279,9 @@
{{ product.price }} TMT
{% endif %}
-
{{ product.stock == 0 ? 'productAdd.ZakazaGelyar'|_ : 'productAdd.ElimizdeBar'|_ }}
+ {% if product.stock != 'not_selected' %}
+
{{ product.stock == 0 ? 'productAdd.ZakazaGelyar'|_ : 'productAdd.ElimizdeBar'|_ }}
+ {% endif %}
diff --git a/plugins/tps/birzha/models/product/columns.yaml b/plugins/tps/birzha/models/product/columns.yaml
index 5f14ea5..0ccca94 100644
--- a/plugins/tps/birzha/models/product/columns.yaml
+++ b/plugins/tps/birzha/models/product/columns.yaml
@@ -40,3 +40,9 @@ columns:
label: 'POZULAN SENE'
type: datetime
sortable: true
+ phone:
+ label: Telefon2
+ type: text
+ searchable: true
+ invisible: false
+ sortable: true
diff --git a/plugins/tps/birzha/models/product/fields.yaml b/plugins/tps/birzha/models/product/fields.yaml
index 00c23f9..5824306 100644
--- a/plugins/tps/birzha/models/product/fields.yaml
+++ b/plugins/tps/birzha/models/product/fields.yaml
@@ -123,10 +123,13 @@ tabs:
tab: Status
stock:
label: 'Elinizde Barmy?'
+ options:
+ 0: 'Sargyda Gelyar'
+ 1: 'Elimizde bar'
+ not_selected: Saylanmadyk
span: auto
- default: 1
- type: switch
- comment: 'elinizde bar bolsa achyk durmaly'
+ default: not_selected
+ type: balloon-selector
tab: Status
keyword:
label: 'Gozlenende chykmaly sozler'
diff --git a/plugins/tps/birzha/updates/builder_table_update_tps_birzha_products_42.php b/plugins/tps/birzha/updates/builder_table_update_tps_birzha_products_42.php
new file mode 100644
index 0000000..3bd2468
--- /dev/null
+++ b/plugins/tps/birzha/updates/builder_table_update_tps_birzha_products_42.php
@@ -0,0 +1,23 @@
+string('stock')->nullable()->unsigned(false)->default('not_selected')->change();
+ });
+ }
+
+ public function down()
+ {
+ Schema::table('tps_birzha_products', function($table)
+ {
+ $table->boolean('stock')->nullable(false)->unsigned(false)->default(1)->change();
+ });
+ }
+}
diff --git a/plugins/tps/birzha/updates/version.yaml b/plugins/tps/birzha/updates/version.yaml
index 1fb24c9..813bce9 100644
--- a/plugins/tps/birzha/updates/version.yaml
+++ b/plugins/tps/birzha/updates/version.yaml
@@ -461,3 +461,6 @@
1.0.160:
- 'Updated table tps_birzha_products'
- builder_table_update_tps_birzha_products_41.php
+1.0.161:
+ - 'Updated table tps_birzha_products'
+ - builder_table_update_tps_birzha_products_42.php
diff --git a/themes/gurlushyk/meta/menus/top-menu.yaml b/themes/gurlushyk/meta/menus/top-menu.yaml
index 07403df..eb02077 100644
--- a/themes/gurlushyk/meta/menus/top-menu.yaml
+++ b/themes/gurlushyk/meta/menus/top-menu.yaml
@@ -87,14 +87,10 @@ items:
cssClass: '1'
isExternal: '0'
-
- title: 'Agaç önümleri'
- nesting: null
+ title: 'Mebel önümleri'
type: url
url: /category-profile/agac-onumleri
code: ''
- reference: null
- cmsPage: null
- replace: null
viewBag:
locale:
ru:
@@ -192,7 +188,7 @@ items:
isExternal: '0'
items:
-
- title: 'Rother elektrik'
+ title: 'VA TRADE'
nesting: null
type: url
url: /category-profile/rother-elektrik
diff --git a/themes/gurlushyk/pages/addProduct.htm b/themes/gurlushyk/pages/addProduct.htm
index 8da006f..9335f50 100644
--- a/themes/gurlushyk/pages/addProduct.htm
+++ b/themes/gurlushyk/pages/addProduct.htm
@@ -67,22 +67,16 @@ productId = "{{ :productId }}"
enctype="multipart/form-data">
-
+
{{ 'productAdd.Kategoriya'|_ }}
-
- {{ 'productAdd.KategoriyaSayla'|_ }}
- {% for category in categories %}
- {{ category.name }}
- {% endfor %}
-
-
-
- {{ 'productAdd.IkinjiKategoriya'|_ }}
-
- {{ 'productAdd.Subkategoriya'|_ }}
-
-
+
+ Kategoriýa saýla
+
+
+
+
+
{{ 'productAdd.Welayat'|_ }}
@@ -107,21 +101,23 @@ productId = "{{ :productId }}"
{{ 'productAdd.Bahasy'|_ }}
-
+
{{ 'productAdd.GinsileyinBeyany'|_ }}
{{ 'productAdd.TelefonBelgisi2'|_ }}
-
+ +993
+
{{ 'productAdd.SkladdaBarmy'|_ }} ?
+ {{ 'productAdd.NotSelected'|_ }}
{{ 'productAdd.ElimizdeBar'|_ }}
{{ 'productAdd.ZakazaGelyar'|_ }}
@@ -152,49 +148,14 @@ productId = "{{ :productId }}"
enctype="multipart/form-data">
-
- {{ 'productAdd.Kategoriya'|_ }}
-
- {{ 'productAdd.KategoriyaSayla'|_ }}
- {% for category in categories %}
- {% for prodCat in productForEditing.categories %}
- {% if prodCat.primary_key == 0 %}
- {{ category.name }}
- {% elseif prodCat.parent.parent %}
- {{ category.name }}
- {% else %}
- {{ category.name }}
- {% endif %}
- {% endfor %}
- {% endfor %}
-
-
-
-
{{ 'productAdd.IkinjiKategoriya'|_ }}
-
-
-
- {% for prodCat in productForEditing.categories %}
- {% if prodCat.primary_key == 0 %}
- Birinji dereje Sub-kategoriýa saýla
- {% else %}
- {% if prodCat.subs.count > 0 %}
- {{ prodCat.name }}
- {% for sub in prodCat.subs %}
- {{ sub.name }}
- {% endfor %}
- {% else %}
- {% set secondLevelCategory = prodCat.parent %}
- {{ secondLevelCategory.name }}
- {% for thirdLevel in secondLevelCategory.subs %}
- {{ thirdLevel.name }}
- {% endfor %}
- {% endif %}
- {% endif %}
- {% endfor %}
-
-
-
+
+ {{ 'productAdd.Kategoriya'|_ }}
+
+ {{productForEditing.categories[0].name}}
+
+
+
+
{{ 'productAdd.Welayat'|_ }}
@@ -223,22 +184,24 @@ productId = "{{ :productId }}"
{{ 'productAdd.Bahasy'|_ }}
-
- {{ 'productAdd.GysgaBeyany'|_ }}
-
-
+
{{ 'productAdd.GinsileyinBeyany'|_ }}
- {{ 'productAdd.TelefonBelgisi'|_ }}
-
+ {{ 'productAdd.TelefonBelgisi2'|_ }}
+ +993
+
{{ 'productAdd.SkladdaBarmy'|_ }} ?
+ {{ 'productAdd.NotSelected'|_ }}
{{ 'productAdd.ElimizdeBar'|_ }}
{{ 'productAdd.ZakazaGelyar'|_ }}
@@ -295,6 +258,35 @@ productId = "{{ :productId }}"
+
+
+
+
+
+
+
+
+
+
+
@@ -347,7 +339,7 @@ function getCategoriesForEdit(catId) {
$(document).ready(function() {
- $('input[name*="phone"]').inputmask("+99399999999");
+
$("#category").on("change", function() {
var selectedValue = $(this).val();
var isFile = $(this).find(':selected').data('file');
diff --git a/themes/gurlushyk/partials/product/card-item.htm b/themes/gurlushyk/partials/product/card-item.htm
index 3cf56ee..120f9d2 100644
--- a/themes/gurlushyk/partials/product/card-item.htm
+++ b/themes/gurlushyk/partials/product/card-item.htm
@@ -20,7 +20,7 @@
{% if user %}
-
+
@@ -44,6 +44,8 @@
{{ product.price }} TMT
{% endif %}
-
{{ product.stock == 0 ? 'productAdd.ZakazaGelyar'|_ : 'productAdd.ElimizdeBar'|_ }}
+ {% if product.stock != 'not_selected' %}
+
{{ product.stock == 0 ? 'productAdd.ZakazaGelyar'|_ : 'productAdd.ElimizdeBar'|_ }}
+ {% endif %}
\ No newline at end of file
diff --git a/themes/gurlushyk/partials/profile/style1.htm b/themes/gurlushyk/partials/profile/style1.htm
index ff38372..c01d748 100644
--- a/themes/gurlushyk/partials/profile/style1.htm
+++ b/themes/gurlushyk/partials/profile/style1.htm
@@ -116,7 +116,7 @@
{% if user %}
-
+
diff --git a/themes/gurlushyk/partials/profile/style2.htm b/themes/gurlushyk/partials/profile/style2.htm
index dc2ef54..cc554db 100644
--- a/themes/gurlushyk/partials/profile/style2.htm
+++ b/themes/gurlushyk/partials/profile/style2.htm
@@ -87,7 +87,7 @@