This topic has 7 replies, 3 voices, and was last updated 5 years, 9 months ago ago by John Holden
How can I change the priority to show the brand above the product title?
Also I came across a bug where if you turn this option on, then try and turn it off, it doesn’t save the settings.
Hello,
1) By default, there are only these settings – http://prntscr.com/lteipi
To show the brand above the product title, you need to copy etheme_template_hooks
function (xstore/framework/woo.php) into functions.php of child theme and change 11 http://prntscr.com/lteoi3 to 4 http://prntscr.com/lteoqt
2) Which option do you mean?
Regards
Thank you Rose. I mean if you turn on show brands on product landing page, and then turn off show brands, it’s still showing brands and not unsetting off the page.
Hello,
Have you cleared cache?
Please provide a screenshot of the option and the result of disabling.
Regards
Thank you Rose. This was a great suggestion and it worked. I placed the following code into child theme functions.php file however it seems a bit heavy to include this considering I’m only changing 1 line. Is there anyway I can slim this down?
// **********************************************************************//
// ! Template hooks
// **********************************************************************//
add_action('wp', 'etheme_template_hooks', 60);
if(!function_exists('etheme_template_hooks')) {
function etheme_template_hooks() {
// add_action( 'woocommerce_before_shop_loop', 'woocommerce_pagination', 40 ); // add pagination above the products
remove_action( 'woocommerce_before_shop_loop', 'woocommerce_result_count', 20 );
remove_action( 'woocommerce_widget_shopping_cart_buttons', 'woocommerce_widget_shopping_cart_button_view_cart', 10 );
// ! Change single product main gallery image size
add_filter( 'woocommerce_gallery_image_size', function( $size ) {
return 'woocommerce_single';
} );
if ( ! class_exists( 'SB_WooCommerce_Infinite_Scroll' ) ) {
add_action( 'woocommerce_after_shop_loop', 'woocommerce_result_count', 5 );
}
remove_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_show_product_loop_sale_flash', 10 );
add_action('woocommerce_before_shop_loop_item','woocommerce_show_product_loop_sale_flash', 10);
remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20 );
remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_upsell_display', 15 );
remove_action( 'woocommerce_cart_collaterals', 'woocommerce_cross_sell_display' );
/* Remove link open and close on product content */
remove_action( 'woocommerce_before_shop_loop_item', 'woocommerce_template_loop_product_link_open', 10 );
remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_product_link_close', 5 );
// Change rating position on the single product page
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_rating', 10 );
add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_rating', 15 );
add_action('woocommerce_single_product_summary', 'etheme_product_share', 50);
if(etheme_get_option('tabs_location') == 'after_image' && etheme_get_option('tabs_type') != 'disable' && etheme_get_option('single_layout') != 'large') {
add_action( 'woocommerce_single_product_summary', 'woocommerce_output_product_data_tabs', 61 );
add_filter('et_option_tabs_type', function () { return "accordion"; });
if(etheme_get_option('reviews_position') == 'outside') {
add_action( 'woocommerce_single_product_summary', 'comments_template', 110 );
}
}
if( etheme_get_option('single_layout') == 'fixed' || etheme_get_custom_field('single_layout') == 'fixed' ) {
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_title', 5 );
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 10 );
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_rating', 15 );
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_excerpt', 20 );
} else if( etheme_get_option('single_layout') == 'center' || etheme_get_custom_field('single_layout') == 'center' ) {
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_excerpt', 20 );
} else if( etheme_get_option('single_layout') == 'wide' || etheme_get_custom_field('single_layout') == 'wide' || etheme_get_option('single_layout') == 'right' || etheme_get_custom_field('single_layout') == 'right' ) {
if(is_singular('product')) remove_action( 'woocommerce_before_main_content', 'woocommerce_breadcrumb', 20 );
remove_action( 'woocommerce_before_single_product', 'wc_print_notices', 10 );
add_action( 'woocommerce_single_product_summary', 'wc_print_notices', 1 );
add_action( 'woocommerce_single_product_summary', 'woocommerce_breadcrumb', 3 );
add_action( 'woocommerce_single_product_summary', 'etheme_size_guide', 21 );
} else if( etheme_get_option('single_layout') == 'booking' || etheme_get_custom_field('single_layout') == 'booking' ) {
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_title', 5 );
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_rating', 15 );
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_excerpt', 20 );
if(etheme_get_option('tabs_location') == 'after_image' && etheme_get_option('tabs_type') != 'disable') {
remove_action( 'woocommerce_single_product_summary', 'woocommerce_output_product_data_tabs', 61 );
}
//remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_meta', 40 );
//remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_sharing', 50 );
} else {
// Add product categories after title
add_action( 'woocommerce_single_product_summary', 'etheme_size_guide', 21 );
}
if ( etheme_get_custom_field('sale_counter') == 'single' || etheme_get_custom_field('sale_counter') == 'single_list' ) {
add_action('woocommerce_single_product_summary', 'etheme_product_countdown', 29);
}
if(etheme_get_option('reviews_position') == 'outside') {
add_filter( 'woocommerce_product_tabs', 'etheme_remove_reviews_from_tabs', 98 );
add_action( 'woocommerce_after_single_product_summary', 'comments_template', 30 );
}
if( get_option('yith_wcwl_button_position') == 'shortcode' ) {
add_action( 'woocommerce_after_add_to_cart_button', 'etheme_wishlist_btn', 30 );
}
if ( etheme_get_option('enable_brands') && etheme_get_option('brands_location') == 'content' ) {
add_action('woocommerce_before_single_product', 'etheme_single_product_brands', 4);
}
if ( etheme_get_option('enable_brands') && etheme_get_option('brands_location') == 'under_content' ) {
add_action('woocommerce_product_meta_start', 'etheme_single_product_brands', 2);
}
remove_action( 'woocommerce_before_shop_loop', 'wc_print_notices', 10 );
/* Increase avatar size for reviews on product page */
add_filter( 'woocommerce_review_gravatar_size', function() {
return 80;
}, 30 );
// ! Remove empty cart message
remove_action( 'woocommerce_cart_is_empty', 'wc_empty_cart_message', 10 );
// Pagination shop
add_filter('woocommerce_pagination_args', 'et_woocommerce_pagination');
add_action( 'template_redirect', 'et_wc_track_product_view', 20 );
// 360 view plugin
if( class_exists( 'SmartProductPlugin' ) ) {
remove_filter('woocommerce_single_product_image_html', array('SmartProductPlugin', 'wooCommerceImage'), 999, 2 );
}
}
}
You must be logged in to reply to this topic.Log in/Sign up