from server 06_12
This commit is contained in:
parent
74772a818c
commit
4b384fafe7
|
|
@ -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"];
|
||||
|
|
|
|||
|
|
@ -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'];
|
||||
|
||||
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,6 +731,13 @@ class ProductsAPIController extends Controller
|
|||
|
||||
$attachedProduct->is_file_product = $data['is_file'];
|
||||
|
||||
$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;
|
||||
|
|
@ -840,6 +855,16 @@ class ProductsAPIController extends Controller
|
|||
->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']);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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', '!=', '');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -32,10 +32,12 @@ 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){
|
||||
if($room->message_partner->id == $sellerId) {
|
||||
$newChatRoomNeeded = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
// dump($this->chatrooms);
|
||||
|
||||
if($sellerId) {
|
||||
|
|
|
|||
|
|
@ -64,13 +64,82 @@ class OfferForm extends ComponentBase
|
|||
}
|
||||
|
||||
|
||||
public function onSetCategoryModal(){
|
||||
|
||||
$categories = Category::where('primary_key', 0)->get();
|
||||
|
||||
|
||||
$html = '';
|
||||
|
||||
for ($x = 0; $x < count($categories); $x++) {
|
||||
|
||||
$html .= '<div class="card-header" style="padding: 1px;">
|
||||
<button data-request="onGetSubCategory" data-request-data="id: '.$categories[$x]->id.'" class="btn" type="button" style="font-size: 12px;text-align: left;">
|
||||
'.$categories[$x]->name.'
|
||||
</button>
|
||||
</div>';
|
||||
|
||||
}
|
||||
|
||||
|
||||
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 .= '<div class="card-header" style="padding: 1px;">
|
||||
<button data-request="onGetSubCategory" data-request-data="id: '.$categories[$x]->id.'" class="btn" type="button" style="font-size: 12px;text-align: left;">
|
||||
'.$categories[$x]->name.'
|
||||
</button>
|
||||
</div>';
|
||||
|
||||
}
|
||||
|
||||
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(){
|
||||
$data = post();
|
||||
$rules = [
|
||||
'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('/');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -195,10 +195,12 @@ 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){
|
||||
if($room->message_partner->id == $this->property('id')) {
|
||||
return $room;
|
||||
}
|
||||
}
|
||||
}
|
||||
$seller = User::findOrFail($this->property('id'));
|
||||
$chatroom = new Chatroom;
|
||||
$chatroom->save();
|
||||
|
|
|
|||
|
|
@ -307,7 +307,7 @@
|
|||
<div class="product_description">
|
||||
<!-- Add to cart -->
|
||||
{% if user %}
|
||||
<div class="product_add_to_cart addToCard" data-id="{{ product.id }}" data-price="{{ product.price }}" data-image="{{ product.images[0].path }}" data-name="{{ product.name }}" data-vendor="{{ product.vendor.id }}">
|
||||
<div class="product_add_to_cart addToCard" data-id="{{ product.id }}" data-price="{{ product.getDiscountedPrice(product.vendor.web2) }}" data-image="{{ product.images[0].path }}" data-name="{{ product.name }}" data-vendor="{{ product.vendor.id }}">
|
||||
<input type="hidden" min="1" id="quantity{{ product.id }}" value="1">
|
||||
<a href="#"><i class="icofont-shopping-cart"></i> {{ 'product.SebedeGos'|_ }}</a>
|
||||
</div>
|
||||
|
|
@ -330,7 +330,9 @@
|
|||
{{ product.price }} TMT
|
||||
{% endif %}
|
||||
</h6>
|
||||
{% if product.stock != 'not_selected' %}
|
||||
<span class="badge mt-2 {{ product.stock == 0 ? 'badge-secondary' : 'badge-success' }}">{{ product.stock == 0 ? 'productAdd.ZakazaGelyar'|_ : 'productAdd.ElimizdeBar'|_ }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -370,7 +372,7 @@
|
|||
<div class="product_description">
|
||||
<!-- Add to cart -->
|
||||
{% if user %}
|
||||
<div class="product_add_to_cart addToCard" data-id="{{ product.id }}" data-price="{{ product.price }}" data-image="{{ product.images[0].path }}" data-name="{{ product.name }}" data-vendor="{{ product.vendor.id }}">
|
||||
<div class="product_add_to_cart addToCard" data-id="{{ product.id }}" data-price="{{ product.getDiscountedPrice(product.vendor.web2) }}" data-image="{{ product.images[0].path }}" data-name="{{ product.name }}" data-vendor="{{ product.vendor.id }}">
|
||||
<input type="hidden" min="1" id="quantity{{ product.id }}" value="1">
|
||||
<a href="#"><i class="icofont-shopping-cart"></i> {{ 'product.SebedeGos'|_ }}</a>
|
||||
</div>
|
||||
|
|
@ -393,7 +395,9 @@
|
|||
{{ product.price }} TMT
|
||||
{% endif %}
|
||||
</h6>
|
||||
{% if product.stock != 'not_selected' %}
|
||||
<span class="badge mt-2 {{ product.stock == 0 ? 'badge-secondary' : 'badge-success' }}">{{ product.stock == 0 ? 'productAdd.ZakazaGelyar'|_ : 'productAdd.ElimizdeBar'|_ }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -458,11 +462,11 @@
|
|||
<input type="number" class="qty-text form-control" id="quantity{{ product.id }}" step="1" min="1" value="1">
|
||||
</div>
|
||||
{% if user %}
|
||||
<div class="product_add_to_cart addToCard" data-id="{{ product.id }}" data-price="{{ product.price }}" data-image="{{ product.images[0].path }}" data-name="{{ product.name }}" data-vendor="{{ product.vendor.id }}">
|
||||
<div class="product_add_to_cart addToCard" data-id="{{ product.id }}" data-price="{{ product.getDiscountedPrice(product.vendor.web2) }}" data-image="{{ product.images[0].path }}" data-name="{{ product.name }}" data-vendor="{{ product.vendor.id }}">
|
||||
<a href="#" class="btn btn-primary mt-1 mt-md-0 ml-1 ml-md-3">{{ 'product.SebedeGos'|_ }}</a>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="product_add_to_cart" data-id="{{ product.id }}" data-price="{{ product.price }}" data-image="{{ product.images[0].path }}" data-name="{{ product.name }}" data-vendor="{{ product.vendor.id }}">
|
||||
<div class="product_add_to_cart" data-id="{{ product.id }}" data-price="{{ product.getDiscountedPrice(product.vendor.web2) }}" data-image="{{ product.images[0].path }}" data-name="{{ product.name }}" data-vendor="{{ product.vendor.id }}">
|
||||
<a href="{{ 'login'|page }}" class="btn btn-primary mt-1 mt-md-0 ml-1 ml-md-3">{{ 'product.SebedeGos'|_ }}</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
|
@ -539,11 +543,11 @@
|
|||
<input type="number" class="qty-text form-control" id="quantity{{ product.id }}" step="1" min="1" value="1">
|
||||
</div>
|
||||
{% if user %}
|
||||
<div class="product_add_to_cart addToCard" data-id="{{ product.id }}" data-price="{{ product.price }}" data-image="{{ product.images[0].path }}" data-name="{{ product.name }}" data-vendor="{{ product.vendor.id }}">
|
||||
<div class="product_add_to_cart addToCard" data-id="{{ product.id }}" data-price="{{ product.getDiscountedPrice(product.vendor.web2) }}" data-image="{{ product.images[0].path }}" data-name="{{ product.name }}" data-vendor="{{ product.vendor.id }}">
|
||||
<a href="#" class="btn btn-primary mt-1 mt-md-0 ml-1 ml-md-3">{{ 'product.SebedeGos'|_ }}</a>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="product_add_to_cart" data-id="{{ product.id }}" data-price="{{ product.price }}" data-image="{{ product.images[0].path }}" data-name="{{ product.name }}" data-vendor="{{ product.vendor.id }}">
|
||||
<div class="product_add_to_cart" data-id="{{ product.id }}" data-price="{{ product.getDiscountedPrice(product.vendor.web2) }}" data-image="{{ product.images[0].path }}" data-name="{{ product.name }}" data-vendor="{{ product.vendor.id }}">
|
||||
<a href="{{ 'login'|page }}" class="btn btn-primary mt-1 mt-md-0 ml-1 ml-md-3">{{ 'product.SebedeGos'|_ }}</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
|
|
|||
|
|
@ -216,7 +216,10 @@
|
|||
{% else %}
|
||||
{{ product.price }} TMT
|
||||
{% endif %}
|
||||
</h5> <span class="badge ml-2 {{ product.stock == 0 ? 'badge-secondary' : 'badge-success' }}">{{ product.stock == 0 ? 'productAdd.ZakazaGelyar'|_ : 'productAdd.ElimizdeBar'|_ }}</span>
|
||||
</h5>
|
||||
{% if product.stock != 'not_selected' %}
|
||||
<span class="badge ml-2 {{ product.stock == 0 ? 'badge-secondary' : 'badge-success' }}">{{ product.stock == 0 ? 'productAdd.ZakazaGelyar'|_ : 'productAdd.ElimizdeBar'|_ }}</span>
|
||||
{% endif %}
|
||||
<p>{{ html_limit(product.description, 100) }}</p>
|
||||
<a href="{{ 'product'|page({id: product.id}) }}">{{ 'modal.GinisleyinMaglumat'|_ }}</a>
|
||||
</div>
|
||||
|
|
@ -226,11 +229,11 @@
|
|||
<input type="number" class="qty-text form-control" id="quantity{{ product.id }}" step="1" min="1" value="1">
|
||||
</div>
|
||||
{% if user %}
|
||||
<div class="product_add_to_cart addToCard" data-id="{{ product.id }}" data-price="{{ product.price }}" data-image="{{ product.images[0].path }}" data-name="{{ product.name }}" data-vendor="{{ product.vendor.id }}">
|
||||
<div class="product_add_to_cart addToCard" data-id="{{ product.id }}" data-price="{{ product.getDiscountedPrice(product.vendor.web2) }}" data-image="{{ product.images[0].path }}" data-name="{{ product.name }}" data-vendor="{{ product.vendor.id }}">
|
||||
<a href="#" class="btn btn-primary mt-1 mt-md-0 ml-1 ml-md-3">{{ 'product.SebedeGos'|_ }}</a>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="product_add_to_cart" data-id="{{ product.id }}" data-price="{{ product.price }}" data-image="{{ product.images[0].path }}" data-name="{{ product.name }}" data-vendor="{{ product.vendor.id }}">
|
||||
<div class="product_add_to_cart" data-id="{{ product.id }}" data-price="{{ product.getDiscountedPrice(product.vendor.web2) }}" data-image="{{ product.images[0].path }}" data-name="{{ product.name }}" data-vendor="{{ product.vendor.id }}">
|
||||
<a href="{{ 'login'|page }}" class="btn btn-primary mt-1 mt-md-0 ml-1 ml-md-3">{{ 'product.SebedeGos'|_ }}</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
|
@ -311,7 +314,7 @@
|
|||
<div class="product_description">
|
||||
<!-- Add to cart -->
|
||||
{% if user %}
|
||||
<div class="product_add_to_cart addToCard" data-id="{{ product.id }}" data-price="{{ product.price }}" data-image="{{ product.images[0].path }}" data-name="{{ product.name }}" data-vendor="{{ product.vendor.id }}">
|
||||
<div class="product_add_to_cart addToCard" data-id="{{ product.id }}" data-price="{{ product.getDiscountedPrice(product.vendor.web2) }}" data-image="{{ product.images[0].path }}" data-name="{{ product.name }}" data-vendor="{{ product.vendor.id }}">
|
||||
<input type="hidden" min="1" id="quantity{{ product.id }}" value="1">
|
||||
<a href="#"><i class="icofont-shopping-cart"></i> {{ 'product.SebedeGos'|_ }}</a>
|
||||
</div>
|
||||
|
|
@ -334,7 +337,9 @@
|
|||
{{ product.price }} TMT
|
||||
{% endif %}
|
||||
</h6>
|
||||
{% if product.stock != 'not_selected' %}
|
||||
<span class="badge mt-2 {{ product.stock == 0 ? 'badge-secondary' : 'badge-success' }}">{{ product.stock == 0 ? 'productAdd.ZakazaGelyar'|_ : 'productAdd.ElimizdeBar'|_ }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,5 @@
|
|||
<script>
|
||||
$(function () {
|
||||
$('#exampleModal').modal('toggle');
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
<script type="text/javascript" language="javascript">
|
||||
$(document).ready(function () {
|
||||
$('input[name="subcategory_id"]').attr('value', {{catId}});
|
||||
$('input[name="category_id"]').attr('value', {{catId}});
|
||||
});
|
||||
</script>
|
||||
|
|
@ -42,7 +42,10 @@
|
|||
{% else %}
|
||||
{{ product.price }} TMT
|
||||
{% endif %}
|
||||
</h5> <span class="badge ml-2 {{ product.stock == 0 ? 'badge-secondary' : 'badge-success' }}">{{ product.stock == 0 ? 'productAdd.ZakazaGelyar'|_ : 'productAdd.ElimizdeBar'|_ }}</span>
|
||||
</h5>
|
||||
{% if product.stock != 'not_selected' %}
|
||||
<span class="badge ml-2 {{ product.stock == 0 ? 'badge-secondary' : 'badge-success' }}">{{ product.stock == 0 ? 'productAdd.ZakazaGelyar'|_ : 'productAdd.ElimizdeBar'|_ }}</span>
|
||||
{% endif %}
|
||||
<p>{{ html_limit(product.description, 100) }}</p>
|
||||
<a href="{{ 'product'|page({id: product.id}) }}">{{ 'modal.GinisleyinMaglumat'|_ }}</a>
|
||||
</div>
|
||||
|
|
@ -52,11 +55,11 @@
|
|||
<input type="number" class="qty-text form-control" id="quantity{{ product.id }}" step="1" min="1" value="1">
|
||||
</div>
|
||||
{% if user %}
|
||||
<div class="product_add_to_cart addToCard" data-id="{{ product.id }}" data-price="{{ product.price }}" data-image="{{ product.images[0].path }}" data-name="{{ product.name }}" data-vendor="{{ product.vendor.id }}">
|
||||
<div class="product_add_to_cart addToCard" data-id="{{ product.id }}" data-price="{{ product.getDiscountedPrice(product.vendor.web2) }}" data-image="{{ product.images[0].path }}" data-name="{{ product.name }}" data-vendor="{{ product.vendor.id }}">
|
||||
<a href="#" class="btn btn-primary mt-1 mt-md-0 ml-1 ml-md-3">{{ 'product.SebedeGos'|_ }}</a>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="product_add_to_cart" data-id="{{ product.id }}" data-price="{{ product.price }}" data-image="{{ product.images[0].path }}" data-name="{{ product.name }}" data-vendor="{{ product.vendor.id }}">
|
||||
<div class="product_add_to_cart" data-id="{{ product.id }}" data-price="{{ product.getDiscountedPrice(product.vendor.web2) }}" data-image="{{ product.images[0].path }}" data-name="{{ product.name }}" data-vendor="{{ product.vendor.id }}">
|
||||
<a href="{{ 'login'|page }}" class="btn btn-primary mt-1 mt-md-0 ml-1 ml-md-3">{{ 'product.SebedeGos'|_ }}</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
|
@ -338,7 +341,7 @@
|
|||
<div class="product_description">
|
||||
<!-- Add to cart -->
|
||||
{% if user %}
|
||||
<div class="product_add_to_cart addToCard" data-id="{{ product.id }}" data-price="{{ product.price }}" data-image="{{ product.images[0].path }}" data-name="{{ product.name }}" data-vendor="{{ product.vendor.id }}">
|
||||
<div class="product_add_to_cart addToCard" data-id="{{ product.id }}" data-price="{{ product.getDiscountedPrice(product.vendor.web2) }}" data-image="{{ product.images[0].path }}" data-name="{{ product.name }}" data-vendor="{{ product.vendor.id }}">
|
||||
<input type="hidden" min="1" id="quantity{{ product.id }}" value="1">
|
||||
<a href="#"><i class="icofont-shopping-cart"></i> {{ 'product.SebedeGos'|_ }}</a>
|
||||
</div>
|
||||
|
|
@ -361,7 +364,9 @@
|
|||
{{ product.price }} TMT
|
||||
{% endif %}
|
||||
</h6>
|
||||
{% if product.stock != 'not_selected' %}
|
||||
<span class="badge mt-2 {{ product.stock == 0 ? 'badge-secondary' : 'badge-success' }}">{{ product.stock == 0 ? 'productAdd.ZakazaGelyar'|_ : 'productAdd.ElimizdeBar'|_ }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -41,7 +41,9 @@
|
|||
{{ product.price }} TMT
|
||||
{% endif %}
|
||||
</h5>
|
||||
{% if product.stock != 'not_selected' %}
|
||||
<span class="badge ml-2 {{ product.stock == 0 ? 'badge-secondary' : 'badge-success' }}">{{ product.stock == 0 ? 'productAdd.ZakazaGelyar'|_ : 'productAdd.ElimizdeBar'|_ }}</span>
|
||||
{% endif %}
|
||||
<p>{{ html_limit(product.description, 100) }}</p>
|
||||
<a href="{{ 'product'|page({id: product.id}) }}">{{ 'modal.GinisleyinMaglumat'|_ }}</a>
|
||||
|
||||
|
|
@ -52,11 +54,11 @@
|
|||
<input type="number" class="qty-text form-control" id="quantity{{ product.id }}" step="1" min="1" value="1">
|
||||
</div>
|
||||
{% if user %}
|
||||
<div class="product_add_to_cart addToCard" data-id="{{ product.id }}" data-price="{{ product.price }}" data-image="{{ product.images[0].path }}" data-name="{{ product.name }}" data-vendor="{{ product.vendor.id }}">
|
||||
<div class="product_add_to_cart addToCard" data-id="{{ product.id }}" data-price="{{ product.getDiscountedPrice(product.vendor.web2) }}" data-image="{{ product.images[0].path }}" data-name="{{ product.name }}" data-vendor="{{ product.vendor.id }}">
|
||||
<a href="#" class="btn btn-primary mt-1 mt-md-0 ml-1 ml-md-3">{{ 'product.SebedeGos'|_ }}</a>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="product_add_to_cart" data-id="{{ product.id }}" data-price="{{ product.price }}" data-image="{{ product.images[0].path }}" data-name="{{ product.name }}" data-vendor="{{ product.vendor.id }}">
|
||||
<div class="product_add_to_cart" data-id="{{ product.id }}" data-price="{{ product.getDiscountedPrice(product.vendor.web2) }}" data-image="{{ product.images[0].path }}" data-name="{{ product.name }}" data-vendor="{{ product.vendor.id }}">
|
||||
<a href="{{ 'login'|page }}" class="btn btn-primary mt-1 mt-md-0 ml-1 ml-md-3">{{ 'product.SebedeGos'|_ }}</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
|
@ -185,7 +187,7 @@
|
|||
<div class="product_description">
|
||||
<!-- Add to cart -->
|
||||
{% if user %}
|
||||
<div class="product_add_to_cart addToCard" data-id="{{ product.id }}" data-price="{{ product.price }}" data-image="{{ product.images[0].path }}" data-name="{{ product.name }}" data-vendor="{{ product.vendor.id }}">
|
||||
<div class="product_add_to_cart addToCard" data-id="{{ product.id }}" data-price="{{ product.getDiscountedPrice(product.vendor.web2) }}" data-image="{{ product.images[0].path }}" data-name="{{ product.name }}" data-vendor="{{ product.vendor.id }}">
|
||||
<input type="hidden" min="1" id="quantity{{ product.id }}" value="1">
|
||||
<a href="#"><i class="icofont-shopping-cart"></i> {{ 'product.SebedeGos'|_ }}</a>
|
||||
</div>
|
||||
|
|
@ -208,7 +210,9 @@
|
|||
{{ product.price }} TMT
|
||||
{% endif %}
|
||||
</h6>
|
||||
{% if product.stock != 'not_selected' %}
|
||||
<span class="badge mt-2 {{ product.stock == 0 ? 'badge-secondary' : 'badge-success' }}">{{ product.stock == 0 ? 'productAdd.ZakazaGelyar'|_ : 'productAdd.ElimizdeBar'|_ }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -102,7 +102,10 @@
|
|||
{% else %}
|
||||
{{ product.price }} TMT
|
||||
{% endif %}
|
||||
</h4> <span class="badge mb-2 {{ product.stock == 0 ? 'badge-secondary' : 'badge-success' }}">{{ product.stock == 0 ? 'productAdd.ZakazaGelyar'|_ : 'productAdd.ElimizdeBar'|_ }}</span>
|
||||
</h4>
|
||||
{% if product.stock != 'not_selected' %}
|
||||
<span class="badge mb-2 {{ product.stock == 0 ? 'badge-secondary' : 'badge-success' }}">{{ product.stock == 0 ? 'productAdd.ZakazaGelyar'|_ : 'productAdd.ElimizdeBar'|_ }}</span>
|
||||
{% endif %}
|
||||
|
||||
<!-- Overview -->
|
||||
<div class="short_overview mb-4">
|
||||
|
|
@ -128,11 +131,11 @@
|
|||
<input type="number" class="qty-text form-control" id="quantity{{ product.id }}" step="1" min="1" value="1">
|
||||
</div>
|
||||
{% if user %}
|
||||
<div class="product_add_to_cart addToCard" data-id="{{ product.id }}" data-price="{{ product.price }}" data-image="{{ product.images[0].path }}" data-name="{{ product.name }}" data-vendor="{{ product.vendor.id }}">
|
||||
<div class="product_add_to_cart addToCard" data-id="{{ product.id }}" data-price="{{ product.getDiscountedPrice(product.vendor.web2) }}" data-image="{{ product.images[0].path }}" data-name="{{ product.name }}" data-vendor="{{ product.vendor.id }}">
|
||||
<a href="#" class="btn btn-primary mt-1 mt-md-0 ml-1 ml-md-3">Sebede goş</a>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="product_add_to_cart" data-id="{{ product.id }}" data-price="{{ product.price }}" data-image="{{ product.images[0].path }}" data-name="{{ product.name }}" data-vendor="{{ product.vendor.id }}">
|
||||
<div class="product_add_to_cart" data-id="{{ product.id }}" data-price="{{ product.getDiscountedPrice(product.vendor.web2) }}" data-image="{{ product.images[0].path }}" data-name="{{ product.name }}" data-vendor="{{ product.vendor.id }}">
|
||||
<a href="{{ 'login'|page }}" class="btn btn-primary mt-1 mt-md-0 ml-1 ml-md-3">{{ 'product.SebedeGos'|_ }}</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
|
|
|||
|
|
@ -48,7 +48,10 @@
|
|||
{% else %}
|
||||
{{ product.price }} TMT
|
||||
{% endif %}
|
||||
</h5> <span class="badge ml-2 {{ product.stock == 0 ? 'badge-secondary' : 'badge-success' }}">{{ product.stock == 0 ? 'productAdd.ZakazaGelyar'|_ : 'productAdd.ElimizdeBar'|_ }}</span>
|
||||
</h5>
|
||||
{% if product.stock != 'not_selected' %}
|
||||
<span class="badge ml-2 {{ product.stock == 0 ? 'badge-secondary' : 'badge-success' }}">{{ product.stock == 0 ? 'productAdd.ZakazaGelyar'|_ : 'productAdd.ElimizdeBar'|_ }}</span>
|
||||
{% endif %}
|
||||
<p>{{ html_limit(product.description, 100) }}</p>
|
||||
<a href="{{ 'product'|page({id: product.id}) }}">{{ 'modal.GinisleyinMaglumat'|_ }}</a>
|
||||
</div>
|
||||
|
|
@ -58,11 +61,11 @@
|
|||
<input type="number" class="qty-text form-control" id="quantity{{ product.id }}" step="1" min="1" value="1">
|
||||
</div>
|
||||
{% if user %}
|
||||
<div class="product_add_to_cart addToCard" data-id="{{ product.id }}" data-price="{{ product.price }}" data-image="{{ product.images[0].path }}" data-name="{{ product.name }}" data-vendor="{{ product.vendor.id }}">
|
||||
<div class="product_add_to_cart addToCard" data-id="{{ product.id }}" data-price="{{ product.getDiscountedPrice(product.vendor.web2) }}" data-image="{{ product.images[0].path }}" data-name="{{ product.name }}" data-vendor="{{ product.vendor.id }}">
|
||||
<a href="#" class="btn btn-primary mt-1 mt-md-0 ml-1 ml-md-3">{{ 'product.SebedeGos'|_ }}</a>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="product_add_to_cart" data-id="{{ product.id }}" data-price="{{ product.price }}" data-image="{{ product.images[0].path }}" data-name="{{ product.name }}" data-vendor="{{ product.vendor.id }}">
|
||||
<div class="product_add_to_cart" data-id="{{ product.id }}" data-price="{{ product.getDiscountedPrice(product.vendor.web2) }}" data-image="{{ product.images[0].path }}" data-name="{{ product.name }}" data-vendor="{{ product.vendor.id }}">
|
||||
<a href="{{ 'login'|page }}" class="btn btn-primary mt-1 mt-md-0 ml-1 ml-md-3">{{ 'product.SebedeGos'|_ }}</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
|
|
|||
|
|
@ -45,7 +45,10 @@
|
|||
{% else %}
|
||||
{{ product.price }} TMT
|
||||
{% endif %}
|
||||
</h5> <span class="badge ml-2 {{ product.stock == 0 ? 'badge-secondary' : 'badge-success' }}">{{ product.stock == 0 ? 'productAdd.ZakazaGelyar'|_ : 'productAdd.ElimizdeBar'|_ }}</span>
|
||||
</h5>
|
||||
{% if product.stock != 'not_selected' %}
|
||||
<span class="badge ml-2 {{ product.stock == 0 ? 'badge-secondary' : 'badge-success' }}">{{ product.stock == 0 ? 'productAdd.ZakazaGelyar'|_ : 'productAdd.ElimizdeBar'|_ }}</span>
|
||||
{% endif %}
|
||||
<p>{{ html_limit(product.description, 100) }}</p>
|
||||
<a href="{{ 'product'|page({id: product.id}) }}">{{ 'modal.GinisleyinMaglumat'|_ }}</a>
|
||||
</div>
|
||||
|
|
@ -55,11 +58,11 @@
|
|||
<input type="number" class="qty-text form-control" id="quantity{{ product.id }}" step="1" min="1" value="1">
|
||||
</div>
|
||||
{% if user %}
|
||||
<div class="product_add_to_cart addToCard" data-id="{{ product.id }}" data-price="{{ product.price }}" data-image="{{ product.images[0].path }}" data-name="{{ product.name }}" data-vendor="{{ product.vendor.id }}">
|
||||
<div class="product_add_to_cart addToCard" data-id="{{ product.id }}" data-price="{{ product.getDiscountedPrice(product.vendor.web2) }}" data-image="{{ product.images[0].path }}" data-name="{{ product.name }}" data-vendor="{{ product.vendor.id }}">
|
||||
<a href="#" class="btn btn-primary mt-1 mt-md-0 ml-1 ml-md-3">{{ 'product.SebedeGos'|_ }}</a>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="product_add_to_cart" data-id="{{ product.id }}" data-price="{{ product.price }}" data-image="{{ product.images[0].path }}" data-name="{{ product.name }}" data-vendor="{{ product.vendor.id }}">
|
||||
<div class="product_add_to_cart" data-id="{{ product.id }}" data-price="{{ product.getDiscountedPrice(product.vendor.web2) }}" data-image="{{ product.images[0].path }}" data-name="{{ product.name }}" data-vendor="{{ product.vendor.id }}">
|
||||
<a href="{{ 'login'|page }}" class="btn btn-primary mt-1 mt-md-0 ml-1 ml-md-3">{{ 'product.SebedeGos'|_ }}</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
|
@ -253,7 +256,7 @@
|
|||
<div class="product_description">
|
||||
<!-- Add to cart -->
|
||||
{% if user %}
|
||||
<div class="product_add_to_cart addToCard" data-id="{{ product.id }}" data-price="{{ product.price }}" data-image="{{ product.images[0].path }}" data-name="{{ product.name }}" data-vendor="{{ product.vendor.id }}">
|
||||
<div class="product_add_to_cart addToCard" data-id="{{ product.id }}" data-price="{{ product.getDiscountedPrice(product.vendor.web2) }}" data-image="{{ product.images[0].path }}" data-name="{{ product.name }}" data-vendor="{{ product.vendor.id }}">
|
||||
<input type="hidden" min="1" id="quantity{{ product.id }}" value="1">
|
||||
<a href="#"><i class="icofont-shopping-cart"></i> {{ 'product.SebedeGos'|_ }}</a>
|
||||
</div>
|
||||
|
|
@ -276,7 +279,9 @@
|
|||
{{ product.price }} TMT
|
||||
{% endif %}
|
||||
</h6>
|
||||
{% if product.stock != 'not_selected' %}
|
||||
<span class="badge mt-2 {{ product.stock == 0 ? 'badge-secondary' : 'badge-success' }}">{{ product.stock == 0 ? 'productAdd.ZakazaGelyar'|_ : 'productAdd.ElimizdeBar'|_ }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -40,3 +40,9 @@ columns:
|
|||
label: 'POZULAN SENE'
|
||||
type: datetime
|
||||
sortable: true
|
||||
phone:
|
||||
label: Telefon2
|
||||
type: text
|
||||
searchable: true
|
||||
invisible: false
|
||||
sortable: true
|
||||
|
|
|
|||
|
|
@ -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'
|
||||
|
|
|
|||
|
|
@ -0,0 +1,23 @@
|
|||
<?php namespace TPS\Birzha\Updates;
|
||||
|
||||
use Schema;
|
||||
use October\Rain\Database\Updates\Migration;
|
||||
|
||||
class BuilderTableUpdateTpsBirzhaProducts42 extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
Schema::table('tps_birzha_products', function($table)
|
||||
{
|
||||
$table->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();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -67,22 +67,16 @@ productId = "{{ :productId }}"
|
|||
enctype="multipart/form-data">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6 mb-3">
|
||||
<div class="col-md-12 mb-3" style='display: grid;'>
|
||||
<label for="category">{{ 'productAdd.Kategoriya'|_ }}</label>
|
||||
<select class="custom-select d-block w-100 form-control" id="category" data-belongsto="product" name="category_id" onChange="getCategories(this.value);" required>
|
||||
<option value="" disabled>{{ 'productAdd.KategoriyaSayla'|_ }}</option>
|
||||
{% for category in categories %}
|
||||
<option value="{{ category.id }}" data-file="{{ category.is_file_category }}">{{ category.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-6 mb-3">
|
||||
<label for="subcategory">{{ 'productAdd.IkinjiKategoriya'|_ }}</label>
|
||||
<select class="custom-select d-block w-100 form-control" id="subcategoryAdd" name="subcategory_id" disabled>
|
||||
<option value=null>{{ 'productAdd.Subkategoriya'|_ }}</option>
|
||||
<button data-request="onSetCategoryModal" type="button" class="btn form-control" style="font-weight: normal;text-align: left;text-transform: capitalize;background: white;" data-toggle="modal" data-target="#exampleModal" id="category_title">
|
||||
Kategoriýa saýla
|
||||
</button>
|
||||
|
||||
</select>
|
||||
<input type="hidden" name="category_id" id="catSelected">
|
||||
<input type="hidden" name="subcategory_id" id="subCatSelected">
|
||||
</div>
|
||||
|
||||
<div class="col-md-6 mb-3">
|
||||
<label for="city">{{ 'productAdd.Welayat'|_ }}</label>
|
||||
<select class="custom-select d-block w-100 form-control" id="city" name="state_id">
|
||||
|
|
@ -107,21 +101,23 @@ productId = "{{ :productId }}"
|
|||
<label for="price">{{ 'productAdd.Bahasy'|_ }}</label>
|
||||
<input type="number" class="form-control" id="price" name="price" min="0" required>
|
||||
</div>
|
||||
<div class="col-md-12 mb-3">
|
||||
<!-- <div class="col-md-12 mb-3">
|
||||
<label for="shortDescription">{{ 'productAdd.GysgaBeyany'|_ }}</label>
|
||||
<textarea class="form-control" id="shortDescription" cols="30" name="short_description" rows="10" placeholder="{{ 'productAdd.GysgaBeyany'|_ }}" style="height: 160px;" required></textarea>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="col-md-12 mb-3">
|
||||
<label for="description">{{ 'productAdd.GinsileyinBeyany'|_ }}</label>
|
||||
<textarea class="form-control" id="description" cols="30" rows="20" name="description" style="height: 160px;" placeholder="{{ 'productAdd.GinsileyinBeyany'|_ }}" required></textarea>
|
||||
</div>
|
||||
<div class="col-md-6 mb-3">
|
||||
<label for="phone">{{ 'productAdd.TelefonBelgisi2'|_ }}</label>
|
||||
<input type="tel" class="form-control" id="phone" name="phone" value="+993" required>
|
||||
<span style="position:relative;top: 42px;left: -110px;font-size: 13px;">+993</span>
|
||||
<input type="tel" class="form-control" style="padding-left: 52px;" id="phone" name="phone" min="61000000" max="65999999">
|
||||
</div>
|
||||
<div class="col-md-6 mb-3">
|
||||
<label for="stock">{{ 'productAdd.SkladdaBarmy'|_ }} ?</label>
|
||||
<select class="custom-select d-block w-100 form-control" id="stock" name="stock">
|
||||
<option value="not_selected">{{ 'productAdd.NotSelected'|_ }}</option>
|
||||
<option value="1">{{ 'productAdd.ElimizdeBar'|_ }}</option>
|
||||
<option value="0">{{ 'productAdd.ZakazaGelyar'|_ }}</option>
|
||||
</select>
|
||||
|
|
@ -152,49 +148,14 @@ productId = "{{ :productId }}"
|
|||
enctype="multipart/form-data">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6 mb-3">
|
||||
<label for="categoryEdit">{{ 'productAdd.Kategoriya'|_ }}</label>
|
||||
<select class="custom-select d-block w-100 form-control" id="categoryEdit" data-belongsto="product" name="category_id" onChange="getCategoriesForEdit(this.value);" required>
|
||||
<option value="">{{ 'productAdd.KategoriyaSayla'|_ }}</option>
|
||||
{% for category in categories %}
|
||||
{% for prodCat in productForEditing.categories %}
|
||||
{% if prodCat.primary_key == 0 %}
|
||||
<option value="{{ category.id }}" {{ category.id == prodCat.id ? 'selected' : '' }} data-file="{{ category.is_file_category }}">{{ category.name }}</option>
|
||||
{% elseif prodCat.parent.parent %}
|
||||
<option value="{{ category.id }}" {{ category.id == prodCat.parent.parent.id ? 'selected' : '' }} data-file="{{ category.is_file_category }}">{{ category.name }}</option>
|
||||
{% else %}
|
||||
<option value="{{ category.id }}" {{ category.id == prodCat.parent.id ? 'selected' : '' }} data-file="{{ category.is_file_category }}">{{ category.name }}</option>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-6 mb-3">
|
||||
<label for="subcategoryEdit">{{ 'productAdd.IkinjiKategoriya'|_ }}</label>
|
||||
<div class="col-md-12 mb-3" style='display: grid;'>
|
||||
<label for="category">{{ 'productAdd.Kategoriya'|_ }}</label>
|
||||
<button data-request="onSetCategoryModal" type="button" class="btn form-control" style="font-weight: normal;text-align: left;text-transform: capitalize;background: white;" data-toggle="modal" data-target="#exampleModal" id="category_title">
|
||||
{{productForEditing.categories[0].name}}
|
||||
</button>
|
||||
|
||||
<select class="custom-select d-block w-100 form-control" id="subcategoryEdit" name="subcategory_id" required>
|
||||
|
||||
{% for prodCat in productForEditing.categories %}
|
||||
{% if prodCat.primary_key == 0 %}
|
||||
<option value=null disabled>Birinji dereje Sub-kategoriýa saýla</option>
|
||||
{% else %}
|
||||
{% if prodCat.subs.count > 0 %}
|
||||
<option value="{{ prodCat.id }}" {{ productForEditing.categories.contains(prodCat.id) ? 'selected' : '' }} data-file="{{ prodCat.is_file_category }}">{{ prodCat.name }}</option>
|
||||
{% for sub in prodCat.subs %}
|
||||
<option value="{{ sub.id }}" {{ productForEditing.categories.contains(sub.id) ? 'selected' : '' }} data-file="{{ sub.is_file_category }}">{{ sub.name }}</option>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
{% set secondLevelCategory = prodCat.parent %}
|
||||
<option value="{{ secondLevelCategory.id }}" {{ productForEditing.categories.contains(secondLevelCategory.id) ? 'selected' : '' }} data-file="{{ secondLevelCategory.is_file_category }}">{{ secondLevelCategory.name }}</option>
|
||||
{% for thirdLevel in secondLevelCategory.subs %}
|
||||
<option value="{{ thirdLevel.id }}" {{ productForEditing.categories.contains(thirdLevel.id) ? 'selected' : '' }} data-file="{{ thirdLevel.is_file_category }}">{{ thirdLevel.name }}</option>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
|
||||
</select>
|
||||
<input type="hidden" name="category_id" id="catSelected" value="{{productForEditing.categories[0].id}}">
|
||||
<input type="hidden" name="subcategory_id" id="subCatSelected" value="{{productForEditing.categories[0].id}}">
|
||||
</div>
|
||||
<div class="col-md-6 mb-3">
|
||||
<label for="cityEdit">{{ 'productAdd.Welayat'|_ }}</label>
|
||||
|
|
@ -223,22 +184,24 @@ productId = "{{ :productId }}"
|
|||
<label for="price">{{ 'productAdd.Bahasy'|_ }}</label>
|
||||
<input type="number" class="form-control" id="price" name="price" min="0" value="{{ productForEditing.price }}" required>
|
||||
</div>
|
||||
<div class="col-md-12 mb-3">
|
||||
<!-- <div class="col-md-12 mb-3">
|
||||
<label for="shortDescription">{{ 'productAdd.GysgaBeyany'|_ }}</label>
|
||||
<textarea class="form-control" id="shortDescription" cols="30" name="short_description" rows="10" placeholder="{{ 'productAdd.GysgaBeyany'|_ }}" style="height: 160px;" required>{{ productForEditing.short_description }}</textarea>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="col-md-12 mb-3">
|
||||
<label for="description">{{ 'productAdd.GinsileyinBeyany'|_ }}</label>
|
||||
<textarea class="form-control" id="description" cols="30" rows="20" name="description" style="height: 160px;" placeholder="{{ 'productAdd.GinsileyinBeyany'|_ }}" required>{{ productForEditing.description|striptags|raw }}</textarea>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6 mb-3">
|
||||
<label for="phone">{{ 'productAdd.TelefonBelgisi'|_ }}</label>
|
||||
<input type="tel" class="form-control" id="phone" name="phone" value="{{ productForEditing.phone ? productForEditing.phone : '+993' }}" required>
|
||||
<label for="phone">{{ 'productAdd.TelefonBelgisi2'|_ }}</label>
|
||||
<span style="position:relative;top: 42px;left: -110px;font-size: 13px;">+993</span>
|
||||
<input type="tel" class="form-control" id="phone" name="phone" min="61000000" max="65999999" value="{{ productForEditing.phone}}">
|
||||
</div>
|
||||
<div class="col-md-6 mb-3">
|
||||
<label for="stock">{{ 'productAdd.SkladdaBarmy'|_ }} ?</label>
|
||||
<select class="custom-select d-block w-100 form-control" id="stock" name="stock">
|
||||
<option value="not_selected" {{ productForEditing.stock == 'not_selected' ? 'selected': '' }}>{{ 'productAdd.NotSelected'|_ }}</option>
|
||||
<option value="1" {{ productForEditing.stock == 1 ? 'selected': '' }}>{{ 'productAdd.ElimizdeBar'|_ }}</option>
|
||||
<option value="0" {{ productForEditing.stock == 0 ? 'selected': '' }}>{{ 'productAdd.ZakazaGelyar'|_ }}</option>
|
||||
</select>
|
||||
|
|
@ -295,6 +258,35 @@ productId = "{{ :productId }}"
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="close_modal">
|
||||
|
||||
</div>
|
||||
<div id="set_cat">
|
||||
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="exampleModalLabel">Kategoriýalar</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body" id="modal_content">
|
||||
|
||||
</div>
|
||||
<div class="modal-footer" id="modal_footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Ýap</button>
|
||||
<!-- <button type="button" class="btn btn-primary">Save changes</button> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
@ -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');
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
</div>
|
||||
<!-- Add to cart -->
|
||||
{% if user %}
|
||||
<div class="product_add_to_cart addToCard" data-id="{{ product.id }}" data-price="{{ product.price }}" data-image="{{ product.images[0].path }}" data-name="{{ product.name }}" data-vendor="{{ product.vendor.id }}">
|
||||
<div class="product_add_to_cart addToCard" data-id="{{ product.id }}" data-price="{{ product.getDiscountedPrice(product.vendor.web2) }}" data-image="{{ product.images[0].path }}" data-name="{{ product.name }}" data-vendor="{{ product.vendor.id }}">
|
||||
<input type="hidden" min="1" id="quantity{{ product.id }}" value="1">
|
||||
<a href="#"><i class="icofont-shopping-cart"></i> {{ 'product.SebedeGos'|_ }}</a>
|
||||
</div>
|
||||
|
|
@ -44,6 +44,8 @@
|
|||
{{ product.price }} TMT
|
||||
{% endif %}
|
||||
</h6>
|
||||
{% if product.stock != 'not_selected' %}
|
||||
<span class="badge mt-2 {{ product.stock == 0 ? 'badge-secondary' : 'badge-success' }}">{{ product.stock == 0 ? 'productAdd.ZakazaGelyar'|_ : 'productAdd.ElimizdeBar'|_ }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -116,7 +116,7 @@
|
|||
<div class="product_description" style="padding-top: 1px;padding-bottom: 20px;">
|
||||
<!-- Add to cart -->
|
||||
{% if user %}
|
||||
<div class="product_add_to_cart addToCard" data-id="{{ product.id }}" data-price="{{ product.price }}" data-image="{{ product.images[0].path }}" data-name="{{ product.name }}" data-vendor="{{ product.vendor.id }}">
|
||||
<div class="product_add_to_cart addToCard" data-id="{{ product.id }}" data-price="{{ product.getDiscountedPrice(product.vendor.web2) }}" data-image="{{ product.images[0].path }}" data-name="{{ product.name }}" data-vendor="{{ product.vendor.id }}">
|
||||
<input type="hidden" min="1" id="quantity{{ product.id }}" value="1">
|
||||
<a href="#"><i class="icofont-shopping-cart" style="font-size: 19px;"></i></a>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@
|
|||
<div class="product_description" style="padding-top: 1px;padding-bottom: 20px;">
|
||||
<!-- Add to cart -->
|
||||
{% if user %}
|
||||
<div class="product_add_to_cart addToCard" data-id="{{ product.id }}" data-price="{{ product.price }}" data-image="{{ product.images[0].path }}" data-name="{{ product.name }}" data-vendor="{{ product.vendor.id }}">
|
||||
<div class="product_add_to_cart addToCard" data-id="{{ product.id }}" data-price="{{ product.getDiscountedPrice(product.vendor.web2) }}" data-image="{{ product.images[0].path }}" data-name="{{ product.name }}" data-vendor="{{ product.vendor.id }}">
|
||||
<input type="hidden" min="1" id="quantity{{ product.id }}" value="1">
|
||||
<a href="#"><i class="icofont-shopping-cart" style="font-size: 19px;"></i></a>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue