Jump to content

Order Summary > An Error Occurred. Please Try Again.


Recommended Posts

When someone is at /cart.php and they select a product, they get redirected to the domain selection page, after entering in a domain name, they are redirected to the page /cart.php?a=confproduct&i=0

 

this error appears..

 

Order Summary > An Error Occurred. Please Try Again.

 

- - - Updated - - -

 

Some times after selecting the domain it just gets redirected to cart.php

 

ive deactivated and removed any 3rd party modules to see if something was causing this issue and no changes.. Still the same issue.

 

I am going to try reuploading the core whmcs files.

Link to comment
Share on other sites

I am going to try reuploading the core whmcs files.

that would have been my first thought too.

 

failing that, then you have to wonder if it could be an issue with the template, an errant hook - have you tried enabling errors and seeing if there are any record of the error in the logs ?

Link to comment
Share on other sites

that would have been my first thought too.

 

failing that, then you have to wonder if it could be an issue with the template, an errant hook - have you tried enabling errors and seeing if there are any record of the error in the logs ?

After a couple hours of playing around with files, ive found it to be 2 hook files causing the problem for some reason.

 

The first one is removing a parent menu item.

 

<?php

use WHMCS\View\Menu\Item as MenuItem;

add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar)
{
   if (!is_null($primaryNavbar->getChild('sms_center'))) {
       $primaryNavbar->removeChild('sms_center');
   }
});

 

Then im re adding this menu item as a child under the seconday nav > your account

<?php

use WHMCS\View\Menu\Item as MenuItem;

add_hook('ClientAreaSecondaryNavbar', 1, function (MenuItem $secondaryNavbar)
{
   if (!is_null($secondaryNavbar->getChild('Account'))) {
       $secondaryNavbar->getChild('Account')
           ->addChild('SMS Center', array(
               'label' => 'SMS Center',
               'uri' => 'index.php?m=sms_center',
               'order' => '60',

           ));
   }


}); 

 

Im guessing I need to have this as one file, instead of the 2 i am using now.?? Can you help me make this one file ?

Link to comment
Share on other sites

I'm guessing I need to have this as one file, instead of the 2 i am using now.?? Can you help me make this one file ?

I can - but I doubt it would resolve the issue. :?:

those two hooks are accessing different navbars, so there shouldn't be any clash between them - certainly the second hook that adds a link to the secondary navbar shouldn't be causing this.

 

but if you wanted them in one file, you would just do...

 

<?php

use WHMCS\View\Menu\Item as MenuItem;

add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar)
{
   if (!is_null($primaryNavbar->getChild('sms_center'))) {
       $primaryNavbar->removeChild('sms_center');
   }
});

add_hook('ClientAreaSecondaryNavbar', 1, function (MenuItem $secondaryNavbar)
{
   if (!is_null($secondaryNavbar->getChild('Account'))) {
       $secondaryNavbar->getChild('Account')
           ->addChild('SMS Center', array(
               'label' => 'SMS Center',
               'uri' => 'index.php?m=sms_center',
               'order' => '60',)
               );
   }    
});

but as I say, I don't think it will make any difference.

 

i'm wondering what is creating the "SMS Center" navbar link in the first place? I am assuming that it's the ModulesGarden SMS Center module?

if it is, then perhaps the module is checking whether the navbar link exists, and because it doesn't, that's what's causing the error? what I would do is disable that first hook that removes the navbar link and see if that solves it - if it does, then you know the module is trying to detect the navbar link and you'll either have to leave the link where it is, or contact ModuleGarden about the module.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated