HEX
Server: Apache/2.4.65 (Unix) OpenSSL/1.1.1k
System: Linux server-manager.elshandawiily.com 4.18.0-553.87.1.el8_10.x86_64 #1 SMP Mon Dec 1 05:11:16 EST 2025 x86_64
User: elshanda (1002)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: /home/elshanda/public_html/wp-content/plugins/woocommerce-multilingual/inc/class-wcml-widgets.php
<?php

class WCML_Widgets {

	private $woocommerce_wpml;

	/**
	 * WCML_Widgets constructor.
	 *
	 * @param woocommerce_wpml $woocommerce_wpml
	 */
	public function __construct( $woocommerce_wpml ) {
		// @todo Cover by tests, required for wcml-3037.
		$this->woocommerce_wpml = $woocommerce_wpml;

		add_action( 'widgets_init', [ $this, 'register_widgets' ] );
	}

	public function register_widgets() {

		if ( $this->woocommerce_wpml->settings['enable_multi_currency'] == WCML_MULTI_CURRENCIES_INDEPENDENT ) {
			register_widget( 'WCML_Currency_Switcher_Widget' );
		}

		if ( $this->woocommerce_wpml->settings['cart_sync']['currency_switch'] == WCML_CART_CLEAR || $this->woocommerce_wpml->settings['cart_sync']['lang_switch'] == WCML_CART_CLEAR ) {
			register_widget( 'WCML_Cart_Removed_Items_Widget' );
		}

	}

}