diff --git a/includes/modules/shipping/flat.php b/includes/modules/shipping/flat.php index 767719149b..d0894296f7 100644 --- a/includes/modules/shipping/flat.php +++ b/includes/modules/shipping/flat.php @@ -6,7 +6,7 @@ * @version $Id: Scott C Wilson 2022 Oct 16 Modified in v1.5.8a $ */ - class flat { + class flat extends base { /** * $_check is used to check the configuration key set up @@ -105,6 +105,13 @@ function update_status() { $this->enabled = false; } } + + if ($this->enabled) { + // ----- + // Give a watching observer the opportunity to disable the overall shipping module. + // + $this->notify('NOTIFY_SHIPPING_FLAT_UPDATE_STATUS', [], $this->enabled); + } } function quote($method = '') { diff --git a/includes/modules/shipping/freeoptions.php b/includes/modules/shipping/freeoptions.php index f335d5c338..57949cb867 100644 --- a/includes/modules/shipping/freeoptions.php +++ b/includes/modules/shipping/freeoptions.php @@ -196,6 +196,12 @@ protected function checkForFreeOptions() // are met. // $this->enabled = ($freeoptions_total === true || $freeoptions_weight === true || $freeoptions_items === true); + if ($this->enabled) { + // ----- + // Give a watching observer the opportunity to disable the overall shipping module. + // + $this->notify('NOTIFY_SHIPPING_FREEOPTIONS_UPDATE_STATUS', [], $this->enabled); + } } // ----- diff --git a/includes/modules/shipping/freeshipper.php b/includes/modules/shipping/freeshipper.php index f55227f5b4..bc2c62436e 100644 --- a/includes/modules/shipping/freeshipper.php +++ b/includes/modules/shipping/freeshipper.php @@ -6,7 +6,7 @@ * @version $Id: Scott C Wilson 2022 Oct 16 Modified in v1.5.8a $ */ // - class freeshipper { + class freeshipper extends base { /** * $_check is used to check the configuration key set up @@ -105,6 +105,13 @@ function update_status() { $this->enabled = false; } } + + if ($this->enabled) { + // ----- + // Give a watching observer the opportunity to disable the overall shipping module. + // + $this->notify('NOTIFY_SHIPPING_FREESHIPPER_UPDATE_STATUS', [], $this->enabled); + } } function quote($method = '') { diff --git a/includes/modules/shipping/item.php b/includes/modules/shipping/item.php index 6697c5e928..e92a2aaa17 100644 --- a/includes/modules/shipping/item.php +++ b/includes/modules/shipping/item.php @@ -7,7 +7,7 @@ */ - class item { + class item extends base { /** * $_check is used to check the configuration key set up @@ -107,6 +107,13 @@ function update_status() { $this->enabled = false; } } + + if ($this->enabled) { + // ----- + // Give a watching observer the opportunity to disable the overall shipping module. + // + $this->notify('NOTIFY_SHIPPING_ITEM_UPDATE_STATUS', [], $this->enabled); + } } function quote($method = '') { diff --git a/includes/modules/shipping/perweightunit.php b/includes/modules/shipping/perweightunit.php index 273eeebad2..8e9e0007bb 100644 --- a/includes/modules/shipping/perweightunit.php +++ b/includes/modules/shipping/perweightunit.php @@ -126,6 +126,13 @@ function update_status() { $this->enabled = false; } } + + if ($this->enabled) { + // ----- + // Give a watching observer the opportunity to disable the overall shipping module. + // + $this->notify('NOTIFY_SHIPPING_PERWEIGHTUNIT_UPDATE_STATUS', [], $this->enabled); + } } /** * Obtain quote from shipping system/calculations diff --git a/includes/modules/shipping/storepickup.php b/includes/modules/shipping/storepickup.php index b5776bc624..dc8e21f50b 100644 --- a/includes/modules/shipping/storepickup.php +++ b/includes/modules/shipping/storepickup.php @@ -123,7 +123,10 @@ function update_status() { // other status checks? if ($this->enabled) { - // other checks here + // ----- + // Give a watching observer the opportunity to disable the overall shipping module. + // + $this->notify('NOTIFY_SHIPPING_STOREPICKUP_UPDATE_STATUS', [], $this->enabled); } } /** diff --git a/includes/modules/shipping/table.php b/includes/modules/shipping/table.php index 33b4469606..ad1ad7a225 100644 --- a/includes/modules/shipping/table.php +++ b/includes/modules/shipping/table.php @@ -125,6 +125,13 @@ function update_status() { $this->enabled = false; } } + + if ($this->enabled) { + // ----- + // Give a watching observer the opportunity to disable the overall shipping module. + // + $this->notify('NOTIFY_SHIPPING_TABLE_UPDATE_STATUS', [], $this->enabled); + } } /** * Obtain quote from shipping system/calculations