Post by cocolino » Tue Dec 17, 2024 8:07 pm

Hello, I'm using v3.0.3.8 and I would like to redirect(force) members who want to checkout and don't have a completed address to the page index.php?route=account/address/add

Can someone help me with this?
Thanks!
Last edited by cocolino on Wed Dec 18, 2024 2:25 pm, edited 1 time in total.

Newbie

Posts

Joined
Tue Dec 17, 2024 7:58 pm

Post by Cue4cheap » Tue Dec 17, 2024 10:55 pm

cocolino wrote:
Tue Dec 17, 2024 8:07 pm
Hello, I'm using v3.0.3.8 and I would like to redirect(force) members who want to checkout and don't have a completed address to the page index.php?route=account/address/add

Can someone help me with this?
Thanks!
So you want everyone to create an account?
Is that the goal?
Mike

cue4cheap not cheap quality


Expert Member

Posts

Joined
Fri Sep 20, 2013 4:45 am

Post by cocolino » Wed Dec 18, 2024 12:02 am

Cue4cheap wrote:
Tue Dec 17, 2024 10:55 pm
So you want everyone to create an account?
Is that the goal?
Mike
No,
I want registered members who don't have their address filled in to not be able to checkout until they fill in their address.

Thanks

Newbie

Posts

Joined
Tue Dec 17, 2024 7:58 pm

Post by paulfeakins » Wed Dec 18, 2024 12:59 am

cocolino wrote:
Wed Dec 18, 2024 12:02 am
I want registered members who don't have their address filled in to not be able to checkout until they fill in their address.
If you can't find an extension, you could pay a developer such as ourselves or post a job in the Commercial Support Forum.

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 cocolino » Wed Dec 18, 2024 1:03 am

paulfeakins wrote:
Wed Dec 18, 2024 12:59 am
If you can't find an extension, you could pay a developer such as ourselves or post a job in the Commercial Support Forum.
Thanks for the answer, but it doesn't help me at all.

Newbie

Posts

Joined
Tue Dec 17, 2024 7:58 pm

Post by by mona » Wed Dec 18, 2024 2:57 am

I do not really understand why this is a problem.
If you have not made changes to Opencart then you should not be able to checkout a delivery item without an address and payment requires an address.

Opencart has a "built in" required function - it is both in the twig and the validation process of the controller.
You should be able to use these for your needs.

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 cocolino » Wed Dec 18, 2024 4:45 am

by mona wrote:
Wed Dec 18, 2024 2:57 am
I do not really understand why this is a problem.
If you have not made changes to Opencart then you should not be able to checkout a delivery item without an address and payment requires an address.

Opencart has a "built in" required function - it is both in the twig and the validation process of the controller.
You should be able to use these for your needs.
Dear @mona,

I know these things quite well. You don't understand what I want, or did you not read the request well!?

I want a member who is registered on the site but does not have a shipping or payment address registered, but wants to checkout to be redirected to the page: index.php?route=account/address/add to make him fill in the address.

I made some changes to the script and I am stuck with this problem.
I don't see where you don't understand what I want?

Newbie

Posts

Joined
Tue Dec 17, 2024 7:58 pm

Post by by mona » Wed Dec 18, 2024 5:18 am

Thanks for the clarification.
You are asking for help on a modified Opencart, with a modified script that has edited core Opencart.

Default Opencart does not allow you to checkout without an address.
As Paul already mentioned and provided a link, custom work falls outside the scope of free support.

For free coding assistance you can try stackoverflow.com

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 » Wed Dec 18, 2024 6:07 am

I don't understand it. If a customer has already registered an account, and then sometime later decides to do a purchase the checkout will require him to fill in his address for shipping.

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 cocolino » Wed Dec 18, 2024 10:08 am

Thank you all for the advice, but it didn't help me at all. I knew I could call a developer for this change, but I thought someone could help me out of pleasure without directing me to hire a developer.
After all, there are only two, three lines of code for this requirement and this is a forum for community members.

Happy holidays to all!

Newbie

Posts

Joined
Tue Dec 17, 2024 7:58 pm

Post by softmonke » Wed Dec 18, 2024 10:56 am

The following should probably work, just add it to the "index" function of your checkout controller file.

Code: Select all

if ($this->customer->isLogged()) {
    $this->load->model('account/address');
    
    if (!$this->model_account_address->getAddresses()) {
        $this->response->redirect($this->url->link('account/address/add'));
    }
}
I didn't test this, sorry if there are any mistakes.

Check out our ever-growing list of extensions for OpenCart here.
Some useful extensions for a better admin experience: Image File Manager ProDrag & Drop Sort Order

Reach out to us at hello@softmonke.com for your OpenCart web development needs or feedback for our extensions.


User avatar
Active Member

Posts

Joined
Tue May 23, 2023 4:42 am


Post by cocolino » Wed Dec 18, 2024 12:41 pm

softmonke wrote:
Wed Dec 18, 2024 10:56 am
The following should probably work, just add it to the "index" function of your checkout controller file.
I didn't test this, sorry if there are any mistakes.
Thank you very much @softmonke, it works perfectly! :dance:

You can mark this request as solved!
Happy Holidays to all community members!

Newbie

Posts

Joined
Tue Dec 17, 2024 7:58 pm

Post by softmonke » Wed Dec 18, 2024 2:14 pm

No problem. You'll have to add [SOLVED] to the thread title yourself because you're the creator of the thread.

Check out our ever-growing list of extensions for OpenCart here.
Some useful extensions for a better admin experience: Image File Manager ProDrag & Drop Sort Order

Reach out to us at hello@softmonke.com for your OpenCart web development needs or feedback for our extensions.


User avatar
Active Member

Posts

Joined
Tue May 23, 2023 4:42 am

Who is online

Users browsing this forum: Semrush [Bot] and 14 guests