cart->cart_contents_count); ?>
cart->cart_contents_count); ob_start(); ?> %s', esc_url( $product->add_to_cart_url() ), esc_attr( $product->get_id() ), esc_attr( $product->get_sku() ), esc_attr( isset( $quantity ) ? $quantity : 1 ), $product->is_purchasable() && $product->is_in_stock() ? 'add_to_cart_button' : '',$product->supports( 'ajax_add_to_cart' ) ? 'ajax_add_to_cart' : '', esc_html( $product->add_to_cart_text() ) ),$product ); return $cart_url; } /**********************************/ //Shop Product Markup /**********************************/ if ( ! function_exists( 'almaira_shop_product_meta_start' ) ){ /** * Thumbnail wrap start. */ function almaira_shop_product_meta_start(){ echo '
'; } } if ( ! function_exists( 'almaira_shop_product_meta_end' ) ){ /** * Thumbnail wrap start. */ function almaira_shop_product_meta_end(){ echo '
'; } } /**********************************/ //Shop Product Image Markup /**********************************/ if ( ! function_exists( 'almaira_shop_product_image_start' ) ){ /** * Thumbnail wrap start. */ function almaira_shop_product_image_start(){ echo '
'; } } if ( ! function_exists( 'almaira_shop_product_image_end' ) ){ /** * Thumbnail wrap start. */ function almaira_shop_product_image_end(){ echo '
'; } } if ( ! function_exists( 'almaira_shop_product_content_start' ) ){ /** * Thumbnail wrap start. */ function almaira_shop_product_content_start(){ echo '
'; } } if ( ! function_exists( 'almaira_shop_product_content_end' ) ){ /** * Thumbnail wrap start. */ function almaira_shop_product_content_end(){ echo '
'; } } /** * Shop customization. * * @return void */ add_action( 'woocommerce_before_shop_loop_item', 'almaira_shop_product_meta_start', 10); add_action( 'woocommerce_after_shop_loop_item', 'almaira_shop_product_meta_end', 12 ); add_action( 'woocommerce_before_shop_loop_item_title', 'almaira_shop_product_content_start',20); add_action( 'woocommerce_after_shop_loop_item_title', 'almaira_shop_product_content_end', 20 ); /****************/ // add to compare /****************/ function almaira_shop_add_to_compare_fltr($pid=''){ if( is_plugin_active('yith-woocommerce-compare/init.php') ){ return '
'; } } /********************************************** //product section function End **********************************************/ add_action( 'woocommerce_before_shop_loop_item_title', 'almaira_shop_product_image_start', 0); add_action( 'woocommerce_before_shop_loop_item_title', 'almaira_shop_product_image_end',10 ); add_action( 'woocommerce_after_single_product_summary', 'woocommerce_show_product_sale_flash',1); /**********************/ /** wishlist **/ /**********************/ function almaira_shop_whish_list(){ if( shortcode_exists( 'yith_wcwl_add_to_wishlist' ) ){ return do_shortcode('[yith_wcwl_add_to_wishlist icon="fa fa-heart" browse_wishlist_text=""]' ); } } function almaira_shop_whishlist_url(){ $wishlist_page_id = get_option( 'yith_wcwl_wishlist_page_id' ); $wishlist_permalink = get_the_permalink( $wishlist_page_id ); return $wishlist_permalink ; } // shop almaira /** My Account Menu **/ function almaira_shop_account(){ if ( is_user_logged_in() ) { $return = ''; } else { $return = ''; } echo $return; } // Plus Minus Quantity Buttons @ WooCommerce Single Product Page add_action( 'woocommerce_before_add_to_cart_quantity', 'almaira_display_quantity_minus',10,2 ); function almaira_display_quantity_minus(){ echo '
'; } add_action( 'woocommerce_after_add_to_cart_quantity', 'almaira_display_quantity_plus',10,2 ); function almaira_display_quantity_plus(){ echo '
'; } //Woocommerce: How to remove page-title at the home/shop page but not category pages add_filter( 'woocommerce_show_page_title', 'not_a_shop_page' ); function not_a_shop_page() { return boolval(!is_shop()); }