'alg_wc_widget_left_to_free_shipping', 'description' => __( 'Amount Left for Free Shipping Widget', 'amount-left-free-shipping-woocommerce' ), ); parent::__construct( 'alg_wc_widget_left_to_free_shipping', __( 'Amount Left for Free Shipping', 'amount-left-free-shipping-woocommerce' ), $widget_ops ); } /** * Outputs the content of the widget * * @param array $args * @param array $instance * @version 1.0.0 * @since 1.0.0 */ 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']; } echo alg_get_left_to_free_shipping( $instance['content'] ); echo $args['after_widget']; } /** * Outputs the options form on admin * * @param array $instance The widget options * @version 1.3.0 * @since 1.0.0 */ function form( $instance ) { $title = ! empty( $instance['title'] ) ? $instance['title'] : __( 'Amount Left for Free Shipping', 'amount-left-free-shipping-woocommerce' ); $content = ! empty( $instance['content'] ) ? $instance['content'] : sprintf( __( '%s left for free shipping', 'amount-left-free-shipping-woocommerce' ), '%amount_left_for_free_shipping%' ); ?>