Jump to content

help with modual getting parse errors


devilsown

Recommended Posts

I would really aprecate any help with these error codes

  1. nozzle (parse error in /modules/nozzle/nozzle.php)
  2. nozzle (class missing in /modules/nozzle/nozzle.php)

 

I have this in the main folder named nozzle/ and the tpl file.

nozzle\views\templates\front\nozzle.tpl

 

I can only think of it being extra {}

And i personal see the class it says that is missing so it makes me think its something before its called or the main bracket.

 

 

 

<?php
if (!defined('_PS_VERSION_'))
 exit;

 class nozzle extends Module
{
 public function __construct()
 {
   $this->name = 'nozzle';
   $this->tab = 'front_office_features';
   $this->version = '1.0';
   $this->author = 'chance mcclurkin';
   $this->need_instance = 0;
   $this->ps_versions_compliancy = array('min' => '1.5', 'max' => '1.5');

   parent::__construct();

   $this->displayName = $this->l('Nozzle Caculator');
   $this->description = $this->l('Tells user what size nozzle to run');
}


public function install()
{
 if (Shop::isFeatureActive())
   Shop::setContext(Shop::CONTEXT_ALL);

 return parent::install() &&
   $this->registerHook('leftColumn') &&
   $this->registerHook('header') &&
 }

public function uninstall()
{
 return parent::uninstall() && Configuration::deleteByName('NOZZLE_NAME');
}





 public function hookDisplayLeftColumn($params)
{
 $this->context->smarty->assign(
  array(
	  'my_module_name' => Configuration::get('NOZZLE_NAME'),
	  'my_module_link' => $this->context->link->getModuleLink('nozzle', 'display')
  )
 );
 return $this->display(__FILE__, 'nozzle.tpl');
}

public function hookDisplayRightColumn($params)
{
 return $this->hookDisplayLeftColumn($params);
}

public function hookDisplayHeader()
{
 $this->context->controller->addjs($this->_path.'xxxx.js', 'all');
}


}

Link to comment
Share on other sites

public function install()
{
 if (Shop::isFeatureActive())
   Shop::setContext(Shop::CONTEXT_ALL);
 return parent::install() &&
   $this->registerHook('leftColumn') &&
   $this->registerHook('header') &&
 }

 

Extra && and ; is missing

Link to comment
Share on other sites

Thanks very much for your help it got it all up and going. Now i got 1 last small issue with this new modual.

 

Its bascaly a form that runs some math. which i don't want everyone to see the math in a js file. When someone clicks the run button it runs a js file. Inside the js file it calls a php file with all the math. So the million dollar isssue is do you know how i can change this link the js file so it looks in the moduals folder for the php file? i would perferr for all the moduals files to sit inside the moduals folder.

 

function doMath(){

var url = "methbackend.php?op=" + document.getElementById('op').value;

Edited by devilsown (see edit history)
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...