Questions around the TYPO3 integration and plugins as well as Flow and NeosCMS
Forum rules: Always add your TYPO3/Flow, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
#5075 by Dennis
23 Nov 2017, 12:36

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 ... b.2Fcustom and, 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;

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
#5115 by aimeos
27 Nov 2017, 12:25
We did a implementation of test classes to see if we get the same error but it works without problems and no additional autoloader is required. Here are the classes we've used:

Code: Select all<?php

namespace Aimeos\MShop\Product\Item;

class Test
   extends \Aimeos\MShop\Product\Item\Standard

Code: Select all<?php

namespace Aimeos\MShop\Product\Manager;

class Test
   extends \Aimeos\MShop\Product\Manager\Standard
   protected function createItemBase( array $values = [], array $listItems = [],
      array $refItems = [], array $propertyItems = [] )
      return new \Aimeos\MShop\Product\Item\Test( $values, $listItems, $refItems, $propertyItems );

Required configuration:
Code: Select all<?php

return [
   'product' => [
      'manager' => [
         'name' => 'Test',

All files have been placed in a generated 2017.x TYPO3 extension in
- Item: /typo3conf/ext/aitest/Resources/Private/Extensions/aitest/lib/custom/src/MShop/Product/Item/Test.php
- Manager: /typo3conf/ext/aitest/Resources/Private/Extensions/aitest/lib/custom/src/MShop/Product/Manager/Test.php
- Configuration: /typo3conf/ext/aitest/Resources/Private/Extensions/aitest/lib/custom/config/mshop.php