Netsys.fr Posted August 25, 2023 Share Posted August 25, 2023 Hi, I created a module in PrestaShop 8.1 where I declare class VirtualProductExternalLink extends \ObjectModel in /src/Entity/ folder. I made an override GetFileController.php of the GetFileControllerCore controller placed in the override/controllers/front/ folder of the module (when installing the module this file is placed in the /override/controllers/front/ folder of PrestaShop) In this override I want to instantiate a VirtualProductExternalLink object with $external_link = new VirtualProductExternalLink($id_product); but I have the error Uncaught Error: Class "VirtualProductExternalLink" not found. At the beginning of the override file, I indicated: use ProductVirtualExternalFile\Entity\VirtualProductExternalLink; or include_once _PS_MODULE_DIR_.'productvirtualexternalfile/src/Entity/VirtualProductExternalLink.php'; but i have the same error. How can I create a declare object in the module from my controller override? Thanks for the information Link to comment Share on other sites More sharing options...
Netsys.fr Posted August 25, 2023 Author Share Posted August 25, 2023 it was necessary to indicate the use AND include_once 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now