Factory.php
2 weeks ago
MulticurrencyHooks.php
2 weeks ago
class-wcml-mix-and-match-products.php
2 weeks ago
Factory.php
28 lines
| 1 | <?php |
| 2 | |
| 3 | namespace WCML\Compatibility\WcMixAndMatch; |
| 4 | |
| 5 | use WCML\Compatibility\ComponentFactory; |
| 6 | use WCML\StandAlone\IStandAloneAction; |
| 7 | |
| 8 | use function WCML\functions\getSitePress; |
| 9 | use function WCML\functions\isStandAlone; |
| 10 | |
| 11 | class Factory extends ComponentFactory implements IStandAloneAction { |
| 12 | |
| 13 | public function create() { |
| 14 | $hooks = []; |
| 15 | |
| 16 | if ( wcml_is_multi_currency_on() ) { |
| 17 | $hooks[] = new MulticurrencyHooks(); |
| 18 | } |
| 19 | |
| 20 | if ( ! isStandAlone() ) { |
| 21 | $hooks[] = new \WCML_Mix_And_Match_Products( getSitePress() ); |
| 22 | } |
| 23 | |
| 24 | return $hooks; |
| 25 | } |
| 26 | |
| 27 | } |
| 28 |