Merge pull request #18437 from colemanw/api4Perms
[civicrm-core.git] / ext / eventcart / eventcart.php
index 2199bcd32acd8510ab4f85ae99985f637e048dcb..9fac71ca9847e27b6fb7c668f2a725c48b602047 100644 (file)
@@ -15,7 +15,10 @@ function eventcart_civicrm_config(&$config) {
     return;
   }
   Civi::$statics[__FUNCTION__] = 1;
-  Civi::dispatcher()->addListener('hook_civicrm_pageRun', 'CRM_Event_Cart_PageCallback::run');
+  // Since as a hidden extension it's always enabled, until this is a "real" extension you can turn off we need to check the legacy setting.
+  if ((bool) Civi::settings()->get('enable_cart')) {
+    Civi::dispatcher()->addListener('hook_civicrm_pageRun', 'CRM_Event_Cart_PageCallback::run');
+  }
 
   _eventcart_civix_civicrm_config($config);
 }