Fixed issues #378, #379 and #373

This commit is contained in:
Prashant Singh 2018-12-22 15:02:10 +05:30
parent 81da5bd1d1
commit e526af061e
5 changed files with 27 additions and 23 deletions

View File

@ -150,22 +150,22 @@ class AttributeDataGrid
'type' => 'string',
'label' => 'Type',
], [
'name' => 'is_required',
'column' => 'is_required',
'alias' => 'attributeIsRequired',
'type' => 'boolean',
'label' => 'Required',
], [
'name' => 'is_unique',
'column' => 'is_unique',
'alias' => 'attributeIsUnique',
'type' => 'boolean',
'label' => 'Unique',
], [
'name' => 'value_per_locale',
'column' => 'value_per_locale',
'alias' => 'attributeValuePerLocale',
'type' => 'boolean',
'label' => 'Locale based',
], [
'name' => 'value_per_channel',
'column' => 'value_per_channel',
'alias' => 'attributeValuePerChannel',
'type' => 'boolean',
'label' => 'Channel based',

View File

@ -123,7 +123,7 @@ class ProductDataGrid
'type' => 'string',
'label' => 'Product Quantity',
'sortable' => true,
],
]
],
'filterable' => [
@ -149,7 +149,7 @@ class ProductDataGrid
'type' => 'string',
'label' => 'Product Type',
], [
'name' => 'prods.status',
'column' => 'prods.status',
'alias' => 'ProductStatus',
'type' => 'boolean',
'label' => 'Status'

View File

@ -73,6 +73,10 @@ class Product {
$variants = [];
$found = $this->productGrid->findOneByField('product_id', $product->id);
//extra measure to stop duplicate entries
if($found == null) {
$this->productGrid->create($gridObject);
if($product->type == 'configurable') {
@ -93,6 +97,7 @@ class Product {
$this->productGrid->create($variantObj);
}
}
}
return true;
}

View File

@ -142,7 +142,6 @@ class ProductController extends Controller
'sku' => ['required', 'unique:products,sku', new \Webkul\Core\Contracts\Validations\Slug]
]);
//before store of the product
Event::fire('catalog.product.create.before');

View File

@ -631,7 +631,7 @@ class DataGrid
throw new \Exception('Multiple Sort keys Found, Please Resolve the URL Manually.');
}
} elseif ($key=="search") {
// dd($this->searchable, $parsed);
$count_keys = count(array_keys($value));
if($count_keys==1)
$this->query->where(function ($query) use ($parsed) {