1

I'm programming a module for Prestashop. It's working fine, except for a redirection link.

This is the code:

Tools::redirectLink(__PS_BASE_URI__.'modules/mymodule/page.php?err=f&key='.$rid_key.'&id_cart='.$rid_cart.'&id_module='.$rid_module.'&id_order='.$rid_order);

Then the browser redirects to:

http://mydomain/index.php?controller=modules/mymodule/page?err=f&key=c0acad8c21e44ed574df023c1dd11c17&id_cart=93&id_module=86&id_order=934251

But this generates a prestashop 404 not found.

I'm a bit lost.

I have enabled debug in settings, but no error is displayed. Any idea of how to debug this?

1 Answer 1

0

There is a work around to simply do the same as you want.

Just paste the code you want to run in page.php into a new controller and them (in function initContent()) as follows:

class YourModuleNameManagerModuleFrontController extends ModuleFrontController
{

    public function initContent()
    {
        parent::initContent();
        // Your Code Here
    }
}

Now call this controller instead of the file page.php and it will work fine.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.