-
AuthorPosts
-
April 14, 2014 at 10:56 am #33367
Hi!
I’m trying to override the file:
x/framework/functions/global/woocommerce.phpBy placing a copy of it (modified, of course) in:
x-child-integrity-light/framework/functions/global/woocommerce.phpBut it’s not working 🙁 It still takes the parent theme file…
Is there any way to do this? Something I’m doing wrong?
Thanks!
April 14, 2014 at 4:44 pm #33449Some more information…
That’s because I wanted to add extra content and HTML markup between a product image and its title.
If I try to do it using:
add_action('woocommerce_before_shop_loop_item_title','madeincat_home_productbar', 5);
It’ll be adding the content over the image 🙁
Any ideas?
Thanks!
April 15, 2014 at 8:15 pm #33753Hi there!
Thank you for using the theme!
Do you mind if you post a screenshot of what you’re trying to do? Maybe this will help, add this on the child theme’s functions.php:
add_filter( 'woocommerce_before_single_product', 'x_woocommerce_add_before_single_product', 99 ); function x_woocommerce_add_before_single_product() { echo "SOMETHING HERE"; }
I hope that helps. Cheers!
April 18, 2014 at 5:30 am #34730Hi! I finally found a workarround, but now i’m stuck again in another place… And need again to override something that’s on
x/framework/functions/global/woocommerce.php
As I see in “x_woocommerce_shop_thumbnail” function stored in that file, it’s taking the “entry-full-” image.
I would like to take the default catalog image, as I have different image proportions for shop loop and single product pages…
If I comment the two lines:
remove_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10 ); add_action( 'woocommerce_before_shop_loop_item_title', 'x_woocommerce_shop_thumbnail', 10 );
Then Woocommerce uses its default image sizes and it all works perfect, but I’d preffer to avoid editing files in the main theme…
Any idea?
🙂 Thanks for your AWESOME support!
April 18, 2014 at 3:10 pm #34882Hi Xavier,
Thank you very much! You could try this at your child theme’s functions.php.
remove_action( 'woocommerce_before_shop_loop_item_title', 'x_woocommerce_shop_thumbnail', 10 ); add_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10 );
This is the reversed version of the code you commented.
Hope this helps. 🙂
April 18, 2014 at 3:11 pm #34884Hi!
This was the first thing I tried… but nothing happened 🙁
April 18, 2014 at 9:16 pm #35016Hi Xavier,
Oh yes, it will not work as child theme’s functions.php will be first loaded thus nothing to remove yet.
But it works when placed at /x/framework/functions/{STACK}.php
It represent each stack’s functions.php
April 19, 2014 at 1:33 am #35062Yep,
The question is, when I’ll update the theme, I should remember to change the file
/x/framework/functions/{STACK}.php
again? Or it’ll keep the changes?
Thanks!
April 19, 2014 at 2:53 am #35070Also, if you think there is another way to achieve this… This was just my idea on how to do it 🙂
The point is, I have set up this sizes in woocommerce config:
Because in my shop, I would like to use different image proportions for home:
And product detail:
Any help would be much appreciated!
Thanks!!! 🙂
April 19, 2014 at 4:15 pm #35185Hi Xavier,
Yes, it will be overwritten by next update. And tried another approach, added at child theme’s function.php and is working.
add_action('wp_head', 'change_wc_thumb_hooks'); function change_wc_thumb_hooks() { remove_action( 'woocommerce_before_shop_loop_item_title', 'x_woocommerce_shop_thumbnail', 10); add_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10); }
And other way to achieve something like at those sample will be template and hook editing.
Thank you.
April 21, 2014 at 4:26 am #35508Hey!!! Thanks!!! That really worked great!!!!!! 🙂
April 21, 2014 at 7:09 pm #35708You’re welcome Xavier.
-
AuthorPosts