Plugin autoload conflict with WooCommerce


I building my plugin in OOP but I have a conflict with WooCommerce.

The error response require(): Failed opening required ‘Automattic/WooCommerce/Container.php’

I use the spl_autoload_register function from PHP

spl_autoload_register( function( $classname ) {
    require str_replace( '', '/', $classname).'.php';
} );

Is there a solution to fix this issue so I can use autoloader?

Jop 4 weeks 0 Answers 3 views 0

Leave an answer