Jump to content

admin - blank page after installing a custom module


stratboy

Recommended Posts

Hi, quite a strange thing: I made a bare- bones test module (I'm a newbe) but clicking the install button in admin it gives me a blank page. The code is this:

 

class CustomShippingRates extends Module{
 public function __construct(){
$this->name = 'customshippingrates';
$this->tab = 'shipping_logistics';
$this->version = '1.0';
$this->author = 'Luca Reghellin';
$this->need_instance = 0;
  // $this->ps_versions_compliancy = array('min' => '1.5');
//$this->dependencies = array('blockcart');
 $this->dependencies = array();

parent::__construct();

$this->displayName = $this->l('Custom shipping rates');
$this->description = $this->l('Shipping rates based on items volumes.');

$this->confirmUninstall = $this->l('Are you sure you want to uninstall?');

if (!Configuration::get('CUSTOMSHIPPINGRATES_NAME'))	
  $this->warning = $this->l('No name provided');
 }//END CONSTRUCT
public function install(){
return parent::install() &&
   $this->registerHook('actionCartSave') &&
   $this->registerHook('displayTop');
}
public function uninstall(){
  if (!parent::uninstall())
  parent::uninstall();
}
public function hookActionCartSave(){

}

public function hookDisplayTop(){

}
}//END CLASS

 

Any idea?

Link to comment
Share on other sites

Have you by any chance forgotten to put :

<?php

 

On the first line of the file and either don;t have blank space at the end of the file or preferably DON'T put:

?>

 

at the end of the file....

 

The uninstall function doesn't really make any sense as you're trying to uninstall twice... better with just:

 

public function uninstall()
{
return parent:uninstall();
}

 

Can't see anything else obviously wrong....

Link to comment
Share on other sites

Thank you, I'll use your suggestions!

 

Have you by any chance forgotten to put :

<?php

 

On the first line of the file and either don;t have blank space at the end of the file or preferably DON'T put:

?>

 

at the end of the file....

 

The uninstall function doesn't really make any sense as you're trying to uninstall twice... better with just:

 

public function uninstall()
{
return parent:uninstall();
}

 

Can't see anything else obviously wrong....

Link to comment
Share on other sites

  • 4 years later...

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...