Plugin autoload conflict with WooCommerce

Question

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

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

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

0
Jop 4 weeks 0 Answers 3 views 0

Leave an answer