Commit 6be46607 by Francisco Salazar

config disable subcategories

parent e9975bb1
......@@ -3,6 +3,8 @@ return [
"slug-shop" => "tienda",
"billing_enabled"=>false,
"slug-shop-category" => "categoria",
"tags-enable" => false,
"subcategory-enable" => false,
"product-index" => [
"pagination" => 15,
"otros" => 3
......
......@@ -186,7 +186,7 @@ public function shipping()
->with('shipping', $shipping);
}
public function storeClient(RequestClient $request)
public function storeClient(Client $request)
{
$client = new Client();
$addres = new Addres();
......
......@@ -71,4 +71,9 @@ class ProductShop extends Model
public function subcategories_related(){
return $this->belongsToMany('Onestartup\Shop\Model\ProductSubCategoryShop', 'related_products', 'product_id', 'subcategory_id');
}
public function details_sale()
{
return $this->hasMany('Onestartup\Shop\Model\DetailShop', 'product_id');
}
}
......@@ -58,7 +58,9 @@
<th>Categoría</th>
<th>Descripción</th>
<th>Productos</th>
<th>Subcategorias</th>
@if(config("shop.subcategory-enable"))
<th>Subcategorias</th>
@endif
<th></th>
</tr>
@foreach ($categories as $category)
......@@ -73,12 +75,16 @@
</td>
<td> {{$category->description}}</td>
<td class="text-center"> {{$category->products->count()}}</td>
<td class="text-center"> {{$category->subcategories->count()}}</td>
@if(config("shop.subcategory-enable"))
<td class="text-center"> {{$category->subcategories->count()}}</td>
@endif
<td class="text-center">
<a class='btn btn-xs btn-success button-mb' href="{{route('admin.shop.subcategory.index', $category->id)}}">
<i class='fas fa-plus icon-special-size'></i>
Subcategorías
</a>
@if(config("shop.subcategory-enable"))
<a class='btn btn-xs btn-success button-mb' href="{{route('admin.shop.subcategory.index', $category->id)}}">
<i class='fas fa-plus icon-special-size'></i>
Subcategorías
</a>
@endif
{!! Form::open(['route'=> ['admin.shop.category.destroy',$category->id],'method'=>'DELETE'])!!}
<button class='btn btn-danger btn-xs button-mb' onclick="return confirm('¿Estás seguro de eliminar este elemento?');" type='submit'>
<i class='fas fa-trash-alt icon-special-size'></i>
......
......@@ -24,8 +24,10 @@
</div>
<div class='col-md-6'>
<div class="form-group" >
{!! Form::label('category_id', 'Categoría', ['class'=>'control-label'])!!}
{!! Form::select('category_id', $categories, null, ["class"=>"form-control", "required"=>"required"]) !!}
{!! Form::label('publication_date', 'Fecha de publicación', ['class'=>'control-label'])!!}
{!! Form::text('publication_date', isset($product) ? null: date('Y-m-d'), ["class"=>"form-control", "required"=>"required", "id"=>"publication_date"]) !!}
</div>
</div>
</div>
......@@ -48,25 +50,29 @@
</div>
<div class="col-md-6">
<div class="form-group" >
{!! Form::label('subcategory_id', 'Subcategoría', ['class'=>'control-label'])!!}
{!! Form::select('subcategory_id', $subcategories, null, ["class"=>"form-control", "placeholder"=>"Selecciona una subcategoría"]) !!}
{!! Form::label('category_id', 'Categoría', ['class'=>'control-label'])!!}
{!! Form::select('category_id', $categories, null, ["class"=>"form-control", "required"=>"required"]) !!}
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
{!! Form::label('publication_date', 'Fecha de publicación', ['class'=>'control-label'])!!}
{!! Form::text('publication_date', isset($product) ? null: date('Y-m-d'), ["class"=>"form-control", "required"=>"required", "id"=>"publication_date"]) !!}
@if(config("shop.tags-enable"))
<div class="col-md-6">
<div class="form-group">
{!! Form::label('tags', 'Etiquetas', ['class'=>'control-label'])!!}
{!! Form::select('tags[]', $tags, null, ["class"=>"form-control", "id"=>"tags", "multiple"=>"multiple"]) !!}
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
{!! Form::label('tags', 'Etiquetas', ['class'=>'control-label'])!!}
{!! Form::select('tags[]', $tags, null, ["class"=>"form-control", "id"=>"tags", "multiple"=>"multiple"]) !!}
@endif
@if(config("shop.subcategory-enable"))
<div class="col-md-6">
<div class="form-group">
{!! Form::label('subcategory_id', 'Subcategoría', ['class'=>'control-label'])!!}
{!! Form::select('subcategory_id', $subcategories, null, ["class"=>"form-control", "placeholder"=>"Selecciona una subcategoría"]) !!}
</div>
</div>
</div>
@endif
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment