';
echo '
';
echo '
'.esc_html( woocommerce_page_title( false ) ).'
';
woocommerce_breadcrumb();
echo '';
}
add_action( 'woocommerce_before_shop_loop', 'fasto_before_shop_loop', 1,1 );
}
/*
=================================================================================================================
fasto_shop_sale_text() - Sale text
=================================================================================================================
*/
function fasto_shop_sale_text( $text, $post, $_product ){
return '
'.esc_attr__('Sale','fasto').'
';
}
add_filter('woocommerce_sale_flash', 'fasto_shop_sale_text', 10, 3);
/*
=================================================================================================================
fasto_shop_comment_args() - Review form
=================================================================================================================
*/
function fasto_shop_comment_args( $comment_form ){
$commenter = wp_get_current_commenter();
$name_email_required = (bool) get_option( 'require_name_email', 1 );
$required = $name_email_required ? ' required' : '';
$comment_form['comment_notes_before'] = '';
$comment_form['title_reply_before'] = '';
$comment_form['fields']['author'] = '
';
$comment_form['fields']['cookies'] = '';
if ( wc_review_ratings_enabled() ) {
$comment_form['comment_field'] = '';
}
$comment_form['comment_field'] .= '';
return $comment_form;
}
add_filter('woocommerce_product_review_comment_form_args','fasto_shop_comment_args');
/*
=================================================================================================================
fasto_loop_columns() - Change number or products per row
=================================================================================================================
*/
add_filter('loop_shop_columns', 'fasto_loop_columns', 999);
function fasto_loop_columns() {
if ( get_theme_mod('shop-layout') == 'grid-4' ){
return 4;
}
elseif ( get_theme_mod('shop-layout') == 'grid-3' ){
return 3;
}
elseif ( get_theme_mod('shop-layout') == 'grid-2-sidebar' ){
return 2;
}
elseif ( get_theme_mod('shop-layout') == 'grid-3-sidebar' ){
return 3;
}
}
/*
=================================================================================================================
fasto_append_cart_icon() - Append cart item (and cart count) to end of main menu.
=================================================================================================================
*/
add_filter( 'wp_nav_menu_items', 'fasto_append_cart_icon', 10, 2 );
function fasto_append_cart_icon( $items, $args ) {
$cart_item_count = WC()->cart->get_cart_contents_count();
$cart_count_span = '';
if ( $cart_item_count ) {
$cart_count_span = '
'.$cart_item_count.'';
}
$cart_link = ''; # fasto_brands_svg() - safely escaped in functions/theme.php
// Add the cart link to the end of the menu.
$items = $items . $cart_link;
return $items;
}
/*
=================================================================================================================
fasto_loop_shop_per_page() - Change number of products that are displayed per page (shop page)
=================================================================================================================
*/
add_filter( 'loop_shop_per_page', 'fasto_loop_shop_per_page', 20 );
function fasto_loop_shop_per_page( $cols ) {
$cols = !empty ( get_theme_mod( 'shop-per-page' ) ) ? get_theme_mod( 'shop-per-page' ) : 3;
return $cols;
}