change registration or connection in order page, change filter on shelve page, add new api to get article_nature by product_type, css fixes
This commit is contained in:
@@ -101,5 +101,4 @@ class ArticleController extends Controller
|
|||||||
$data = Articles::toggleHomepage($request->input('id'), ($request->input('homepage') == 'true') ? 1 : 0);
|
$data = Articles::toggleHomepage($request->input('id'), ($request->input('homepage') == 'true') ? 1 : 0);
|
||||||
return response()->json(['error' => 0]);
|
return response()->json(['error' => 0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,4 +41,9 @@ class ArticleNatureController extends Controller
|
|||||||
{
|
{
|
||||||
return ArticleNatures::destroy($id);
|
return ArticleNatures::destroy($id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function getOptions($product_type)
|
||||||
|
{
|
||||||
|
return response()->json(['0' => ''] + ArticleNatures::getOptionsByProductType($product_type));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,8 +9,6 @@ use App\Repositories\Shop\Producers;
|
|||||||
use App\Repositories\Shop\TagGroups;
|
use App\Repositories\Shop\TagGroups;
|
||||||
use App\Datatables\Shop\MerchandisesDataTable;
|
use App\Datatables\Shop\MerchandisesDataTable;
|
||||||
|
|
||||||
use App\Models\Shop\Merchandise;
|
|
||||||
|
|
||||||
class MerchandiseController extends Controller
|
class MerchandiseController extends Controller
|
||||||
{
|
{
|
||||||
public function index(MerchandisesDataTable $dataTable)
|
public function index(MerchandisesDataTable $dataTable)
|
||||||
|
|||||||
@@ -24,4 +24,19 @@ class ArticleNature extends Model
|
|||||||
{
|
{
|
||||||
return $query->where($this->table . '.id', $id);
|
return $query->where($this->table . '.id', $id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function scopeByBotanic($query);
|
||||||
|
{
|
||||||
|
return $query->where($this->table . '.product_type', 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function scopeByMerchandise($query);
|
||||||
|
{
|
||||||
|
return $query->where($this->table . '.product_type', 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function scopeByProductType($query, $type)
|
||||||
|
{
|
||||||
|
return $query->where($this->table . '.product_type', $type);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,21 @@ class ArticleNatures
|
|||||||
return ArticleNature::get()->pluck('name', 'id')->toArray();
|
return ArticleNature::get()->pluck('name', 'id')->toArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function getOptionsByMerchandise()
|
||||||
|
{
|
||||||
|
return self::getOptionsByProductType(2);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getOptionsByBotanic()
|
||||||
|
{
|
||||||
|
return self::getOptionsByProductType(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getOptionsByProductType($type)
|
||||||
|
{
|
||||||
|
return ArticleNature::byProductType($type)->get()->pluck('name', 'id')->toArray();
|
||||||
|
}
|
||||||
|
|
||||||
public static function getAll()
|
public static function getAll()
|
||||||
{
|
{
|
||||||
return ArticleNature::orderBy('name', 'asc')->get();
|
return ArticleNature::orderBy('name', 'asc')->get();
|
||||||
|
|||||||
@@ -108,16 +108,13 @@ a.nav-link {
|
|||||||
background-color: #f3f8f1;
|
background-color: #f3f8f1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.green {
|
.green, a.green {
|
||||||
color: #517C39;
|
|
||||||
}
|
|
||||||
|
|
||||||
a.green {
|
|
||||||
color: #517C39 !important;
|
color: #517C39 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.green-dark, a.green-dark {
|
.green-dark, a.green-dark {
|
||||||
color: #335012;
|
color: #335012;
|
||||||
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
a.green-dark:hover {
|
a.green-dark:hover {
|
||||||
|
|||||||
@@ -39,6 +39,7 @@
|
|||||||
{{ Form::label('article_nature_id', __('shop.article_natures.name')) }}<br>
|
{{ Form::label('article_nature_id', __('shop.article_natures.name')) }}<br>
|
||||||
@include('components.form.select', [
|
@include('components.form.select', [
|
||||||
'name' => 'article_nature_id',
|
'name' => 'article_nature_id',
|
||||||
|
'id_name' => 'article_nature_id',
|
||||||
'list' => $natures_options,
|
'list' => $natures_options,
|
||||||
'value' => $article['article_nature_id'] ?? null,
|
'value' => $article['article_nature_id'] ?? null,
|
||||||
'class' => 'select2',
|
'class' => 'select2',
|
||||||
@@ -155,12 +156,15 @@
|
|||||||
switch (product_type) {
|
switch (product_type) {
|
||||||
case 'App\\Models\\Botanic\\Specie':
|
case 'App\\Models\\Botanic\\Specie':
|
||||||
var url = '{{ route('Admin.Botanic.Species.getSelect') }}';
|
var url = '{{ route('Admin.Botanic.Species.getSelect') }}';
|
||||||
|
var product_type = 1;
|
||||||
break;
|
break;
|
||||||
case 'App\\Models\\Botanic\\Variety':
|
case 'App\\Models\\Botanic\\Variety':
|
||||||
var url = '{{ route('Admin.Botanic.Varieties.getSelect') }}';
|
var url = '{{ route('Admin.Botanic.Varieties.getSelect') }}';
|
||||||
|
var product_type = 1;
|
||||||
break;
|
break;
|
||||||
case 'App\\Models\\Shop\\Merchandise':
|
case 'App\\Models\\Shop\\Merchandise':
|
||||||
var url = '{{ route('Admin.Shop.Merchandises.getSelect') }}';
|
var url = '{{ route('Admin.Shop.Merchandises.getSelect') }}';
|
||||||
|
var product_type = 2;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
loadProducts(url);
|
loadProducts(url);
|
||||||
|
|||||||
@@ -38,6 +38,13 @@
|
|||||||
</x-card>
|
</x-card>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@else
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-8">
|
||||||
|
<h1>Panier</h1>
|
||||||
|
Votre panier est vide
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@endif
|
@endif
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
|
|||||||
@@ -15,16 +15,14 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12">
|
<div class="col-6">
|
||||||
@include('components.form.input', [
|
@include('components.form.input', [
|
||||||
'name' => 'company',
|
'name' => 'company',
|
||||||
'value' => $customer['company'] ?? '',
|
'value' => $customer['company'] ?? '',
|
||||||
'label' => 'Société',
|
'label' => 'Société',
|
||||||
])
|
])
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="col-6">
|
||||||
<div class="row">
|
|
||||||
<div class="col-12">
|
|
||||||
@include('components.form.input', [
|
@include('components.form.input', [
|
||||||
'name' => 'tva',
|
'name' => 'tva',
|
||||||
'value' => $customer['tva'] ?? '',
|
'value' => $customer['tva'] ?? '',
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-8">
|
<div class="@if ($basket['count']) col-8 @else col-12 @endif">
|
||||||
@if (!App\Repositories\Shop\Customers::isConnected())
|
@if (!App\Repositories\Shop\Customers::isConnected())
|
||||||
<p>
|
<p>
|
||||||
<a href="#" id="customer" class="pr-5">Déja client ?</a>
|
<a href="#" id="customer" class="pr-5">Déja client ?</a>
|
||||||
@@ -39,11 +39,13 @@
|
|||||||
{!! Form::close() !!}
|
{!! Form::close() !!}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@if ($basket['count'])
|
||||||
<div class="col-4">
|
<div class="col-4">
|
||||||
<x-card class='shadow'>
|
<x-card class='shadow'>
|
||||||
@include('Shop.Baskets.partials.basketTotal')
|
@include('Shop.Baskets.partials.basketTotal')
|
||||||
</x-card>
|
</x-card>
|
||||||
</div>
|
</div>
|
||||||
|
@endif
|
||||||
</div>
|
</div>
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
@if ($articles ?? false)
|
@if ($articles ?? false)
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12">
|
||||||
@foreach ($articles as $product_name => $article)
|
@foreach ($articles as $product_name => $article)
|
||||||
@include('Shop.Articles.partials.article_rows')
|
@include('Shop.Articles.partials.article_rows')
|
||||||
@endforeach
|
@endforeach
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
@push('js')
|
@push('js')
|
||||||
|
|||||||
@@ -42,7 +42,7 @@
|
|||||||
|
|
||||||
<div class="row mbm">
|
<div class="row mbm">
|
||||||
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 text-center">
|
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 text-center">
|
||||||
<button type="submit" class="btn btn-primary">
|
<button type="submit" class="btn btn-green-dark">
|
||||||
{{ __('boilerplate::auth.register.register_button') }}
|
{{ __('boilerplate::auth.register.register_button') }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
</li>
|
</li>
|
||||||
@else
|
@else
|
||||||
<li class="dropdown-item">
|
<li class="dropdown-item">
|
||||||
<a href="{{ route('Shop.login') }}" title="Identifiez-vous" rel="nofollow">
|
<a href="{{ route('Shop.Orders.order') }}" title="Identifiez-vous" rel="nofollow">
|
||||||
<span>Connexion</span>
|
<span>Connexion</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
@@ -34,5 +34,11 @@
|
|||||||
<span>Creer votre compte</span>
|
<span>Creer votre compte</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="dropdown-item">
|
||||||
|
<a href="https://www.jardinenvie.com/boutique/commander" title="Télécharger le catalogue" rel="nofollow">
|
||||||
|
<span>Télécharger le catalogue</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
@endif
|
@endif
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
@@ -6,5 +6,5 @@ Route::prefix('ArticleNatures')->name('ArticleNatures.')->group(function () {
|
|||||||
Route::delete('destroy/{id?}', 'ArticleNatureController@destroy')->name('destroy');
|
Route::delete('destroy/{id?}', 'ArticleNatureController@destroy')->name('destroy');
|
||||||
Route::post('store', 'ArticleNatureController@store')->name('store');
|
Route::post('store', 'ArticleNatureController@store')->name('store');
|
||||||
Route::get('edit/{id}', 'ArticleNatureController@edit')->name('edit');
|
Route::get('edit/{id}', 'ArticleNatureController@edit')->name('edit');
|
||||||
|
Route::get('getOptions/{id}', 'ArticleNatureController@getOptions')->name('getOptions');
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user