get_post_thumbnail_id(), ]; $settings['eael_image_size_customize_size'] = $settings['eael_product_grid_image_size_size']; $thumbnail_html = Group_Control_Image_Size::get_attachment_image_html( $settings,'eael_image_size_customize' ); } $title_tag = isset( $settings['eael_product_grid_title_html_tag'] ) ? Helper::eael_validate_html_tag($settings['eael_product_grid_title_html_tag']) : 'h2'; $should_print_compare_btn = isset( $settings['show_compare'] ) && 'yes' === $settings['show_compare']; if ( function_exists( 'YITH_WCWL' ) ) { $should_print_wishlist_btn = isset( $settings['eael_product_grid_wishlist'] ) && 'yes' === $settings['eael_product_grid_wishlist']; } // Improvement $grid_style_preset = isset($settings['eael_product_grid_style_preset']) ? $settings['eael_product_grid_style_preset'] : ''; $list_style_preset = isset($settings['eael_product_list_style_preset']) ? $settings['eael_product_list_style_preset'] : ''; $sale_badge_align = isset( $settings['eael_product_sale_badge_alignment'] ) ? esc_attr( $settings['eael_product_sale_badge_alignment'] ) : ''; $sale_badge_preset = isset( $settings['eael_product_sale_badge_preset'] ) ? esc_attr( $settings['eael_product_sale_badge_preset'] ) : ''; // should print vars $should_print_rating = isset( $settings['eael_product_grid_rating'] ) && 'yes' === $settings['eael_product_grid_rating']; $should_print_quick_view = isset( $settings['eael_product_grid_quick_view'] ) && 'yes' === $settings['eael_product_grid_quick_view']; $should_print_image_clickable = isset( $settings['eael_product_grid_image_clickable'] ) && 'yes' === $settings['eael_product_grid_image_clickable']; $should_print_price = isset( $settings['eael_product_grid_price'] ) && 'yes' === $settings['eael_product_grid_price']; $should_print_excerpt = isset( $settings['eael_product_grid_excerpt'] ) && ('yes' === $settings['eael_product_grid_excerpt'] && has_excerpt()); $widget_id = isset($settings['eael_widget_id']) ? $settings['eael_widget_id'] : null; $sale_badge_text = !empty($settings['eael_product_sale_text']) ? $settings['eael_product_sale_text'] : __( 'Sale!', 'essential-addons-for-elementor-lite' ); $stock_out_badge_text = !empty($settings['eael_product_stockout_text']) ?$settings['eael_product_stockout_text'] : __( 'Stock
Out', 'essential-addons-for-elementor-lite' ); $is_show_badge = $settings['eael_show_product_sale_badge']; $quick_view_setting = [ 'widget_id' => $widget_id, 'product_id' => $product->get_id(), 'page_id' => $settings['eael_page_id'], ]; $product_wrapper_classes = implode( " ", apply_filters( 'eael_product_wrapper_class', [], $product->get_id(), 'eicon-woocommerce' ) ); if ( $grid_style_preset == 'eael-product-simple' || $grid_style_preset == 'eael-product-reveal' ) { ?>
  • get_permalink() . '" class="woocommerce-LoopProduct-link woocommerce-loop-product__link">'; } echo wp_kses_post( $product->get_image( $settings['eael_product_grid_image_size_size'], [ 'loading' => 'eager', 'class'=> 'attachment-woocommerce_thumbnail size-woocommerce_thumbnail wvs-archive-product-image' ] ) ); if ( $should_print_image_clickable ) { echo ''; } // printf('<%1$s class="woocommerce-loop-product__title">%2$s', $title_tag, $product->get_title(), $product->get_permalink()); echo ''; if ( $should_print_rating ) { echo wp_kses_post( wc_get_rating_html( $product->get_average_rating(), $product->get_rating_count() ) ); } if ( $is_show_badge ){ if ( ! $product->is_in_stock() ) { printf( '%s', $stock_out_badge_text ); } elseif ( $product->is_on_sale() ) { printf( '%s', $sale_badge_text ); } } if ( $should_print_price ) { echo '
    '.$product->get_price_html().'
    '; } ?> get_id() ); } ?> '; echo do_shortcode('[yith_wcwl_add_to_wishlist]'); echo '
    '; } if ( $settings['eael_wc_loop_hooks'] === 'yes' ) { do_action( 'woocommerce_after_shop_loop_item' ); } do_action( 'eael_woocommerce_after_shop_loop_item' ); ?>
  • >
    get_permalink() . '" class="woocommerce-LoopProduct-link woocommerce-loop-product__link">'; } echo $product->get_image( $settings['eael_product_grid_image_size_size'], [ 'loading' => 'eager' ] ); if ( $should_print_image_clickable ) { echo ''; } ?>
    get_id(), 'icon' ); } ?> '; echo do_shortcode('[yith_wcwl_add_to_wishlist]'); echo '
    '; } ?>
    %2$s', $title_tag, $product->get_title(), $product->get_permalink()); echo '
    '; printf('<%1$s class="woocommerce-loop-product__title">%2$s', $title_tag, Helper::eael_wp_kses( $product->get_title() )); echo '
    '; if ( $should_print_rating ) { echo wc_get_rating_html( $product->get_average_rating(), $product->get_rating_count() ); } if ( $is_show_badge ) { if ( ! $product->is_in_stock() ) { printf( '%s', $stock_out_badge_text ); } elseif ( $product->is_on_sale() ) { printf( '%s', $sale_badge_text ); } } if ( $should_print_price ) { echo '
    '.$product->get_price_html().'
    '; } if ( $settings['eael_wc_loop_hooks'] === 'yes' ) { do_action( 'woocommerce_after_shop_loop_item' ); } do_action( 'eael_woocommerce_after_shop_loop_item' ); ?>
  • get_id() ) || $product->is_visible() ) { ?>
  • >
    is_in_stock() ? '' . $stock_out_badge_text . '' : ( $product->is_on_sale() ? '' . $sale_badge_text . '' : '' ) ); } if( $should_print_image_clickable ) { echo ''; } echo wp_kses_post( $product->get_image( $settings['eael_product_grid_image_size_size'], [ 'loading' => 'eager' ] ) ); if( $should_print_image_clickable ) { echo ''; } ?>
    • '; Product_Grid::print_compare_button( $product->get_id(), 'icon' ); echo ''; } ?> '; echo do_shortcode('[yith_wcwl_add_to_wishlist]'); echo ''; } ?>
    • get_permalink() . '">'; ?>
    • '; Product_Grid::print_compare_button( $product->get_id(), 'icon' ); echo ''; } ?> '; echo do_shortcode('[yith_wcwl_add_to_wishlist]'); echo ''; } ?>
    • get_permalink () . '">'; ?>
    • '; Product_Grid::print_compare_button( $product->get_id(), 'icon' ); echo ''; } ?> '; echo do_shortcode('[yith_wcwl_add_to_wishlist]'); echo ''; } ?>
    • get_permalink() . '">'; ?>
    '.$product->get_price_html().'
    '; } if ($should_print_rating) { echo wc_get_rating_html ($product->get_average_rating(), $product->get_rating_count()); } ?>
    get_permalink() ) . '" class="woocommerce-LoopProduct-link woocommerce-loop-product__link">'; printf('<%1$s>%2$s', $title_tag, Helper::eael_wp_kses( $product->get_title() )); echo ''; ?> %2$s', $title_tag, $product->get_title(), $product->get_permalink()); ?>
    '.$product->get_price_html().'
    '; }?>
  • get_id() ) || $product->is_visible() ) { ?>
  • >
    get_permalink() . '" class="woocommerce-LoopProduct-link woocommerce-loop-product__link">'; } if ( $is_show_badge ) { echo( ! $product->is_in_stock() ? '' . $stock_out_badge_text . '' : ( $product->is_on_sale() ? '' . $sale_badge_text . '' : '' ) ); } echo $product->get_image($settings['eael_product_grid_image_size_size'], ['loading' => 'eager']); if( $should_print_image_clickable ) { echo ''; } ?>
    • '; Product_Grid::print_compare_button( $product->get_id(), 'icon' ); echo ''; } ?> '; echo do_shortcode('[yith_wcwl_add_to_wishlist]'); echo ''; } ?>
    '.$product->get_price_html().'
    '; } ?>
    get_permalink() ) . '" class="woocommerce-LoopProduct-link woocommerce-loop-product__link">'; printf('<%1$s>%2$s', $title_tag, Helper::eael_wp_kses( $product->get_title() )); echo ''; ?>
  • get_id() ) || $product->is_visible() ) { ?>
  • ">
    get_permalink() . '" class="woocommerce-LoopProduct-link woocommerce-loop-product__link">'; } if ( $is_show_badge ) { echo( ! $product->is_in_stock() ? '' . $stock_out_badge_text . '' : ( $product->is_on_sale() ? '' . $sale_badge_text . '' : '' ) ); } echo wp_kses_post( $product->get_image( $settings['eael_product_grid_image_size_size'], [ 'loading' => 'eager' ] ) ); if( $should_print_image_clickable ) { echo ''; } ?>
    '; if ( $should_print_excerpt ) { echo '
    '; echo '

    ' . wp_trim_words(strip_shortcodes(get_the_excerpt()), $settings['eael_product_grid_excerpt_length'], $settings['eael_product_grid_excerpt_expanison_indicator']) . '

    '; echo '
    '; } if ( $should_print_price ) { echo '
    '.$product->get_price_html().'
    '; } if ($should_print_rating) { echo wc_get_rating_html ($product->get_average_rating(), $product->get_rating_count()); } } elseif ($list_style_preset == 'eael-product-list-preset-3') { echo '
    '; if ($should_print_price) { echo '
    '.$product->get_price_html().'
    '; } if ($should_print_rating) { echo wc_get_rating_html ($product->get_average_rating(), $product->get_rating_count()); } echo '
    '; if ( $should_print_excerpt ) { echo '
    '; echo '

    ' . wp_trim_words(strip_shortcodes(get_the_excerpt() ? get_the_excerpt() : get_the_content()), $settings['eael_product_grid_excerpt_length'], $settings['eael_product_grid_excerpt_expanison_indicator']) . '

    '; echo '
    '; } echo '
    '; } elseif ($list_style_preset == 'eael-product-list-preset-4') { if ($should_print_rating) { echo wc_get_rating_html ($product->get_average_rating(), $product->get_rating_count()); } echo ''; if ( $should_print_excerpt ) { echo '
    '; echo '

    ' . wp_trim_words(strip_shortcodes(get_the_excerpt() ? get_the_excerpt() : get_the_content()), $settings['eael_product_grid_excerpt_length'], $settings['eael_product_grid_excerpt_expanison_indicator']) . '

    '; echo '
    '; } if ( $should_print_price ) { echo '
    '.$product->get_price_html().'
    '; } } else { echo ''; if ( $should_print_price ) { echo '
    '.$product->get_price_html().'
    '; } if ($should_print_rating) { echo wc_get_rating_html ($product->get_average_rating(), $product->get_rating_count()); } if ( $should_print_excerpt ) { echo '
    '; echo '

    ' . wp_trim_words(strip_shortcodes(get_the_excerpt() ? get_the_excerpt() : get_the_content()), $settings['eael_product_grid_excerpt_length'], $settings['eael_product_grid_excerpt_expanison_indicator']) . '

    '; echo '
    '; }; } ?>
  • is_in_stock() ) { remove_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_show_product_loop_sale_flash', 10 ); echo ''.__('Stock ', 'essential-addons-for-elementor-lite'). '
    ' . __('Out', 'essential-addons-for-elementor-lite').'
    '; } },9); if ( $should_print_compare_btn ) { add_action( 'woocommerce_after_shop_loop_item', [ '\Essential_Addons_Elementor\Elements\Product_Grid', 'print_compare_button', ] ); } $thumb_size = isset($settings['eael_product_grid_image_size_size']) ? $settings['eael_product_grid_image_size_size'] : ''; global $eael_thumb_default; add_filter( 'single_product_archive_thumbnail_size', function($size)use($thumb_size){ global $eael_thumb_default; $eael_thumb_default = $size; return $thumb_size != '' ? $thumb_size : $size ; }); wc_get_template_part( 'content', 'product' ); add_filter( 'single_product_archive_thumbnail_size', function($size){ global $eael_thumb_default; return !empty($eael_thumb_default) ? $eael_thumb_default : $size; }); if ( $should_print_compare_btn ) { remove_action( 'woocommerce_after_shop_loop_item', [ '\Essential_Addons_Elementor\Elements\Product_Grid', 'print_compare_button', ] ); } }