'alg_widget_currency_switcher', 'description' => __( 'WooCommerce Currency Switcher Widget', 'currency-switcher-woocommerce' ), ); parent::__construct( 'alg_widget_currency_switcher', __( 'WooCommerce Currency Switcher', 'currency-switcher-woocommerce' ), $widget_ops ); } /** * Outputs the content of the widget * * @version 1.0.0 * @since 1.0.0 * @param array $args * @param array $instance */ function widget( $args, $instance ) { echo $args['before_widget']; if ( ! empty( $instance['title'] ) ) { echo $args['before_title'] . apply_filters( 'widget_title', $instance['title'] ) . $args['after_title']; } if ( 'yes' === get_option( 'alg_wc_currency_switcher_enabled', 'yes' ) ) { switch ( $instance['switcher_type'] ) { case 'link_list': echo alg_currency_select_link_list(); break; case 'radio_list': echo alg_currency_select_radio_list(); break; default: echo alg_currency_select_drop_down_list(); break; } } else { echo __( 'Currency Switcher not enabled!', 'currency-switcher-woocommerce' ); } echo $args['after_widget']; } /** * Outputs the options form on admin * * @version 1.0.0 * @since 1.0.0 * @param array $instance The widget options */ function form( $instance ) { $title = ! empty( $instance['title'] ) ? $instance['title'] : ''; $switcher_type = ! empty( $instance['switcher_type'] ) ? $instance['switcher_type'] : 'drop_down'; ?>