Using Aimeos\MShop\Product\Item\Standard in a custom EXT
Posted: 23 Nov 2017, 12:36
Hi,
in a custom extension I want to extend the core class Aimeos\MShop\Product\Item\Standard, but am getting the error 'PHP Fatal error: Class 'Aimeos\MShop\Product\Item\Standard' not found in ... (path of the custom php class)'.
The aimeos extension, where the class Aimeos\MShop\Product\Item\Standard is defined, is installed and activated, too.
Additionally I tried to build the extension with your extension builder described on https://aimeos.org/docs/Developers/Crea ... b.2Fcustom and https://aimeos.org/developer/extensions/, but am not getting rid of the error.
If I use something like this:
all classes are found and the error disappears.
However, I really think this is a suboptimal solution.
Could you explain a bit why exactly I get this error, why the core class is not found and what would be the best solution to extend the class Aimeos\MShop\Product\Item\Standard in a custom extension?
Thank you very much in advance again!
TYPO3 8.7.8. aimeos 17.10.1, PHP: 7.1.9, Operating system: Unix
in a custom extension I want to extend the core class Aimeos\MShop\Product\Item\Standard, but am getting the error 'PHP Fatal error: Class 'Aimeos\MShop\Product\Item\Standard' not found in ... (path of the custom php class)'.
The aimeos extension, where the class Aimeos\MShop\Product\Item\Standard is defined, is installed and activated, too.
Additionally I tried to build the extension with your extension builder described on https://aimeos.org/docs/Developers/Crea ... b.2Fcustom and https://aimeos.org/developer/extensions/, but am not getting rid of the error.
If I use something like this:
Code: Select all
$extPath = dirname(__DIR__, 6);
$localautoloader = $extPath . '/aimeos/Resources/Libraries/autoload.php';
if( file_exists( $localautoloader ) === true ) {
require_once $localautoloader;
}
However, I really think this is a suboptimal solution.
Could you explain a bit why exactly I get this error, why the core class is not found and what would be the best solution to extend the class Aimeos\MShop\Product\Item\Standard in a custom extension?
Thank you very much in advance again!
TYPO3 8.7.8. aimeos 17.10.1, PHP: 7.1.9, Operating system: Unix