Controller With No Template

Hi there,

I have instances where I want to call a backend function without the need for rendering a template.

I have a simple controller and mode called "promotions.reset" that resets a number of session variables I am tracking for a custom purpose.

Which results in PHP generating the following error:

PHP Fatal error: Uncaught --> Smarty: Missing template name <--

Obviously, I gather this is because the template doesn't exist or I haven't set one. How can I tell the CS-CART core that I don't need to render anything?

Is that possible?

Cheers..

Calling 'exit' seems to do the trick, just wasn't sure if this would bypass other core cs-cart code that needs to be executed to maintain a stable state..

Hi there,

I have instances where I want to call a backend function without the need for rendering a template.

I have a simple controller and mode called "promotions.reset" that resets a number of session variables I am tracking for a custom purpose.

Which results in PHP generating the following error:

PHP Fatal error: Uncaught --> Smarty: Missing template name <--

Obviously, I gather this is because the template doesn't exist or I haven't set one. How can I tell the CS-CART core that I don't need to render anything?

Is that possible?

Cheers..

You can add redirect at the end of your mode.

return array(CONTROLLER_STATUS_REDIRECT, 'controller.mode');

Replace controller.mode with ones that you need.

As alternative use

fn_redirect('controller.mode');
exit();