0

Can we use 2 different modules(say CatalogSearch and LayeredNavigation) in a single custom overridden vendor.

ie) I have

Vendor/MyCatalogSearch and

Vendor/MyLayeredNavigation

both the modules under single "Vendor"

Or should i use as below?

Vendor1/MyCatalogSearch

Vendor2/MyLayeredNavigation

  • Is this the Magento2 standard of using under 2 different Vendors or can it be used as the 1st way as shown! – Sushivam Aug 16 '16 at 6:17
  • You can use single vendor for multiple modules. – Mohit Kumar Arora Aug 16 '16 at 6:17
1

You can use single vendor (naming convention) for multiple modules.

For example

Mycommonvendor/Moduleone

Mycommonvendor/Moduletwo

One

\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::MODULE,
    'Mycommonvendor/Moduleone',
    __DIR__
);

Two

\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::MODULE,
    'Mycommonvendor/Moduletwo',
    __DIR__
);

Note : Not recommended to use core modules naming convention.

Hope this helps.

| improve this answer | |
  • Actually my doubt was... Say for eg i am overriding Result.php from CatalogSearch module... Now i want to override this class in 2 different custom modules...Should i override the same class in 2 different modules? – Sushivam Aug 16 '16 at 7:44
  • Which custom modules 'type' in di will it consider? – Sushivam Aug 16 '16 at 7:46
  • If Module "A" is overriding result.php. You need to override module 'A' by other module (Module "B") to override result.php again. – Krishna ijjada Aug 16 '16 at 8:12
  • Can u check this magento.stackexchange.com/questions/131556/… have described what i asked – Sushivam Aug 16 '16 at 8:14
  • Assume the question intention is Naming convention. Still have doubts please ask new question with what you have tried. – Krishna ijjada Aug 16 '16 at 8:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.