TranslationEditor
1 month ago
BundledItemHooks.php
1 month ago
Factory.php
1 month ago
MulticurrencyHooks.php
1 month ago
class-wcml-product-bundles.php
1 month ago
class-wcml-wc-product-bundles-items.php
1 month ago
Factory.php
31 lines
| 1 | <?php |
| 2 | |
| 3 | namespace WCML\Compatibility\WcProductBundles; |
| 4 | |
| 5 | use WCML\Compatibility\ComponentFactory; |
| 6 | use WCML\StandAlone\IStandAloneAction; |
| 7 | use WCML_Product_Bundles; |
| 8 | use WCML_WC_Product_Bundles_Items; |
| 9 | use function WCML\functions\getSitePress; |
| 10 | use function WCML\functions\getWooCommerceWpml; |
| 11 | use function WCML\functions\isStandAlone; |
| 12 | |
| 13 | class Factory extends ComponentFactory implements IStandAloneAction { |
| 14 | |
| 15 | public function create() { |
| 16 | $hooks = []; |
| 17 | |
| 18 | if ( wcml_is_multi_currency_on() ) { |
| 19 | $hooks[] = new MulticurrencyHooks(); |
| 20 | } |
| 21 | |
| 22 | if ( ! isStandAlone() ) { |
| 23 | $hooks[] = new WCML_Product_Bundles( getSitePress(), getWooCommerceWpml(), new WCML_WC_Product_Bundles_Items(), self::getWpdb() ); |
| 24 | $hooks[] = new TranslationEditor\GroupsAndLabels(); |
| 25 | $hooks[] = new BundledItemHooks(); |
| 26 | } |
| 27 | |
| 28 | return $hooks; |
| 29 | } |
| 30 | } |
| 31 |