morganmcreynolds Posted April 2, 2015 Share Posted April 2, 2015 Hi, PrestaShop newbie here, so please be gentle I am beginning (literally) to learn about PrestaShop development. I have copied the mymodule.php example from the PrestaShop Developers Guide and it is not working for me. I am testing it in both a local 1.6.0.5 PS instance and a 1.6.0.14 PS instance (hosted remotely). The error message is: Parse error: syntax error, unexpected T_CLASS. I am certain that it is a relatively trivial issue, but I am unable to figure it it out. Any help would be much appreciated. The code (which I am copying verbatim from the Developer Guide) is listed below: <?php if (!defined('_PS_VERSION_')) exit; class MyModule extends Module { public function __construct() { $this->name = 'mymodule'; $this->tab = 'front_office_features'; $this->version = '1.0.0'; $this->author = 'Firstname Lastname'; $this->need_instance = 0; $this->ps_versions_compliancy = array('min' => '1.6', 'max' => _PS_VERSION_); $this->bootstrap = true; parent::__construct(); $this->displayName = $this->l('My module'); $this->description = $this->l('Description of my module.'); $this->confirmUninstall = $this->l('Are you sure you want to uninstall?'); if (!Configuration::get('MYMODULE_NAME')) $this->warning = $this->l('No name provided'); } } Link to comment Share on other sites More sharing options...
morganmcreynolds Posted April 2, 2015 Author Share Posted April 2, 2015 Hi, Following my own initial post.. If you double click the sample code from the doc.prestashop site and paste it in (as I did originally), it appears that cause some sort of character issues. I didn't get to the bottom of it exactly, but cut/paste of certain sections and manually typing the beginning and end seemed to move it past one issue. With that silliness out of the way, it appears to work fine. Link to comment Share on other sites More sharing options...
PascalVG Posted April 4, 2015 Share Posted April 4, 2015 Hi morgan. Welcome to the forum! Indeed, you should save the files in utf-8 encoding... Another tip. You can use a website like: http://phpcodechecker.com/ to check your code on most basic syntax errors. This sometimes may make life easier :-) Hope this helps, pascal. 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