Hello @amitleuva1987 I think it is good if you link to the package you use.
Personally I have never heard about bagisto so I don't know it exactly. If the package is customizable you can publish the routes and/or config and change them.
Hi @tvbeek,
'Bagisto ' is a Laravel open-source ecommerce package. below is the url to git repo. https://github.com/bagisto/bagisto
But, there is no proper documentation on how to customize the package.
Hello @amitleuva1987
I think the package isn't really made flexible to edit a module. If you search on route ( https://github.com/bagisto/bagisto/search?q=route ) you see different places where routes are defined. But the only flexible part that I see is the app.admin_url
config.
It is possible to redefine the routes in your own routes file, if all the code use the route names it could work. You also need to be sure that you have all the needed middleware available.
Example for the get/countries route: https://github.com/bagisto/bagisto/blob/master/packages/Webkul/Shop/src/Routes/checkout-routes.php#L12-L14
Route::get('mycountriesurl',[CustomCountryController::class, 'getCountries'])->defaults('_config', [
'view' => 'shop::test'
])->middleware(['web', 'locale', 'theme', 'currency'])
->name('get.countries');
And if you want to be sure that the default url isn't working you need to define that also.
// with a 404
Route::get('get/countries', [MyGeneric404Controller::class, 'doesNotExist']);
// Redirect to my new url
Route::redirect('get/countries'', 'mycountriesurl');
Hi @tvbeek ,
Thanks for the reply. I went through documents for bagisto and below is what i find for customizing.
https://bagisto.com/en/step-by-step-guide-for-bagisto-module-development/
even though, i am not able to find how to customize route and controllers?
Hello @amitleuva1987 ,
I did read that page, it is about creating a new module and not about customizing an existing one. It is possible to create a copy of an existing module and use that. In that case it is most useful to create a fork so you can keep receiving the updates of the existing module.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community