merge with master
This commit is contained in:
commit
148ff7c1e8
|
|
@ -21,12 +21,13 @@ class CustomerDataGrid extends DataGrid
|
|||
|
||||
public function prepareQueryBuilder()
|
||||
{
|
||||
$queryBuilder = DB::table('customers as custs')
|
||||
->addSelect('custs.id as customer_id', 'custs.email', 'cg.name')
|
||||
->addSelect(DB::raw('CONCAT(custs.first_name, " ", custs.last_name) as full_name'))->leftJoin('customer_groups as cg', 'custs.customer_group_id', '=', 'cg.id');
|
||||
$queryBuilder = DB::table('customers')
|
||||
->leftJoin('customer_groups', 'customers.customer_group_id', '=', 'customer_groups.id')
|
||||
->addSelect('customers.id as customer_id', 'customers.email', 'customer_groups.name')
|
||||
->addSelect(DB::raw('CONCAT(customers.first_name, " ", customers.last_name) as full_name'));
|
||||
|
||||
$this->addFilter('customer_id', 'custs.id');
|
||||
$this->addFilter('full_name', DB::raw('CONCAT(custs.first_name, " ", custs.last_name)'));
|
||||
$this->addFilter('customer_id', 'customers.id');
|
||||
$this->addFilter('full_name', DB::raw('CONCAT(customers.first_name, " ", customers.last_name)'));
|
||||
|
||||
$this->setQueryBuilder($queryBuilder);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@ class AdminServiceProvider extends ServiceProvider
|
|||
*/
|
||||
public function boot()
|
||||
{
|
||||
// include __DIR__ . '/../Http/routes.php';
|
||||
$this->loadRoutesFrom(__DIR__ . '/../Http/routes.php');
|
||||
|
||||
$this->loadTranslationsFrom(__DIR__ . '/../Resources/lang', 'admin');
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@
|
|||
|
||||
<div class="page-content">
|
||||
@inject('customerGrid','Webkul\Admin\DataGrids\CustomerDataGrid')
|
||||
|
||||
{!! $customerGrid->render() !!}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -52,12 +52,9 @@ class ProductImage extends AbstractProduct
|
|||
*/
|
||||
public function getProductBaseImage($product)
|
||||
{
|
||||
if (! $product)
|
||||
return [];
|
||||
|
||||
$images = $product->images;
|
||||
$images = $product ? $product->images : null;
|
||||
|
||||
if ($images->count()) {
|
||||
if ($images && $images->count()) {
|
||||
$image = [
|
||||
'small_image_url' => url('cache/small/' . $images[0]->path),
|
||||
'medium_image_url' => url('cache/medium/' . $images[0]->path),
|
||||
|
|
|
|||
|
|
@ -217,6 +217,24 @@ class ProductFlat
|
|||
$productFlat->{$attribute->code . '_label'} = $attributeOption->admin_name;
|
||||
}
|
||||
}
|
||||
} elseif ($attribute->type == 'multiselect') {
|
||||
$attributeOptionIds = explode(',', $product->{$attribute->code});
|
||||
|
||||
if (count($attributeOptionIds)) {
|
||||
$attributeOptions = $this->attributeOptionRepository->findWhereIn('id', $attributeOptionIds);
|
||||
|
||||
$optionLabels = [];
|
||||
|
||||
foreach ($attributeOptions as $attributeOption) {
|
||||
if ($attributeOptionTranslation = $attributeOption->translate($locale->code)) {
|
||||
$optionLabels[] = $attributeOptionTranslation->label;
|
||||
} else {
|
||||
$optionLabels[] = $attributeOption->admin_name;
|
||||
}
|
||||
}
|
||||
|
||||
$productFlat->{$attribute->code . '_label'} = implode(', ', $optionLabels);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ use Webkul\Core\Repositories\SliderRepository;
|
|||
*/
|
||||
public function index()
|
||||
{
|
||||
if (request()->route('any'))
|
||||
if (request()->route()->getName() != 'shop.home.index')
|
||||
abort(404);
|
||||
|
||||
$currentChannel = core()->getCurrentChannel();
|
||||
|
|
|
|||
|
|
@ -275,5 +275,7 @@ Route::group(['middleware' => ['web', 'locale', 'theme', 'currency']], function
|
|||
});
|
||||
//customer routes end here
|
||||
|
||||
Route::get('/{any?}', 'Webkul\Shop\Http\Controllers\HomeController@index');
|
||||
// Route::get('/{any?}', 'Webkul\Shop\Http\Controllers\HomeController@index');
|
||||
|
||||
Route::fallback('Webkul\Shop\Http\Controllers\HomeController@index');
|
||||
});
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ class ShopServiceProvider extends ServiceProvider
|
|||
*/
|
||||
public function boot(Router $router)
|
||||
{
|
||||
include __DIR__ . '/../Http/routes.php';
|
||||
$this->loadRoutesFrom(__DIR__ . '/../Http/routes.php');
|
||||
|
||||
$this->loadTranslationsFrom(__DIR__ . '/../Resources/lang', 'shop');
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue