Child Theme No Longer Overriding Woocommerce
-
Hello,
I having been using a child theme based on Astra to construct my website and have been using Woocommerce for my product/checkout system. As of a fortnight ago I had managed to create a custom checkout page and had it working as desired by overriding the ‘out of the box’ Woocommerce templates with modified ones from my child theme.
Yesterday I logged in to discover my child theme custom templates were no longer overriding the default Woocommerce ones (validated by adding changes to both and only the default template changes showing on the site).
I use the below code in my functions.php to establish the Astra child and enable Woocommerce theme support:
//Astra Child define( 'CHILD_THEME_ASTRA_CHILD_VERSION', '1.0.0' ); /** * Enqueue styles */ function child_enqueue_styles() { wp_enqueue_style( 'astra-child-theme-css', get_stylesheet_directory_uri() . '/style.css', array('astra-theme-css'), CHILD_THEME_ASTRA_CHILD_VERSION, 'all' ); } add_action( 'wp_enqueue_scripts', 'child_enqueue_styles', 15 ); //WOOCOMMERCE CUSTOM OVERIDE function mytheme_add_woocommerce_support() { add_theme_support( 'woocommerce' ); } add_action( 'after_setup_theme', 'mytheme_add_woocommerce_support' );
Naturally there is an accompanying styles.css with the relevant info for the Astra child.
I removed all other code from functions.php to validate it wasn’t some other code I had written which was causing the problem – it wasn’t.
In the WordPress dashboard under Woocommerce > Status I can see the Astra child is being used successfully and Woocommerce support has also successfully been enabled. It is also successfully recognising the child theme template files using the astrachild/woocommerce/checkout/form-checkout.php structure it requires.
The only thing which may have changed between now and a fortnight ago is I recall the WP dashboard was advising me a Woocommerce DB update needed to be performed. That message is no longer there so I am wondering if the update has since happened and it has bricked something behind the scenes.
I am absolutely stumped and considerably frustrated. Any help will be greatly appreciated.
- The topic ‘Child Theme No Longer Overriding Woocommerce’ is closed to new replies.