Jump to content

Module front controllers 404 Prestashop 1.7.8


S.A

Recommended Posts

Dear Developer

I'm working on a custom payment plugin in Prestashop 1.7. I created a callback URL 

But the page returned 404 **"The page you are looking for was not found.
"**. This is a controller path:

/controllers/front/Validation.php

    $callback_url = $this->context->link->getModuleLink($this->name, 'Validation', [], true);
    $this->context->smarty->assign([
            'callback_url' => $callback_url)];

What's wrong!

Thank you for your support

Link to comment
Share on other sites

@knacky No need to add link in Seo & Url 

I use this in validation file controllers. 

 

private function redirectToOrder($cart, $customer, $message = null)
    {
        $url =
            'index.php?controller=order-confirmation' .
            '&id_cart=' . $cart->id .
            '&id_module=' . $this->module->id .
            '&id_order=' . $this->module->currentOrder .
            '&key=' . $customer->secure_key;

        if ($message) {
            $url .= '&message=' . $message;
        }

        Tools::redirect($url);
    }

 

Link to comment
Share on other sites

11 hours ago, S.A said:

@knacky No need to add link in Seo & Url 

I use this in validation file controllers. 

 

private function redirectToOrder($cart, $customer, $message = null)
    {
        $url =
            'index.php?controller=order-confirmation' .
            '&id_cart=' . $cart->id .
            '&id_module=' . $this->module->id .
            '&id_order=' . $this->module->currentOrder .
            '&key=' . $customer->secure_key;

        if ($message) {
            $url .= '&message=' . $message;
        }

        Tools::redirect($url);
    }

 

What is your URL to show error 404?

Link to comment
Share on other sites

6 hours ago, tdsoft said:

What is your URL to show error 404?

https://domain-name/index.php?fc=module&amp%3Bmodule=module-name&amp%3Bcontroller=validation&id=payment-id&status=paid&amount=1912&message=Succeeded%21

 

Link to comment
Share on other sites

Do you want help or not?
You must provide a valid link to the site and turn on debug mode.

You do not want to give a valid link to the site, go to the JOB section and enter a request and someone will repair the module for a fee.

 

Link to comment
Share on other sites

8 minutes ago, knacky said:

Do you want help or not?
You must provide a valid link to the site and turn on debug mode.

You do not want to give a valid link to the site, go to the JOB section and enter a request and someone will repair the module for a fee.

 

After enable debug mode:

Fatal error: Uncaught PrestaShopException: is not a valid module name. in /ps-1.7.8/prestashop/classes/Tools.php:1182 Stack trace: #0 /ps-1.7.8/prestashop/classes/module/Module.php(1159): ToolsCore::displayError(' is not a valid...') #1 /ps-1.7.8/prestashop/classes/Dispatcher.php(390): ModuleCore::getInstanceByName('') #2 /ps-1.7.8/prestashop/index.php(28): DispatcherCore->dispatch() #3 {main} thrown in /ps-1.7.8/prestashop/classes/Tools.php on line 1182

Link to comment
Share on other sites

There is no more advice.
Everything has already been said.

You claim that you have everything right and I claim that you don't and no one will just examine your module and correct the error, according to the examples you give here.

Your FrontController just doesn't know your module.

Link to comment
Share on other sites

  • 7 months later...
35 minutes ago, pg_dev said:

@knackyI wonder how fellow people around you, tolerate you!😪 Instead of helping @S.A/ providing guidance you are just confusing him by sending links. What would have cost you if you could just explain him in detail. Your answer would have also helped others too. But no Why would you do that for free?? Am i right?!! and look at your replies. So mean, so rude!!!  👎who says like that? why are you still in prestashop community if you have no intentions to help others. Someone pls exclude him from this community. It will be a big relief. You are an absolute disappointment in yourself.  I came here in this page to look for some solution to my question and my mind just got heated by going through your response. Anyways, God Bless you!

@pg_dev

Hi.

It is polite to say hello first and then write.

I have to support @knacky, it helps a lot.

It is only up to those who ask and need help if they are shareable.
If they are asked for a code, or a link to a page or a complete extract from debug mode, they should do it, they have the option to share links and codes via a private message.

You always have the option under the posts to report the post to the moderators and write to them what is so objectionable that they remove the post or block the user's account.

If you read your post, it is not helpful and I would consider it as spam.

Realize that older programmers study a lot and then someone comes to the forum and wants to get the answer at any cost.

Good luck to you too.

Everyone who reads your response will want to help you.

Edited by 4you.software (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...