1,
'class' => implode( ' ', array_filter( array(
'button',
'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' : '',
) ) ),
);
$args = apply_filters( 'woocommerce_loop_add_to_cart_args', wp_parse_args( $args, $defaults ), $product );
wc_get_template( 'loop/add-to-cart.php', $args );
}
}
/**
* Remove title on shop main
*
* @return bool
*/
function bestblog_woocommerce_hide_page_title()
{
return false;
}
add_filter('woocommerce_breadcrumb_defaults', 'bestblog_woocommerce_breadcrumbs');
function bestblog_woocommerce_breadcrumbs()
{
return array(
'delimiter' => ' ',
'wrap_before' => '
',
'before' => '',
'after' => '',
'home' => _x('Home', 'breadcrumb', 'best-blog'),
);
}
if (! function_exists('bestblog_before_content')) {
/**
* Before Content
* Wraps all WooCommerce content in wrappers which match the theme markup
*
* @since 1.0.0
* @return void
*/
function bestblog_before_content()
{?>
";
}
}
if (is_active_sidebar('woocommerce-sidebar-bestblog')) {
if (! function_exists('bestblog_loop_columns')) {
/**
* Default loop columns on product archives
*
* @return integer products per row
* @since 1.0.0
*/
function bestblog_loop_columns()
{
return apply_filters('bestblog_loop_columns', 3); // 3 products per row
}
}
}
/**
* Change the layout before each single product listing
*/
function bestblog_woocommerce_before_shop_loop_item() {
echo '
';
}
/**
* Change the layout after each single product listing
*/
function bestblog_woocommerce_after_shop_loop_item() {
echo '
';
}
/**
* Change the layout of the thumbnail on single product listing
*/
function bestblog_woocommerce_template_loop_product_thumbnail() {
$thumbnail = get_the_post_thumbnail( null, 'bestblog-shop' );
if ( empty( $thumbnail ) && function_exists( 'wc_placeholder_img' ) ) {
$thumbnail = wc_placeholder_img();
}
if ( ! empty( $thumbnail ) ) {
?>
post_excerpt ) : ?>
post_excerpt ) ); ?>