I have directly modified the class-wc-checkout.php file from includes folder in woocommerce plugin to add custom line item meta data. Is there any way to override the class-wc-checkout.php file from my-theme folder as we override template files in woocommerce?
13
votes
6 Answers
8
votes
I was having this same issue. I don't have a need for reviews on my site, so I copied what I wanted to remove from a file inside of the includes folder and copied it into my functions.php file like so:
// Remove reviews from WooCommerce
if (! function_exists( 'woocommerce_default_product_tabs')) {
function woocommerce_default_product_tabs($tabs = array()) {
}
}
Works for me!
3
votes
3
votes
1
votes
0
votes
apply_couponfunction inwoocommerce/includes/class-wc-cart.php. The provided hooks aren't sufficient, and this file can't be overridden. Is there any other way to override this function without just editing the original plugin file? - nabrown