get_gallery_image_ids()[0] ) ? wc_get_product()->get_gallery_image_ids()[0] : null ); if ( $image_id ) { echo wp_get_attachment_image( $image_id, 'woocommerce_thumbnail', '', [ 'class' => 'amela-product-image-back', ] ); } } } if ( class_exists( 'YITH_WCQV' ) ) { /** * Remove Quickview button */ function amela_remove_quickview() { remove_action( 'woocommerce_after_shop_loop_item', 'yith_add_quick_view_button', 9999 ); } add_action( 'yith_wcqv_init', 'amela_remove_quickview' ); } if ( defined( 'YITH_WCWL' ) && !function_exists( 'amela_wishlist_count' ) ) { /** * Wislist count */ function amela_wishlist_count() { ob_start(); ?> yith_wcwl_count_all_products(), ) ); } add_action( 'wp_ajax_yith_wcwl_update_wishlist_count', 'amela_wishlist_ajax_update_count' ); add_action( 'wp_ajax_nopriv_yith_wcwl_update_wishlist_count', 'amela_wishlist_ajax_update_count' ); } if ( !function_exists( 'amela_woo_cart_icon' ) ) { /** * WooCommerce cart icon */ function amela_woo_cart_icon( $minicart_show = false ) { static $called = false; if ( !amela_is_woocommerce_activated() || is_null( WC()->cart ) ) { return; } $count = WC()->cart->get_cart_contents_count(); $classes = ['amela-menu-cart__url']; if ( $minicart_show ) { $classes[] = 'amela-offcanvas-js-trigger'; } ?>
cart ) ) { return; } $count = WC()->cart->get_cart_contents_count(); // count if ( 0 === $count ) { $fragments['.amela-menu-cart__count'] = '' . esc_html( $count ) . ''; } else { $fragments['.amela-menu-cart__count'] = '' . esc_html( $count ) . ''; } // mini-cart ob_start(); echo '
'; if ( 0 === $count ) { echo '
'; echo ''; } woocommerce_mini_cart(); if ( 0 === $count ) { echo '
'; } echo '
'; $fragments['.amela-offcanvas__mini-cart'] = ob_get_clean(); return $fragments; } } if ( !function_exists( 'amela_shop_before_content' ) ) { /** * Archives layout before */ function amela_shop_before_content() { ?>
'; } } if ( !function_exists( 'amela_product_add_to_wishlist' ) ) { /** * Product add to wishlisht */ function amela_product_add_to_wishlist() { if ( class_exists( 'YITH_WCWL' ) ) { echo do_shortcode( '[yith_wcwl_add_to_wishlist icon="fa-heart-o"]' ); } } } if ( !function_exists( 'amela_product_add_to_cart' ) ) { /** * Product add to cart */ function amela_product_add_to_cart() { echo '
'; echo '' . esc_html__( 'Add to cart', 'amela' ) . ''; echo woocommerce_template_loop_add_to_cart(); echo '
'; } } if ( !function_exists( 'amela_product_action_icons_close' ) ) { /** * Product action icons close */ function amela_product_action_icons_close() { echo '
'; } } if ( !function_exists( 'amela_product_quickview' ) ) { /** * Product quickview */ function amela_product_quickview() { if ( class_exists( 'YITH_WCQV' ) ) { echo '
'; echo '
'; echo do_shortcode( '[yith_quick_view]' ); echo '
'; echo '
'; } } } if ( !function_exists( 'amela_product_after_add_to_cart' ) ) { /** * Product after add to cart */ function amela_product_after_add_to_cart() { ?>
'; woocommerce_template_loop_product_link_open(); echo get_the_title(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped woocommerce_template_loop_product_link_close(); echo ''; } } if ( !function_exists( 'amela_after_product_price' ) ) { /** * Product after price */ function amela_after_product_price() { echo '
'; } } if ( !function_exists( 'amela_product_share' ) ) { /** * Product share */ function amela_product_share() { if ( !get_theme_mod( 'amela_settings_product_share_buttons_show', true ) ) { return; } if ( function_exists( 'amela_social_sharing_buttons' ) ) { ?>
' . esc_html__( 'Share', 'amela' ) . ''; echo amela_social_sharing_buttons( 'socials--no-base', 'product' ); ?>
%s ', esc_url( $product->add_to_cart_url() ), esc_attr( ( isset( $args['quantity'] ) ? $args['quantity'] : 1 ) ), esc_attr( ( isset( $args['class'] ) ? $args['class'] : '' ) ), ( isset( $args['attributes'] ) ? wc_implode_html_attributes( $args['attributes'] ) : '' ), esc_html( $product->add_to_cart_text() ) ); } } add_filter( 'woocommerce_loop_add_to_cart_link', 'amela_loop_add_to_cart_link', 10, 3 ); if ( !function_exists( 'amela_shop_page_title' ) ) { /** * Shop page title */ function amela_shop_page_title() { if ( is_woocommerce() && !is_product() ) { get_template_part( 'template-parts/page-title/page-title-shop' ); } } } if ( !function_exists( 'amela_shop_get_sidebar' ) ) { /** * Display shop sidebar * * @uses amela_sidebar() * @since 1.0.0 */ function amela_shop_get_sidebar() { if ( is_active_sidebar( 'amela-shop-sidebar' ) ) { amela_sidebar( 'amela-shop-sidebar' ); } } } if ( !function_exists( 'amela_shop_breadcrumbs' ) ) { /** * WooCommerce breadcrumbs */ function amela_shop_breadcrumbs() { if ( !get_theme_mod( 'amela_settings_shop_breadcrumbs_show', true ) ) { return; } woocommerce_breadcrumb(); } } if ( !function_exists( 'amela_shop_breadcrumb_delimiter' ) ) { /** * Change the breadcrumb separator */ function amela_shop_breadcrumb_delimiter( $defaults ) { $defaults['delimiter'] = ''; return $defaults; } } if ( !function_exists( 'amela_shop_tag_cloud_widget' ) ) { /** * Tag cloud font size */ function amela_shop_tag_cloud_widget( $args ) { $args = array( 'smallest' => 10, 'largest' => 10, 'taxonomy' => 'product_tag', ); return $args; } } if ( !function_exists( 'amela_quantity_plus_sign' ) ) { /** * Quantity plus */ function amela_quantity_plus_sign() { echo ''; } } if ( !function_exists( 'amela_quantity_minus_sign' ) ) { /** * Quantity minus */ function amela_quantity_minus_sign() { echo ''; } } if ( !function_exists( 'amela_woocommerce_before_customer_login_form' ) ) { /** * My account before login form */ function amela_woocommerce_before_customer_login_form() { echo '
'; } } if ( !function_exists( 'amela_woocommerce_after_customer_login_form' ) ) { /** * My account after login form */ function amela_woocommerce_after_customer_login_form() { echo '
'; } }