diff --git a/packages/Webkul/Shop/src/Http/Controllers/ProductsCategoriesProxyController.php b/packages/Webkul/Shop/src/Http/Controllers/ProductsCategoriesProxyController.php index 7abca8acb..a780450ad 100644 --- a/packages/Webkul/Shop/src/Http/Controllers/ProductsCategoriesProxyController.php +++ b/packages/Webkul/Shop/src/Http/Controllers/ProductsCategoriesProxyController.php @@ -62,7 +62,7 @@ class ProductsCategoriesProxyController extends Controller { $slug = rtrim($slug, '/ '); - if (preg_match('/^([a-z-]+\/?)+$/', $slug)) { + if (preg_match('/^([a-z0-9-]+\/?)+$/', $slug)) { if (DB::table(app(CategoryTranslation::class)->getTable()) ->where('url_path', '=', $slug) @@ -84,9 +84,8 @@ class ProductsCategoriesProxyController extends Controller return view($this->_config['product_view'], compact('product', 'customer')); } - - } else { - throw new NotFoundHttpException(); } + + abort(404); } } \ No newline at end of file diff --git a/packages/Webkul/Shop/src/Http/routes.php b/packages/Webkul/Shop/src/Http/routes.php index c3c8601a3..150298101 100755 --- a/packages/Webkul/Shop/src/Http/routes.php +++ b/packages/Webkul/Shop/src/Http/routes.php @@ -302,7 +302,7 @@ Route::group(['middleware' => ['web', 'locale', 'theme', 'currency']], function 'product_view' => 'shop::products.view', 'category_view' => 'shop::products.index' ]) - ->where('slug', '^([a-z-]+\/?)+$') + ->where('slug', '^([a-z0-9-]+\/?)+$') ->name('shop.productOrCategory.index'); Route::fallback('Webkul\Shop\Http\Controllers\HomeController@notFound');