Support the ongoing development of Laravel.io →
posted 2 years ago
Last updated 1 year ago.
0
moderator

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.

0

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.

0
moderator

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...

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');
0

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-d...

even though, i am not able to find how to customize route and controllers?

0
moderator

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.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.