• I have a custom theme that uses WooCommerce. I’m trying to override some WooCommerce functionality/styling in the Child theme but the file doesn’t appear to be working.

    I have the file in this directory: /childtheme/woocommerce/theme-woo.php

    I have this in my child theme functions.php file:

    /* This file is for overrides on the woocommerce templates */
    if (class_exists('Woocommerce')) {
    	include_once( TEMPLATEPATH . '/woocommerce/theme-woo.php' );
    }

    The stuff I have changed in the theme-woo.php file is not showing up at all on the site. Am I doing something wrong? I have added another WooCommerce file (content-single-product.php) in the /childtheme/woocommerce directory without having to link to it in the functions.php file, and it works just fine. Am I missing something?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Have you looked at the CSS specificity and/or other CSS problems?

    Firebug and/or validating the CSS should be helpful in identifying what’s going on.

    Thread Starter sparklogix

    (@mybenson)

    I’m trying to change a class name from span9 to span12 and it’s not changing on the page. I’ve checked in Firebug and it doesn’t change at all. I changed the class name in the parent theme file and it works, but I don’t want to modify the parent theme.

    I’m having this exact same problem, I believe it could be because your theme-woo.php file is not a template file, and only template files get overriden automatically in a child theme. I assume that content-single-product.php is a template file which is why it gets overriden.

    I hope theres a way to be able to override other files, I don’t know how but I wonder if you’ve managed to solve your problem?

    Edit: One of the problems I’m having is that the parent theme’s function.php includes all the files it needs, but I assume that it includes the file from its parent theme directory. What would be useful is to be able to not include those but include the files from the child theme. I don’t think its possible to un-include a file though later on…

    I got the same problem, with a theme that uses a file in the parent theme: /framework/meta-boxes.php

    I am trying to make some customisation reproducing the same structure in the child theme, but it doesn’t work.

    Do you guys worked out the solution?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘File in Child Theme is not overriding Parent Theme file?’ is closed to new replies.