';
}
remove_action('woocommerce_before_shop_loop_item','woocommerce_template_loop_product_link_open',10);
add_action('woocommerce_before_shop_loop_item','bcshop_woocommerce_template_loop_product_link_open',40);
}
if ( ! function_exists( 'bcshop_woocommerce_template_loop_product_link_close' ) ) {
/**
* Insert the opening anchor tag for products in the loop.
*/
function bcshop_woocommerce_template_loop_product_link_close() {
echo '
';
}
remove_action('woocommerce_after_shop_loop_item','woocommerce_template_loop_product_link_close',10);
add_action('woocommerce_after_shop_loop_item','bcshop_woocommerce_template_loop_product_link_close',10);
}
if ( ! function_exists( 'bcshop_thumbnail_template_loop_add_to_cart' ) ) {
/**
* Get the add to cart template for the loop.
*
* @param array $args Arguments.
*/
function bcshop_thumbnail_template_loop_add_to_cart( $args = array() ) {
global $product;
if ( $product ) {
$defaults = array(
'quantity' => 1,
'class' => implode( ' ', array_filter( array(
'',
'product_type_' . $product->get_type(),
$product->is_purchasable() && $product->is_in_stock() ? 'add_to_cart_button' : '',
$product->supports( 'ajax_add_to_cart' ) ? 'ajax_add_to_cart' : '',
) ) ),
'attributes' => array(
'data-product_id' => $product->get_id(),
'data-product_sku' => $product->get_sku(),
'aria-label' => $product->add_to_cart_description(),
'rel' => 'nofollow',
),
);
$args = apply_filters( 'bcshop_loop_add_to_cart_args', wp_parse_args( $args, $defaults ), $product );
wc_get_template( 'loop/add-to-cart-thumbnail.php', $args );
}
}
}
if ( ! function_exists( 'bcshop_woocommerce_template_loop_product_thumbnail' ) ) {
//remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 );
add_action( 'bcshop_loop_add_to_cart', 'bcshop_thumbnail_template_loop_add_to_cart', 10 );
/**
* Get the product thumbnail for the loop.
*/
function bcshop_woocommerce_template_loop_product_thumbnail() {
global $product;
$attachment_ids = $product->get_gallery_image_ids();
$link = apply_filters( 'woocommerce_loop_product_link', get_the_permalink(), $product );
echo '
';
}
remove_action( 'woocommerce_before_shop_loop_item_title','woocommerce_template_loop_product_thumbnail',10 );
add_action( 'woocommerce_before_shop_loop_item_title','bcshop_woocommerce_template_loop_product_thumbnail',10 );
}
if ( ! function_exists( 'bcshop_template_loop_product_title' ) ) {
/**
* Show the product title in the product loop. By default this is an H2.
*/
function bcshop_template_loop_product_title() {
echo '