Author Topic: Check out as guest only?  (Read 3958 times)

Offline rachelsung

  • Newbie
  • *
  • Posts: 9
  • Karma: +2/-0
    • View Profile
Check out as guest only?
« 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.

Offline eCommerce Core

  • Administrator
  • Hero Member
  • *****
  • Posts: 1602
  • Karma: +93/-1
    • View Profile
Re: Check out as guest only?
« Reply #1 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.

“If you’re in the luckiest one per cent of humanity, you owe it to the rest of humanity to think about the other 99 per cent.”
― Warren Buffett

Offline rachelsung

  • Newbie
  • *
  • Posts: 9
  • Karma: +2/-0
    • View Profile
Re: Check out as guest only?
« Reply #2 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
« Last Edit: July 27, 2016, 02:39:07 PM by rachelsung »

 

Powered by SMFPacks Social Login Mod