Unable to extend Woocommerce class WC_Gateway_COD : PHP Fatal error: Class ‘WC_Gateway_COD’ not found


I have declared a class ‘WC_my_COD’ which tries to extends Woocommerce COD class ‘WC_Gateway_COD’.

// class_wc_my_cod.php
class WC_my_COD extends WC_Gateway_COD {

But I always get class not found error as below :

PHP Fatal error:  Class 'WC_Gateway_COD' not found in /home/.../public_html/wp-content/plugins/my-simple-COD/include/class_wc_my_cod.php

Why I am not able to extends Woocommerce class ? There are many custom plugin implementations that extends ‘WC_Gateway_COD’ class similar way. Do I need to include the path where of the php file where ‘WC_Gateway_COD’ class is implemented ?

, user2679476 2 years 2020-09-02T00:10:55-05:00 0 Answers 49 views 0

Leave an answer