'', 'title' => '', 'sub_title' => '', 'at_all_pricing_items' => '', 'column_number' => 4, 'display_type' => 'column', 'view_all_option' => 'disable', 'all_link_text' => '', 'all_link_url' => '', 'enable_prev_next' => 1, 'background_options' => 'default' ); function __construct() { parent::__construct( /*Base ID of your widget*/ 'beauty_studio_pricing', /*Widget name will appear in UI*/ esc_html__( 'AT Pricing Widget', 'beauty-studio' ), /*Widget description*/ array( 'description' => esc_html__( 'Show Pricing Section beautifully', 'beauty-studio' ) ) ); } /*Widget Backend*/ public function form( $instance ) { $instance = wp_parse_args( (array) $instance, $this->defaults ); /*default values*/ $unique_id = esc_attr( $instance['unique_id'] ); $title = esc_attr( $instance['title'] ); $sub_title = esc_textarea( $instance['sub_title'] ); $at_all_page_items = $instance['at_all_pricing_items']; $column_number = absint( $instance['column_number'] ); $display_type = esc_attr( $instance[ 'display_type' ] ); $view_all_option = esc_attr( $instance[ 'view_all_option' ] ); $all_link_text = esc_attr( $instance['all_link_text'] ); $all_link_url = esc_url( $instance['all_link_url'] ); $enable_prev_next = esc_attr( $instance['enable_prev_next'] ); $background_options = esc_attr( $instance['background_options'] ); ?>



0 ){ foreach ($at_all_page_items as $price_detail){ $repeater_price_img_id = $this->get_field_id( 'at_all_pricing_items') .$total_repeater.'price_img'; $repeater_price_img_name = $this->get_field_name( 'at_all_pricing_items' ).'['.$total_repeater.']['.'price_img'.']'; $repeater_title_id = $this->get_field_id( 'at_all_pricing_items') .$total_repeater.'title'; $repeater_title_name = $this->get_field_name( 'at_all_pricing_items' ).'['.$total_repeater.']['.'title'.']'; $repeater_sub_title_id = $this->get_field_id( 'at_all_pricing_items') .$total_repeater.'sub_title'; $repeater_sub_title_name = $this->get_field_name( 'at_all_pricing_items' ).'['.$total_repeater.']['.'sub_title'.']'; $repeater_price_symbol_id = $this->get_field_id( 'at_all_pricing_items') .$total_repeater.'price_symbol'; $repeater_price_symbol_name = $this->get_field_name( 'at_all_pricing_items' ).'['.$total_repeater.']['.'price_symbol'.']'; $repeater_price_id = $this->get_field_id( 'at_all_pricing_items') .$total_repeater.'price'; $repeater_price_name = $this->get_field_name( 'at_all_pricing_items' ).'['.$total_repeater.']['.'price'.']'; $repeater_price_features_id = $this->get_field_id( 'at_all_pricing_items') .$total_repeater.'price_features'; $repeater_price__features_name = $this->get_field_name( 'at_all_pricing_items' ).'['.$total_repeater.']['.'price_features'.']'; $repeater_button_text_id = $this->get_field_id( 'at_all_pricing_items') .$total_repeater.'button_text'; $repeater_button_text_name = $this->get_field_name( 'at_all_pricing_items' ).'['.$total_repeater.']['.'button_text'.']'; $repeater_price_link_id = $this->get_field_id( 'at_all_pricing_items') .$total_repeater.'price_link'; $repeater_price_link_name = $this->get_field_name( 'at_all_pricing_items' ).'['.$total_repeater.']['.'price_link'.']'; ?>

get_field_id( 'at_all_pricing_items') .$coder_repeater_depth.'price_img'; $repeater_price_img_name = $this->get_field_name( 'at_all_pricing_items' ).'['.$coder_repeater_depth.']['.'price_img'.']'; $repeater_title_id = $this->get_field_id( 'at_all_pricing_items') .$coder_repeater_depth.'title'; $repeater_title_name = $this->get_field_name( 'at_all_pricing_items' ).'['.$coder_repeater_depth.']['.'title'.']'; $repeater_sub_title_id = $this->get_field_id( 'at_all_pricing_items') .$coder_repeater_depth.'sub_title'; $repeater_sub_title_name = $this->get_field_name( 'at_all_pricing_items' ).'['.$coder_repeater_depth.']['.'sub_title'.']'; $repeater_price_symbol_id = $this->get_field_id( 'at_all_pricing_items') .$coder_repeater_depth.'price_symbol'; $repeater_price_symbol_name = $this->get_field_name( 'at_all_pricing_items' ).'['.$coder_repeater_depth.']['.'price_symbol'.']'; $repeater_price_id = $this->get_field_id( 'at_all_pricing_items') .$coder_repeater_depth.'price'; $repeater_price_name = $this->get_field_name( 'at_all_pricing_items' ).'['.$coder_repeater_depth.']['.'price'.']'; $repeater_price_features_id = $this->get_field_id( 'at_all_pricing_items') .$coder_repeater_depth.'price_features'; $repeater_price__features_name = $this->get_field_name( 'at_all_pricing_items' ).'['.$coder_repeater_depth.']['.'price_features'.']'; $repeater_button_text_id = $this->get_field_id( 'at_all_pricing_items') .$coder_repeater_depth.'button_text'; $repeater_button_text_name = $this->get_field_name( 'at_all_pricing_items' ).'['.$coder_repeater_depth.']['.'button_text'.']'; $repeater_price_link_id = $this->get_field_id( 'at_all_pricing_items') .$coder_repeater_depth.'price_link'; $repeater_price_link_name = $this->get_field_name( 'at_all_pricing_items' ).'['.$coder_repeater_depth.']['.'price_link'.']'; ?> '; $add_field = esc_html__('Add Item', 'beauty-studio'); echo ''.$add_field.'
'; ?>

/>



0 ){ foreach ( $at_all_page_items as $boxes => $box ){ foreach ( $box as $key => $value ){ $at_all_page_items_data[$boxes][$key] = wp_kses_post( $value ); } } } } $instance[ 'at_all_pricing_items' ] = $at_all_page_items_data; $instance[ 'column_number' ] = absint( $new_instance['column_number'] ); $instance[ 'display_type' ] = esc_attr( $new_instance[ 'display_type' ] ); $instance[ 'view_all_option' ] = esc_attr( $new_instance[ 'view_all_option' ] ); $instance[ 'all_link_text' ] = sanitize_text_field( $new_instance[ 'all_link_text' ] ); $instance[ 'all_link_url' ] = esc_url_raw( $new_instance[ 'all_link_url' ] ); $instance[ 'enable_prev_next' ] = isset($new_instance['enable_prev_next'])? 1 : 0; $beauty_studio_widget_background_options = beauty_studio_background_options(); $instance[ 'background_options' ] = beauty_studio_sanitize_choice_options( $new_instance[ 'background_options' ], $beauty_studio_widget_background_options, 'default' ); return $instance; } /** * Function to Creating widget front-end. This is where the action happens * * @access public * @since 1.0 * * @param array $args widget setting * @param array $instance saved values * * @return void * */ public function widget( $args, $instance ) { $instance = wp_parse_args( (array) $instance, $this->defaults ); /*default values*/ $unique_id = ! empty( $instance['unique_id'] ) ? esc_attr( $instance['unique_id'] ) : esc_attr( $this->id ); $title = !empty( $instance['title'] ) ? esc_attr( $instance['title'] ) : ''; $title = apply_filters( 'widget_title', $title, $instance, $this->id_base ); $sub_title = apply_filters( 'widget_text', !empty( $instance['sub_title'] ) ? $instance['sub_title'] : '' , $instance ); $at_all_page_items = $instance['at_all_pricing_items']; $column_number = absint( $instance['column_number'] ); $display_type = esc_attr( $instance[ 'display_type' ] ); $view_all_option = esc_attr( $instance[ 'view_all_option' ] ); $all_link_text = esc_html( $instance[ 'all_link_text' ] ); $all_link_url = esc_url( $instance[ 'all_link_url' ] ); $enable_prev_next = esc_attr( $instance['enable_prev_next'] ); $background_options = esc_attr( $instance['background_options'] ); $bg_gray_class = $background_options == 'gray'?'at-gray-bg':''; $div_attr = 'class="row featured-entries-col featured-entries-logo '.$display_type.'"'; if( 'carousel' == $display_type ){ $div_attr = 'class="row featured-entries-col featured-entries-logo acme-slick-carausel" data-column="'.absint( $column_number ).'"'; } echo $args['before_widget']; $animation = "init-animate zoomIn"; ?>
"; if ( ! empty( $title ) ) { echo $args['before_title'] . esc_html( $title ) . $args['after_title']; } if( !empty( $sub_title ) ) { ?>

"; } if( 1 == $enable_prev_next && 'carousel' == $display_type ) { echo ""; echo ''; echo "";/*.at-action-wrapper*/ } ?>
> 0 ){ $beauty_studio_featured_index = 1; foreach ( $at_all_page_items as $price_detail ){ $price_img = $price_detail['price_img']; $title = $price_detail['title']; $sub_title = $price_detail['sub_title']; $price_symbol = $price_detail['price_symbol']; $price = $price_detail['price']; $price_features = $price_detail['price_features']; $button_text = $price_detail['button_text']; $price_link = $price_detail['price_link']; $beauty_studio_list_classes = 'single-list '; if( 'carousel' != $display_type ){ if( 1 != $beauty_studio_featured_index && $beauty_studio_featured_index % $column_number == 1 ){ echo "
"; } if ( 1 == $column_number ) { $beauty_studio_list_classes .= "col-sm-12"; } elseif ( 2 == $column_number ) { $beauty_studio_list_classes .= "col-sm-6"; } elseif ( 3 == $column_number ) { $beauty_studio_list_classes .= "col-sm-4 col-md-4"; } else { $beauty_studio_list_classes .= "col-sm-3 col-md-3"; } } if( empty( $price_img ) ){ $beauty_studio_list_classes .= " at-price-no-img"; } ?>
".esc_html( $title ).""; } ?>

".esc_html( $sub_title ).""; } if( !empty( $price_symbol )){ echo "".esc_html( $price_symbol ).""; } if( !empty( $price )){ echo esc_html( $price ); } ?>

'; } ?>