OrderItems
1 week ago
Factory.php
1 week ago
MulticurrencyHooks.php
1 week ago
class-wcml-table-rate-shipping.php
1 week ago
Factory.php
31 lines
| 1 | <?php |
| 2 | |
| 3 | namespace WCML\Compatibility\TableRateShipping; |
| 4 | |
| 5 | use WCML\Compatibility\ComponentFactory; |
| 6 | use WCML\StandAlone\IStandAloneAction; |
| 7 | use WCML_Table_Rate_Shipping; |
| 8 | use function WCML\functions\getSitePress; |
| 9 | use function WCML\functions\getWooCommerceWpml; |
| 10 | use function WCML\functions\isStandAlone; |
| 11 | |
| 12 | class Factory extends ComponentFactory implements IStandAloneAction { |
| 13 | |
| 14 | public function create() { |
| 15 | $hooks = []; |
| 16 | |
| 17 | $woocommerce_wpml = getWooCommerceWpml(); |
| 18 | |
| 19 | if ( wcml_is_multi_currency_on() ) { |
| 20 | $hooks[] = new MulticurrencyHooks( $woocommerce_wpml, $woocommerce_wpml->get_multi_currency() ); |
| 21 | } |
| 22 | |
| 23 | if ( ! isStandAlone() ) { |
| 24 | $hooks[] = new WCML_Table_Rate_Shipping( getSitePress(), $woocommerce_wpml, self::getWpdb() ); |
| 25 | } |
| 26 | |
| 27 | return $hooks; |
| 28 | } |
| 29 | |
| 30 | } |
| 31 |