Jump to content

Edit History

Shapes

Shapes

Hello,

I built up a module which was seeming to work quite fine on product page load, but I'm getting an error when selecting a product variant:

ClassNotFoundException

Attempted to load class "MyModule" from the global namespace.
Did you forget a "use" statement?

With the module, I'm overriding ProductControllerCore in override/controllers/front/ProductController.php like:

class ProductController extends ProductControllerCore
{
    public function initContent()
    {
        ...

        $content = MyModule::getMyModuleContent($id_lang);

        ...

        parent::initContent();
    }
}

MyModule is located in mymodule/mymodule.php like:

<?php

...

class MyModule extends Module
{
    ...
}

Again, this is working just fine until I select a product combination.

I tried to add a composer.json file like:

{
  "name" : "prestashop/mymodule",
  "description": "My Module",
  "autoload": {
    "psr-4": {
      "MyModule\\": "/",
      "MyModuleClass\\": "classes/"
    }
  },
  "type" : "prestashop-module"
}

But it did not solve my issue.

Any idea on how I could get this solved please?

 

Shapes

Shapes

Hello,

I built up a module which was seeming to work quite fine on product page load, but I'm getting an error when selecting a product variant:

ClassNotFoundException

Attempted to load class "MyModule" from the global namespace.
Did you forget a "use" statement?

With the module, I'm overriding ProductControllerCore in override/controllers/front/ProductController.php like:

class ProductController extends ProductControllerCore
{
    public function initContent()
    {
        ...

        $content = MyModule::getMyModuleContent($id_lang);

        ...

        parent::initContent();
    }
}

MyModule is located in mymodule/mymodule.php like:

<?php

...

class MyModule extends Module
{
    ...
}

Again, this is working just fine until I select a product combination.

I tried to add a composer.json file like:

{
  "name" : "prestashop/mymodule",
  "description": "My Module",
  "autoload": {
    "psr-4": {
      "MyModule\\": "/",
      "MyModuleClass\\": "classes/"
    }
  },
  "type" : "prestashop-module"
}

But it did not solve my issue.

Any idea on how I could get this solved please?

 

Shapes

Shapes

Hello,

I built up a module which was seeming to work quite fine on product page load, but I'm getting an error when selecting a product variant:

ClassNotFoundException

Attempted to load class "MyModule" from the global namespace.
Did you forget a "use" statement?

With the module, I'm overriding ProductControllerCore in override/controllers/front/ProductController.php like:

class ProductController extends ProductControllerCore
{
    public function initContent()
    {
        ...

        $content = MyModuleClass::getMyModuleContent($id_lang);

        ...

        parent::initContent();
    }
}

MyModule is located in mymodule/mymodule.php like:

<?php

...

class MyModule extends Module
{
    ...
}

Again, this is working just fine until I select a product combination.

I tried to add a composer.json file like:

{
  "name" : "prestashop/mymodule",
  "description": "My Module",
  "autoload": {
    "psr-4": {
      "MyModule\\": "/",
      "MyModuleClass\\": "classes/"
    }
  },
  "type" : "prestashop-module"
}

But it did not solve my issue.

Any idea on how I could get this solved please?

 

Shapes

Shapes

Hello,

I built up a module which was seeming to work quite fine on product page load, but I'm getting an error when selecting a product variant:

ClassNotFoundException

Attempted to load class "MyModuleClass" from the global namespace.
Did you forget a "use" statement?

With the module, I'm overriding ProductControllerCore in override/controllers/front/ProductController.php like:

class ProductController extends ProductControllerCore
{
    public function initContent()
    {
        ...

        $content = MyModuleClass::getMyModuleContent($id_lang);

        ...

        parent::initContent();
    }
}

The MyModuleClass class is located in mymodule/classes like:

<?php

class MyModuleClass extends ObjectModel
{
	...
}

Again, this is working just fine until I select a product combination.

I tried to add a composer.json file like:

{
  "name" : "prestashop/mymodule",
  "description": "My Module",
  "autoload": {
    "psr-4": {
      "MyModuleClass\\": "classes/"
    }
  },
  "type" : "prestashop-module"
}

But it did not solve my issue.

Any idea on how I could get this solved please?

 

Shapes

Shapes

Hello,

I built up a module which was seeming to work quite fine on product page load, but I'm getting an error when selecting a product variant:

ClassNotFoundException

Attempted to load class "MyModuleClass" from the global namespace.
Did you forget a "use" statement?

With the module, I'm overriding ProductControllerCore in override/controllers/front/ProductController.php like:

class ProductController extends ProductControllerCore
{
    public function initContent()
    {
        ...

        $content = MyModuleClass::getMyModuleContent($id_lang);

        ...

        parent::initContent();
    }
}

The MyModuleClass class is located in mymodule/classes like:

<?php

class MyModuleClass extends ObjectModel
{
	...
}

Again, this is working just fine until I select a product combination.

I tried to add a composer.json file like:

{
  "name" : "prestashop/mymodule",
  "description": "My Module",
  "autoload": {
    "psr-4": {
      "MyModuleClass\\": "classes/"
    }
  },
  "type" : "prestashop-module"
}

Any idea on how I could get this solved please?

 

Shapes

Shapes

Hello,

I built up a module which was seeming to work quite fine on product page load, but I'm getting an error when selecting a product variant:

ClassNotFoundException

Attempted to load class "MyModuleClass" from the global namespace.
Did you forget a "use" statement?

With the module, I'm overriding ProductControllerCore in override/controllers/front/ProductController.php like:

 

class ProductController extends ProductControllerCore
{
    public function initContent()
    {
        ...

        $content = MyModuleClass::getMyModuleContent($id_lang);

        ...

        parent::initContent();
    }
}

The MyModuleClass class is located in mymodule/classes like:

<?php

class MyModuleClass extends ObjectModel
{
	...
}

Again, this is working just fine until I select a product combination.

I tried to add a composer.json file like:

{
  "name" : "prestashop/mymodule",
  "description": "My Module",
  "autoload": {
    "psr-4": {
      "MyModuleClass\\": "classes/"
    }
  },
  "type" : "prestashop-module"
}

Any idea on how I could get this solved please?

 

×
×
  • Create New...