| 1 |
<?php |
| 2 |
|
| 3 |
namespace TierPricingTable\Addons; |
| 4 |
|
| 5 |
use TierPricingTable\Addons\AdvancedQuantityOptions\AdvancedQuantityOptionsAddon; |
| 6 |
use TierPricingTable\Addons\CategoryTiers\CategoryTierAddon; |
| 7 |
use TierPricingTable\Addons\Coupons\CouponsAddon; |
| 8 |
use TierPricingTable\Addons\CustomColumns\CustomColumnsAddon; |
| 9 |
use TierPricingTable\Addons\GlobalTieredPricing\GlobalTieredPricingAddon; |
| 10 |
use TierPricingTable\Addons\ManualOrders\ManualOrdersAddon; |
| 11 |
use TierPricingTable\Addons\MinQuantity\MinQuantity; |
| 12 |
use TierPricingTable\Addons\PluginsRecommendations\PluginsRecommendationsAddon; |
| 13 |
use TierPricingTable\Addons\ProductCatalogLoop\ProductCatalogLoop; |
| 14 |
use TierPricingTable\Addons\ReactProductEditorAddon\ReactProductEditorAddon; |
| 15 |
use TierPricingTable\Addons\RoleBasedPricing\RoleBasedPricingAddon; |
| 16 |
use TierPricingTable\Addons\TierLabels\TierLabelsAddon; |
| 17 |
use TierPricingTable\Addons\Tools\ToolsAddon; |
| 18 |
use TierPricingTable\Core\ServiceContainerTrait; |
| 19 |
class Addons { |
| 20 |
use ServiceContainerTrait; |
| 21 |
/** |
| 22 |
* Addons constructor. |
| 23 |
*/ |
| 24 |
public function __construct() { |
| 25 |
$this->init(); |
| 26 |
} |
| 27 |
|
| 28 |
public function init() { |
| 29 |
$addons = array( |
| 30 |
ManualOrdersAddon::class => new ManualOrdersAddon(), |
| 31 |
GlobalTieredPricingAddon::class => new GlobalTieredPricingAddon(), |
| 32 |
CouponsAddon::class => new CouponsAddon(), |
| 33 |
RoleBasedPricingAddon::class => new RoleBasedPricingAddon(), |
| 34 |
CategoryTierAddon::class => new CategoryTierAddon(), |
| 35 |
AdvancedQuantityOptionsAddon::class => new AdvancedQuantityOptionsAddon(), |
| 36 |
PluginsRecommendationsAddon::class => new PluginsRecommendationsAddon(), |
| 37 |
CustomColumnsAddon::class => new CustomColumnsAddon(), |
| 38 |
ProductCatalogLoop::class => new ProductCatalogLoop(), |
| 39 |
ReactProductEditorAddon::class => new ReactProductEditorAddon(), |
| 40 |
TierLabelsAddon::class => new TierLabelsAddon(), |
| 41 |
ToolsAddon::class => new ToolsAddon(), |
| 42 |
); |
| 43 |
$addons = apply_filters( 'tiered_pricing_table/addons/list', $addons ); |
| 44 |
foreach ( $addons as $addon ) { |
| 45 |
if ( $addon->isEnabled() ) { |
| 46 |
$addon->run(); |
| 47 |
} |
| 48 |
} |
| 49 |
} |
| 50 |
|
| 51 |
} |
| 52 |
|