Jump to content

Custom page creation : controller not found


Recommended Posts

I created 

class AllProductsControllerCore extends FrontController {

/**
 *  Initialize controller
 *  @see FrontController::init()
 */
public $php_self = 'allproducts';
 
public function init() {
    parent::init();
}

public function setMedia()
{
	parent::setMedia();
}

/**
 *  Assign template vars related to page content
 *  @see FrontController::initContent()
 */
public function initContent() {
    parent::initContent();

	
   $this->assignProductList();
	
    $this->setTemplate(_PS_THEME_DIR_.'allproducts.tpl');
}



	
}

 Uploaded controllers/front directory and tpl file into themes directory.

 

And i keep getting controller not found error. 

 

Searching for 4 hours why and no documentation about it.

 

Anyway by accident found class_index file in /cache directory. I was deleting smarty compile directory but not class_index file which has to be deleted on any new controller creation.

 

Once i deleted and it recreated itself with my controller class and now it works.

 

So if any noobs like me wants to create custome page without module or cms..delete that class_index file.

 

Also you can have custom url for your page. its in seo & urls under preferences , create new page and select your controller and add your shortcut url.

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

As an override...

In readme_override.txt:

Hello,

Please read the documentation before trying to override something here.
http://doc.prestashop.com/display/PS15/Overriding+default+behaviors

Frequently Asked Questions

Q: I added an override file but it seems to be ignored by PrestaShop
A: You need to trigger the regeneration of the /cache/class_index.php file. This is done simply by deleting the file. It is the same when manually removing an override: in order to reinstate the default behavior, you must delete the /cache/class_index.php file.
Link to comment
Share on other sites

  • 7 months later...

I have the same problem,but in back-office.

I developped new module in prestashop 1.6 in my local server, everything was nice.But when i installed it into my hosting server i get controller not found error when i click into module tab.

I can enter to configure the module via prestashop configurer link, i get the configuration page and it works nice.

I thought it comes from capitals letters, i check if all files names are identicals but i found everything are in good format.

Really, a strong problem this one, i must to deliver the product today to the client i don't know what to do.

Please, i need your help, everything can help, an idea , a link to tutorial, ....

Link to comment
Share on other sites

×
×
  • Create New...