Post by vzs » Tue Aug 05, 2025 11:33 pm

I am looking at updating my website that is running on Opencart 2.3.0.2 to run on Opencart 4.1.0.3.

On version 4.1.0.3 is there away to change it so that the default at checkout is “Guest Checkout” instead of “Register Account”.

I manged to do this on the old 2.3.0.2 version but cannot find any information on how to do it in 4.1.0.3 version.

vzs
Newbie

Posts

Joined
Fri Feb 17, 2017 10:31 pm

Post by JNeuhoff » Wed Aug 06, 2025 12:07 am

Use OpenCart 3.0.4.1 which is the most stable version. The OpenCart 4 versions simply still have too many bugs and are still subject to development.

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


Post by vzs » Wed Aug 06, 2025 2:59 am

Thanks for your suggestion but do you know if it possible in 4.1.0.3 to make guest as the default

vzs
Newbie

Posts

Joined
Fri Feb 17, 2017 10:31 pm

Post by paulfeakins » Wed Aug 06, 2025 6:06 pm

vzs wrote:
Wed Aug 06, 2025 2:59 am
Thanks for your suggestion but do you know if it possible in 4.1.0.3 to make guest as the default
I would also suggest you move to 3.0.4.1 instead.

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Legendary Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by khnaz35 » Thu Aug 07, 2025 1:04 am

It appears we’ve been repeating the same points multiple times, and the end users don’t seem particularly concerned about using OC 4.X despite the existing bugs. At this stage, I suggest we step back and allow them to proceed as they choose—whether that means troubleshooting on their own or hiring a developer to support their implementation.

Got a burning question at 3 AM that even Google shrugs at? There’s a not-so-secret inbox that might just have your answer: khnaz35@gmail.com
Breathe in some nature while you're at it. It’s cheaper than therapy. :-*

Feel free to sling a bear my way via PayPal @ khnaz35@gmail.com


User avatar
Active Member

Posts

Joined
Mon Aug 27, 2018 11:30 pm
Location - Malaysia

Post by Exel » Thu Aug 07, 2025 6:55 am

It honestly looks like ideally that's how it's coded?

catalog\view\template\checkout\register.twig

Code: Select all

      {% if config_checkout_guest %}
        <div class="col mb-3 required">
          <div class="form-check form-check-inline">
            <input type="radio" name="account" value="1" id="input-register" class="form-check-input"{% if account %} checked{% endif %}/> <label for="input-register" class="form-check-label">{{ text_register }}</label>
          </div>
          <div class="form-check form-check-inline">
            <input type="radio" name="account" value="0" id="input-guest" class="form-check-input"{% if not account %} checked{% endif %}/> <label for="input-guest" class="form-check-label">{{ text_guest }}</label>
          </div>
        </div>
      {% endif %}
Specifically:

Code: Select all

<input type="radio" name="account" value="0" id="input-guest" class="form-check-input"{% if not account %} checked{% endif %}/> <label for="input-guest" class="form-check-label">{{ text_guest }}</label>
However, it looks like:

catalog\controller\checkout\register.php

Sets the account to 1 by default if no account is found in the session:

Code: Select all

		if (isset($this->session->data['customer']['customer_id'])) {
			$data['account'] = $this->session->data['customer']['customer_id'];
		} else {
			$data['account'] = 1;
		}
That means {% if not account %} checked{% endif %} will never be true

The "correct fix" is to change $data['account'] = 1 to $data['account'] = 0;

However, you might want to do this with an event so you don't edit core files.

Otherwise, just edit the register.twig

Newbie

Posts

Joined
Sat Feb 13, 2021 5:16 pm

Post by vzs » Thu Aug 07, 2025 8:37 pm

Thanks for your help Exel, I have managed to get it working.

vzs
Newbie

Posts

Joined
Fri Feb 17, 2017 10:31 pm

Post by paulfeakins » Thu Aug 07, 2025 10:33 pm

vzs wrote:
Thu Aug 07, 2025 8:37 pm
Thanks for your help Exel, I have managed to get it working.
Marking as [SOLVED].

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Legendary Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom
Who is online

Users browsing this forum: gunownergear and 13 guests