Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Redirecting a customer to a custom page after registration

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 11-05-2019, 10:50 AM
 
Ed B. Ed B. is offline
 

X-Adept
  
Join Date: Apr 2016
Posts: 446
 

Default 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?
__________________
X-cart 5.2.12, php 5.6
Ed from Grenoble, France
Reply With Quote
  #2  
Old 11-05-2019, 11:31 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default 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
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote

The following user thanks cflsystems for this useful post:
Ed B. (11-06-2019)
  #3  
Old 11-06-2019, 12:56 AM
 
Ed B. Ed B. is offline
 

X-Adept
  
Join Date: Apr 2016
Posts: 446
 

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

Can't believe I did this again
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.
__________________
X-cart 5.2.12, php 5.6
Ed from Grenoble, France
Reply With Quote
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 08:02 AM.

   

 
X-Cart forums © 2001-2020