AbanteCart Community

AbanteCart Development => Customization help => Topic started by: rachelsung on July 27, 2016, 03:39:51 AM

Title: Check out as guest only?
Post by: rachelsung on July 27, 2016, 03:39:51 AM
Hi,

I would like to direct the customers as guest checkout only.  That means after click the "check out" button, the flow will skip choosing new customer/existing customers/checkout as guest page and go directly to "guest checkout step 1" page.  How should I do that?

I don't mind to change the code now.

Which files and values should I modify?

Thank you very much in advance.
Title: Re: Check out as guest only?
Post by: eCommerce Core on July 27, 2016, 09:51:48 AM
The easiest way to do this is to change code in login controller.

/storefront/controller/pages/account/login.php

Add below line right after: public function main(){

$this->redirect($this->html->getSecureURL('checkout/guest_step_1'));

Essentially, what are you doing, is forcing any login attempt to go to guest checkout.

If you need to do this in extension, you can hook to "_InitData" of this controller and do same redirect.
It is easy and straight forward.

Title: Re: Check out as guest only?
Post by: rachelsung on July 27, 2016, 02:32:51 PM
hi, eCommerce Core:

Thank you for the prompt answer.

I followed the instruction to add the line in login.php and it worked perfectly !

Thank you so much ! :D