Home › Forums › WoodMart support forum › WooCommerce Advanced Product Labels conflicting with theme product images
WooCommerce Advanced Product Labels conflicting with theme product images
- This topic has 7 replies, 2 voices, and was last updated 3 years ago by
Elise Noromit.
-
AuthorPosts
-
February 7, 2022 at 9:47 pm #351187
viribrightParticipantTo WooCommerce Advanced Product Labels Support:
On Tue, Feb 1, 2022 at 9:08 PM Kenny Overcast <[email protected]> wrote:
When on any product page the 2nd and 3rd product image would show like the attached. Although The 1st and 4th images would show correctly. I have deactivated your plugin so the error no longer shows up on my production website. Is there a way for you to fix without a link? I have spoken with woocommerce core, my server host, and my wordpress theme and all of them point to your plugin being the cause of the issue.From WooCommerce Advanced Product Labels Support
I’ve seen something like this before on the Flatsome theme, but not on the theme you’re using. This had to do with the usage of the Flickity slider if I’m not mistaken (its been a while).The fix for that was to change the position/priority of where the labels are positioned, a similar solution may be required for your theme:
// Reposition Flatsome hooks for label output
add_action( ‘init’, function() {
if ( function_exists( ‘WooCommerce_Advanced_Product_Labels’ ) ) {
remove_action( ‘woocommerce_before_shop_loop_item_title’, array( WooCommerce_Advanced_Product_Labels()->single_labels, ‘product_label_template_hook’ ), 15 );
remove_action( ‘woocommerce_before_shop_loop_item_title’, array( WooCommerce_Advanced_Product_Labels()->global_labels, ‘global_label_hook’ ), 15 );add_action( ‘woocommerce_after_shop_loop_item’, array( WooCommerce_Advanced_Product_Labels()->single_labels, ‘product_label_template_hook’ ), 15 );
add_action( ‘woocommerce_after_shop_loop_item’, array( WooCommerce_Advanced_Product_Labels()->global_labels, ‘global_label_hook’ ), 15 );// Single product labels
remove_action( ‘woocommerce_product_thumbnails’, array( WooCommerce_Advanced_Product_Labels()->single_labels, ‘product_label_template_hook’ ), 9 );
remove_action( ‘woocommerce_product_thumbnails’, array( WooCommerce_Advanced_Product_Labels()->global_labels, ‘global_label_hook’ ), 9 );add_action( ‘flatsome_product_labels’, array( WooCommerce_Advanced_Product_Labels()->single_labels, ‘product_label_template_hook’ ), 15 );
add_action( ‘flatsome_product_labels’, array( WooCommerce_Advanced_Product_Labels()->global_labels, ‘global_label_hook’ ), 15 );
}
}, 5 );Your developer may be able to assist in creating the specific customization to find a solution for your theme.
Can you please customize to find a solution for your theme?
Attachments:
You must be logged in to view attached files.February 8, 2022 at 10:44 am #351341
Elise NoromitMemberHello,
Please try to add this code to the functions.php of the child theme:
add_action( 'init', function() { if ( function_exists( 'WooCommerce_Advanced_Product_Labels' ) ) { // Single product labels remove_action( 'woocommerce_product_thumbnails', array( WooCommerce_Advanced_Product_Labels()->single_labels, 'product_label_template_hook' ), 9 ); remove_action( 'woocommerce_product_thumbnails', array( WooCommerce_Advanced_Product_Labels()->global_labels, 'global_label_hook' ), 9 ); add_action( 'woocommerce_before_single_product_summary', array( WooCommerce_Advanced_Product_Labels()->single_labels, 'product_label_template_hook' ), 15 ); add_action( 'woocommerce_before_single_product_summary', array( WooCommerce_Advanced_Product_Labels()->global_labels, 'global_label_hook' ), 15 ); } }, 5 );
Best Regards
February 8, 2022 at 5:32 pm #351463
viribrightParticipantWhere can I access my child theme?
February 9, 2022 at 12:17 am #351530
viribrightParticipantwhy can’t I add a child theme? I provided the css code with the header comment but it is still showing this error.
Attachments:
You must be logged in to view attached files.February 9, 2022 at 12:30 am #351536
Elise NoromitMemberHello,
Please do not create the child theme, it is provided in the theme folder. All you need is just to upload and activate it.
Best Regards
February 10, 2022 at 6:10 pm #352075
viribrightParticipantWhere is the child theme provided in the theme folder? I am in my sftp and cannot find it.
February 10, 2022 at 6:40 pm #352077
viribrightParticipantI found it and your php fix worked great! Thank you!
February 10, 2022 at 9:28 pm #352098
Elise NoromitMemberYou are welcome! We are here to help.
Wish you a wonderful day!
-
AuthorPosts
The topic ‘WooCommerce Advanced Product Labels conflicting with theme product images’ is closed to new replies.
- You must be logged in to create new topics. Login / Register