Show Products widget only when WC is active

[MAILPOET-1843]
This commit is contained in:
Ján Mikláš
2019-04-04 11:25:47 +02:00
committed by Rostislav Wolný
parent 42f43e96e1
commit e2080eea2d
4 changed files with 19 additions and 1 deletions

View File

@@ -548,6 +548,9 @@ Module.ProductsWidgetView = base.WidgetView.extend({
});
App.on('before:start', function beforeStartApp(BeforeStartApp) {
if (!window.mailpoet_woocommerce_active) {
return;
}
BeforeStartApp.registerBlockType('products', {
blockModel: Module.ProductsBlockModel,
blockView: Module.ProductsBlockView,