Please tell me where is routes file of product details page on frontend ?
-
Please tell me where is routes file of product details page on frontend ? I could not find route file of this url "http://127.0.0.1:8000/product_1" ...... this url of product's detail page on frontend.
And i am not finding view file of product details page on frontend not admin.
Please solve me issue.
Thanks
-
Hi @_developer_12
For routes file - packages/Webkul/Shop/src/Http/routes.php
For view file - packages/Webkul/Shop/src/Resources/views/products/views -
Thanks for reply.
After a long debugging we just found that:
We are using theme velocity and for this views files are located at:
\resources\themes\velocity\views\products
We found the files but not found the place where the path is define to load these files.
Found following route:
Route::fallback(\Webkul\Shop\Http\Controllers\ProductsCategoriesProxyController::class . '@index')
->defaults('_config', [
'product_view' => 'shop::products.view',
'category_view' => 'shop::products.index'
])
->name('shop.productOrCategory.index');Can you suggest, where is the path define to load view files of velocity theme?
-
@_developer_12
packages/Webkul/Velocity/src/Resources/views/shop/products/view -
Thanks for quick reply.
The path you have shared is NOT working for velocity theme.
Following path is working for velocity theme.
\resources\themes\velocity\views\products
Can you suggest in application where the path is defined?
-
@_developer_12
It works according to current selected theme, for both theme route is defined in
same file- packages/Webkul/Shop/src/Http/routes.php -
As I have shared I found following code in route as:
Route::fallback(\Webkul\Shop\Http\Controllers\ProductsCategoriesProxyController::class . '@index')
->defaults('_config', [
'product_view' => 'shop::products.view',
'category_view' => 'shop::products.index'
])
->name('shop.productOrCategory.index');For "product_view" its calling view file from
\resources\themes\velocity\views\products
Instead of:
packages/Webkul/Velocity/src/Resources/views/shop/products/view
So there are two questions:
-
why is it not calling view file from packages/Webkul/Velocity/src/Resources/views/shop/products/view
-
As it calling from \resources\themes\velocity\views\products, then where is path is defined in application?
Hope you have got my point, please suggest.
-
-
Hello there,
Answers:-
1 - In PROJECT_ROOT/config/themes.php, we've declared views_path, that's why the files are being called from resources directory.
2 - In depth routes are being called from the shop package, but it will render the file according to the current theme selected.
/packages/Webkul/Theme/src/ThemeViewFinder.php->findNamespacedView, this function calls the respective file dynamically.
thanks & best regards!
feel free to ask further queries.