Cannot activate the module on OXID 6.1 with version of metadata 2.0

Hi guys,

I am working on a module for OXID 6.1, but I have problems when I am trying to extend some of the core classes ex. Basket class.

Here is how my files looking like:
composer.json:
{
“name”: “company/mymodule”,
“description”: “Test Module.”,
“type”: “oxideshop-module”,
“keywords”: [
“oxid”,
“modules”,
“eShop”,
“WYSIWYG”,
“Summernote”,
“Editor”
],
“homepage”: “https://www.oxid-esales.com/en/home.html”,
“license”: “GPL-3.0-only”,
“authors”: [
{
“name”: “Developer”,
“email”: "[email protected]"
}
],
“extra”: {
“oxideshop”: {
“target-directory”: “company/mymodule”
}
},
“require”: {
“php”: “>=5.6”
},
“autoload”: {
“psr-4”: {
“Company\MyModule\”: “./source/modules/company/mymodule”
}
}
}
metadata.php:
‘extend’ => array(
\OxidEsales\Eshop\Application\Model\Basket::class => \Company\MyModule\Application\Model\Basket::class,
),

In Application/Model directory I have class Basket.php:

<?php

namespace Company\MyModule\Application\Model;

class Basket extends Basket_parent{

}

I also tried with ‘OxidEsales\MyModule\’ as a namespace but still cannot activate the module because in the admin-backend I am getting an error:

Invalid modules were detected. and the error is in the line where I am extending Basket class.

Any help?
Thank you in advance!

hi,
did you do composer dump-autoload?
regards

1 Like

composer dump-autoload resolved my problem.
Thanks for help!