Overriding a WooCommerce Plugin in a Separate Child Theme

Theme Location

/wp-content/themes/HighendWP-child/

functions.php

<?php
function highendwp_child_enqueue_styles() {
    wp_enqueue_style('parent-style', get_template_directory_uri() . '/style.css');
    wp_enqueue_style('child-style', get_stylesheet_directory_uri() . '/style.css', array('parent-style'));
}
add_action('wp_enqueue_scripts', 'highendwp_child_enqueue_styles');
?>

Steps to Override WooCommerce Templates:

Locate the template file inside the plugin

Go to: /wp-content/plugins/woocommerce/templates/

Find the template file you want to override.

Example: single-product/add-to-cart/simple.php

Copy the template file to your child theme

Create a woocommerce folder inside your child theme:

/wp-content/themes/HighendWP-child/woocommerce/
Copy the template file (e.g., simple.php) from the plugin to:

/wp-content/themes/HighendWP-child/woocommerce/single-product/add-to-cart/simple.php
Edit the copied file in your child theme

Modify the template as needed.

Your version will override WooCommerce’s default template.

Leave a comment

Your email address will not be published. Required fields are marked *