Disable Addon For Storefront

Hi,

I found this old topic,

https://cscart.uservoice.com/forums/134344-cs-cart/suggestions/3003485-enable-disable-addons-on-each-store-not-a-globa

But I am not sure how to achieve what I want to do with CSCART.

I am currently in the middle of developing a new theme for our storefront. We are running multiple storefronts. As part of my new theme, I have created a new addon (just for this theme).

There are some controllers in the new theme addon that I don't want running for my legacy themes.

I realise in that thread you can control settings for an addon per storefront, but this would not stop the PHP controllers running.

Any ideas? Thanks..

Hi,

I found this old topic,

https://cscart.uservoice.com/forums/134344-cs-cart/suggestions/3003485-enable-disable-addons-on-each-store-not-a-globa

But I am not sure how to achieve what I want to do with CSCART.

I am currently in the middle of developing a new theme for our storefront. We are running multiple storefronts. As part of my new theme, I have created a new addon (just for this theme).

There are some controllers in the new theme addon that I don't want running for my legacy themes.

I realise in that thread you can control settings for an addon per storefront, but this would not stop the PHP controllers running.

Any ideas? Thanks..

Hello!

You can create an add-on setting and enable it only for the storefronts with the new theme. In the controllers you can add a condition:

if (Registry::get("addons.addon_name.setting_name") == 'Y') {

}

As alternative, you can use conditions by current theme

if (Registry::get("runtime.layout.theme_name") == 'bright_theme') {
    ....
}
Hope it will help you