X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (X-Cart 5) (https://forum.x-cart.com/forumdisplay.php?f=56)
-   -   Redirecting a customer to a custom page after registration (https://forum.x-cart.com/showthread.php?t=77316)

Ed B. 11-05-2019 10:50 AM

Redirecting a customer to a custom page after registration
 
First of all let me start with general remarks about the webmaster mode.

  • To use the feature, we need to be logged in as an administrator. As a consequence, we can't use it to find out what goes on in the pages that customers who aren't logged in can see, which is the subject of this post.
  • Picking up template from the page disable clicking (which, of course, is necessary), thus it is impossible to picking up template from a pop-up window
  • Last but not least, it can be used only for customer section and not for admin section.
So here is my question. I would like to redirect a customer to a page of my choice,
instead of address book page, after registration. A search through this forum shows
that such a feature existed for XC4, e.g.


https://forum.x-cart.com/showthread.php?t=62989&highlight=registration
However, I haven't seen any post on the subject for XC5.



Now, for the reason I mentioned above, it is extremely difficult for me to figure out
which class is responsible for the redirection. However, I found this

Code:

    protected function getActionRegisterSuccessURL()
    {
        return array(
            'address_book',
            '',
            array('profile_id' => $this->getModelForm()->getProfileId(false)),
        );
    }





in /XLite/Controller/Customer/Profile.php.


So I made a class XLite/Module/VendorID/ModuleID/Customer/Profile.php with


Code:

<?php
namespace XLite\Module\CendorID\ModuleID\Controller\Customer;
class Profile extends \XLite\Controller\Profile
{
    protected function getActionRegisterSuccessURL()
    {
        return array(
            'mypage',
            '',
            array('profile_id' => $this->getModelForm()->getProfileId(false)),
        );
    }
}







but the customer is still redirected to the address book page after registration. What am I doing wrong here?

cflsystems 11-05-2019 11:31 AM

Re: Redirecting a customer to a custom page after registration
 
Code:

class Profile extends \XLite\Controller\Profile implements \XLite\Base\IDecorator


you are missing the "implements" portion

Ed B. 11-06-2019 12:56 AM

Re: Redirecting a customer to a custom page after registration
 
Can't believe I did this again :oops:
On the other hand, now people with this problem can find how to change the URL to redirect.


And, of course, the correct code is


Code:

class Profile extends \XLite\Controller\Customer\Profile implements \XLite\Base\IDecorator



Thank you very much.


All times are GMT -8. The time now is 06:57 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.