Post by ktellawi » Mon May 24, 2021 11:37 am

I need to redirect the customer from the checkout page to the registration page in case the user is not logged in / or when to click on add to cart also redirect it to the register page

I tried with the following code(put in /cataloge/controller/checkout/checkout.php)
in the OpenCart Default theme, it works properly.

if (!$this->customer->isLogged()) {
$this->session->data['redirect'] = $this->url->link('checkout/cart', '', 'SSL');

$this->redirect($this->url->link('account/login', '', 'SSL'));
}

but in my case OpenCart 3.0.3.2 and Journal 3 theme it was not succeded




So any idea or solution for this issue

Newbie

Posts

Joined
Wed May 05, 2021 9:12 pm

Post by by mona » Mon May 24, 2021 12:38 pm

Go into admin => settings and check the Guest checkout to only allow for registered users to checkout
This will then “force” the registration on the checkout page - negating the need to redirect -

With regards to your question - If it works on default and not with your theme - then you ask your theme developer to assist you.

DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.


https://www.youtube.com/watch?v=zXIxDoCRc84


User avatar
Expert Member

Posts

Joined
Mon Jun 10, 2019 9:31 am

Post by JNeuhoff » Mon May 24, 2021 6:05 pm

The Journal3 framework is not a proper standard compliant framework or theme for OpenCart and uses its own one-step checkout, hence you may have to get in touch with the Journal3 support on this.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am

Who is online

Users browsing this forum: No registered users and 24 guests