Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Class not found when creating new module

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 05-09-2017, 04:31 AM
 
mm23456 mm23456 is offline
 

Member
  
Join Date: May 2017
Posts: 11
 

Default Class not found when creating new module

Hi,

I have recently started to use X-cart. I was following this tutorial: http://devs.x-cart.com/en/basics/understanding_models.html to create new Entity class for a new Module. However, I always get the following error:

An error occurred in your store.
ERROR: "0" (code N/A)
Class 'TestEntity' not found

I tried changing the path to the class when I try to instantiate it in test.php, but it still does not work. Also, the module is visible in Modules in admin part of the store, but the database table which should be automatically created according to the tutorial, is missing.

Do you have any suggestions?

Thank you!
__________________
X-cart 5.3.2.9
Multivendor
Reply With Quote
  #2  
Old 05-10-2017, 12:01 AM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: Class not found when creating new module

Most likely the path to the PHP file doesn't match your PHP class name (the one including the namespace).

Another possible reason is that your test.php script doesn't configure the automatic class loader. Please check the code that the cart.php file starts with.

And why do you need "test.php" script at all? Most likely you need a custom controller/action, not a custom script.
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote

The following user thanks qualiteam for this useful post:
mm23456 (05-15-2017)
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 07:52 PM.

   

 
X-Cart forums © 2001-2020