WCML_Compatibility

The WooCommerce Multilingual WCML Compatibility class.

Defined (1)

The class is defined in the following location(s).

/inc/class-wcml-compatibility.php  
  1. class WCML_Compatibility { 
  2.  
  3. /** 
  4. * @var SitePress 
  5. */ 
  6. public $sitepress; 
  7.  
  8. /** 
  9. * @var woocommerce_wpml 
  10. */ 
  11. public $woocommerce_wpml; 
  12.  
  13. /** 
  14. * @var wpdb 
  15. */ 
  16. public $wpdb; 
  17.  
  18. function __construct( &$sitepress, &$woocommerce_wpml, &$wpdb ) { 
  19. $this->sitepress = $sitepress; 
  20. $this->woocommerce_wpml = $woocommerce_wpml; 
  21. $this->wpdb = $wpdb; 
  22. $this->init(); 
  23.  
  24.  
  25. function init() { 
  26. //hardcoded list of extensions and check which ones the user has and then include the corresponding file from the *compatibility* folder 
  27.  
  28. //WooCommerce Tab Manager plugin 
  29. if(class_exists('WC_Tab_Manager')) { 
  30. global $woocommerce; 
  31. $this->tab_manager = new WCML_Tab_Manager( $this->sitepress, $woocommerce, $this->woocommerce_wpml, $this->wpdb ); 
  32.  
  33. //WooCommerce Table Rate Shipping plugin 
  34. if(defined('TABLE_RATE_SHIPPING_VERSION')) { 
  35. $this->table_rate_shipping = new WCML_Table_Rate_Shipping( $this->sitepress, $this->woocommerce_wpml ); 
  36.  
  37. //WooCommerce Subscriptions 
  38. if(class_exists('WC_Subscriptions')) { 
  39. $this->wp_subscriptions = new WCML_WC_Subscriptions(); 
  40.  
  41. //WooCommerce Name Your Price 
  42. if(class_exists('WC_Name_Your_Price')) { 
  43. $this->name_your_price = new WCML_WC_Name_Your_Price(); 
  44.  
  45. //Product Bundle 
  46. if(class_exists('WC_Product_Bundle')) { 
  47. if( version_compare( WC_PB()->version, '5.0.0', '<' ) ) { 
  48. $this->product_bundles = new WCML_Product_Bundles_Legacy( $this->sitepress, $this->woocommerce_wpml ); 
  49. }else{ 
  50. $product_bundle_items = new WCML_WC_Product_Bundles_Items(); 
  51. $this->product_bundles = new WCML_Product_Bundles( $this->sitepress, $this->woocommerce_wpml, $product_bundle_items ); 
  52.  
  53. // WooCommerce Variation Swatches and Photos 
  54. if(class_exists('WC_SwatchesPlugin')) {  
  55. $this->variation_sp = new WCML_Variation_Swatches_and_Photos(); 
  56.  
  57. // Product Add-ons 
  58. if(class_exists( 'Product_Addon_Display' )) { 
  59. $this->product_addons = new WCML_Product_Addons( $this->sitepress ); 
  60.  
  61. // Product Per Product Shipping 
  62. if(defined( 'PER_PRODUCT_SHIPPING_VERSION' )) { 
  63. new WCML_Per_Product_Shipping(); 
  64. //Store Exporter plugin 
  65. if(defined('WOO_CE_PATH')) { 
  66. $this->wc_exporter = new WCML_wcExporter(); 
  67.  
  68. //Gravity Forms 
  69. if(class_exists('GFForms')) { 
  70. $this->gravityforms = new WCML_gravityforms(); 
  71.  
  72. //Sensei WooThemes 
  73. if(class_exists('WooThemes_Sensei')) { 
  74. $this->sensei = new WCML_sensei(); 
  75.  
  76. //Extra Product Options 
  77. if(class_exists('TM_Extra_Product_Options')) { 
  78. $this->extra_product_options = new WCML_Extra_Product_Options(); 
  79.  
  80. // Dynamic Pricing 
  81. if ( class_exists('WC_Dynamic_Pricing') ) { 
  82. $this->dynamic_pricing = new WCML_Dynamic_Pricing( $this->sitepress ); 
  83.  
  84. // WooCommerce Bookings 
  85. if(defined( 'WC_BOOKINGS_VERSION' ) && version_compare(WC_BOOKINGS_VERSION, '1.7.8', '>=') ) { 
  86. $this->bookings = new WCML_Bookings( $this->sitepress, $this->woocommerce_wpml, $this->wpdb ); 
  87.  
  88. // WooCommerce Accommodation Bookings 
  89. if( defined( 'WC_ACCOMMODATION_BOOKINGS_VERSION' ) ) { 
  90. $this->accomodation_bookings = new WCML_Accommodation_Bookings( $this->woocommerce_wpml ); 
  91.  
  92. // WooCommerce Checkout Field Editor 
  93. if ( function_exists( 'woocommerce_init_checkout_field_editor' ) ) { 
  94. $this->checkout_field_editor = new WCML_Checkout_Field_Editor(); 
  95.  
  96. if (class_exists('WC_Bulk_Stock_Management')) { 
  97. $this->wc_bulk_stock_management = new WCML_Bulk_Stock_Management(); 
  98.  
  99. // WooCommerce Advanced Ajax Layered Navigation 
  100. include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); 
  101. if ( is_plugin_active( 'woocommerce-ajax-layered-nav/ajax_layered_nav-widget.php' ) ) { 
  102. $this->wc_ajax_layered_nav_widget = new WCML_Ajax_Layered_Nav_Widget(); 
  103.  
  104. if ( is_plugin_active( 'woocommerce-ajax-cart/wooajaxcart.php' ) ) { 
  105. $this->wc_ajax_cart = new WCML_WC_Ajax_Cart(); 
  106.  
  107. // woocommerce composite products 
  108. if ( isset( $GLOBALS[ 'woocommerce_composite_products' ] ) ) { 
  109. $this->wc_composite_products = new WCML_Composite_Products( $this->sitepress, $this->woocommerce_wpml ); 
  110.  
  111. // woocommerce checkout addons 
  112. if (function_exists('init_woocommerce_checkout_add_ons')) { 
  113. $this->wc_checkout_addons = new WCML_Checkout_Addons(); 
  114.  
  115. // woocommerce checkout addons 
  116. if ( wp_get_theme() == 'Flatsome' ) { 
  117. $this->flatsome = new WCML_Flatsome(); 
  118.  
  119. if (class_exists('WC_Mix_and_Match')) { 
  120. $this->mix_and_match_products = new WCML_Mix_and_Match_Products(); 
  121.  
  122. if ( defined( 'WPSEO_VERSION') ) { 
  123. $this->wpseo = new WCML_WPSEO(); 
  124.  
  125. //Adventure Tours theme 
  126. if( function_exists( 'adventure_tours_check' ) ) { 
  127. $this->adventure_tours = new WCML_Adventure_tours(); 
  128.  
  129. //Aurum Theme 
  130. if( wp_get_theme() == 'Aurum' ) { 
  131. new WCML_Aurum(); 
  132.  
  133. // Visual Products Configurator 
  134. if( class_exists( 'Vpc' ) ) { 
  135. $this->vpc = new WCML_Vpc(); 
  136.  
  137. // WooCommerce Show Single Variations 
  138. if( defined( 'JCK_WSSV_PATH' ) ) { 
  139. new WCML_JCK_WSSV(); 
  140.  
  141. // WooCommerce Print Invoices 
  142. if( class_exists( 'WC_PIP' ) ) { 
  143. $this->pip = new WCML_Pip(); 
  144.  
  145. // The Events Calendar 
  146. if( class_exists( 'Tribe__Events__Main' ) ) { 
  147. new WCML_The_Events_Calendar( $this->sitepress, $this->woocommerce_wpml ); 
  148.  
  149. // Klarna Gateway 
  150. if( class_exists( 'WC_Gateway_Klarna' ) ) { 
  151. $this->klarna_gateway = new WCML_Klarna_Gateway(); 
  152. $this->klarna_gateway->add_hooks(); 
  153.  
  154. // YITH_WCQV 
  155. if( class_exists( 'YITH_WCQV' ) ) { 
  156. $this->yith_wcqv = new WCML_YITH_WCQV(); 
  157. $this->yith_wcqv->add_hooks(); 
  158.  
  159. // Woocommerce Memberships 
  160. if( class_exists( 'WC_Memberships' ) ) { 
  161. $this->wc_memberships = new WCML_WC_Memberships(); 
  162. $this->wc_memberships->add_hooks(); 
  163.  
  164.  
  165.