Merge pull request #849 from jitendra-webkul/jitendra

Fixed urldecode issue in search temm
This commit is contained in:
Jitendra Singh 2019-04-18 17:17:55 +05:30 committed by GitHub
commit d2868f6316
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -586,7 +586,8 @@ class ProductRepository extends Repository
*
* @return Collection
*/
public function searchProductByAttribute($term) {
public function searchProductByAttribute($term)
{
$results = app('Webkul\Product\Repositories\ProductFlatRepository')->scopeQuery(function($query) use($term) {
$channel = request()->get('channel') ?: (core()->getCurrentChannelCode() ?: core()->getDefaultChannelCode());
@ -599,7 +600,7 @@ class ProductRepository extends Repository
->where('product_flat.channel', $channel)
->where('product_flat.locale', $locale)
->whereNotNull('product_flat.url_key')
->where('product_flat.name', 'like', '%' . $term . '%')
->where('product_flat.name', 'like', '%' . urldecode($term) . '%')
->orderBy('product_id', 'desc');
})->paginate(16);

View File

@ -33,7 +33,8 @@ class SearchRepository extends Repository
return 'Webkul\Product\Contracts\Product';
}
public function searchAttributes() {
public function searchAttributes()
{
}
public function search($data) {