'_stock_status', 'value' => 'instock', 'compare' => '=', ] ]; } $this->_query = $query_args; return wc_get_products($query_args); } // Render functions function get_product_image(object $product) { if ($this->get_settings_for_display('image') !== 'yes') { return; } // Get product image ID $pic_id = $product->get_image_id(); if (!$pic_id) { return; } // Get image size $size = $this->get_settings_for_display('image_size_select') ?? 'uicore-medium'; ?> get_settings_for_display('masonry') === 'ui-e-maso') { ?> get_product_secondary_image( $product ); $classes = $sec_img ? 'ui-e-post-img ui-e-hover-hide' : 'ui-e-post-img'; // Print secondary image markup if exists echo $sec_img ? wp_kses_post($sec_img) : ''; // Print main product image echo wp_get_attachment_image($pic_id, $size, false, ['class' => $classes]); ?> get_product_secondary_image( $product, $size, true ); echo $sec_img ? wp_kses_post($sec_img) : ''; ?>
get_settings_for_display('anim_image') ) { return false; } // Get product gallery image IDs $gallery_image_ids = $product->get_gallery_image_ids(); // Check if there is at least one gallery image if (empty($gallery_image_ids)) { return false; } // Get the first image from the gallery $secondary_image_id = $gallery_image_ids[0]; $secondary_image_url = wp_get_attachment_image_url($secondary_image_id, $size); // Output secondary image as or background
if ($bg_output) { return sprintf( '
', esc_url($secondary_image_url) ); } else { return wp_get_attachment_image($secondary_image_id, $size, false, [ 'class' => 'ui-e-post-img ui-e-post-img-secondary' ]); } } function get_product_title($product) { if ($this->get_settings_for_display('title') !== 'yes') { return; } ?>

get_name()); ?>

get_settings_for_display(); $excerpt_length = $settings['excerpt_trim']; // Classnames but checking if we the widget is APG (legacy version) $item_classes = $legacy ? ['ui-e-post-item', 'ui-e-item'] : ['ui-e-item'] ; // Single item lower wrap class receptor $hover_item_class = $legacy ? 'anim_item' : 'item_hover_animation'; // item hover animation class // If widget is not carousel type, we set animations classes directly on item selector if(!$carousel) { $item_classes[] = 'ui-e-animations-wrp'; $item_classes[] = $settings['animate_items'] === 'ui-e-grid-animate' ? 'elementor-invisible' : ''; $item_classes[] = $settings[$hover_item_class] !== '' ? $settings[$hover_item_class] : ''; } else { // Get entrance and item hover animation classes $entrance = (isset($settings['animate_items']) && $settings['animate_items'] == 'ui-e-grid-animate') ? 'elementor-invisible' : ''; $hover = isset($settings[$hover_item_class]) ? $settings[$hover_item_class] : ''; //$settings[$hover_item_class] : null; $animations = sprintf('%s %s', $entrance, $hover); // Check if entrance or hover animation are set $has_animation = !empty($entrance) || !empty($hover) // Prints extra wrappers required by the carousel script ?>
>
get_product_image($product); ?> get_post_meta('top'); ?> TRAIT_get_button(true); } ?>
get_post_meta('before_title'); ?> get_settings_for_display('title') === 'yes') $this->get_product_title($product); ?> get_post_meta('after_title'); ?> get_settings_for_display('excerpt')) echo wp_kses_post('
' . wp_trim_words(get_the_excerpt(), $excerpt_length) . '
'); ?> get_post_meta('bottom'); // button ?> =') && $this->get_settings_for_display('show_swatches') === 'yes' ){ // ajax requests works under minimal conditions, wich means Swatches class is not present if ( $is_ajax ) { require_once UICORE_INCLUDES . '/woocommerce/components/class-swatches.php'; } \UiCore\WooCommerce\Swatches::print_swatches($product); // from Uicore Framework } if ( $this->get_settings_for_display('show_button') === 'yes' ) { // Add match height spacing element if carousel. May look intrusive, but is the simplest method compared // to absolute positioning or catching last content element to apply margin. if($carousel && $settings['match_height'] === 'yes'){ ?> TRAIT_get_button(true); } } ?>