Set default city and remove country in signup form

Open to all! Ask other shopowners for help.
hertsflowers
Member
Posts: 9
Joined: Mon Aug 28, 2023 8:34 am
Phoenix Version: v1.0.7.18
Has thanked: 6 times

Set default city and remove country in signup form

Post by hertsflowers »

Hey,

Thank you for this great store software. I have just installed it but have a few questions.

1. How do I make the signup form have a single default city?
2. How do I remove country from the signup form.

I run a flower shop in my local county and only take order from and deliver to my home city. So I want to be able to setup my signup form to have only my home city.

As I do not take order or deliver outside of my home county/city, I have no need for a country field in my signup form. I'd like to remove this completely.

I am new to this so any assistance will be much appreciated.

Thanks.


Join The Code Co-op to get access to your library in the Code Co-op Forum
User avatar
burt
Core Team
Posts: 4551
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 412 times

Re: Set default city and remove country in signup form

Post by burt »

Some payment systems depend on having the Country as part of the information.
Can you please state what payment methods you are intending to use as this info would obviously change the advice ?
I am not here to build for you.
I am here to build with you. Let's help each other.
hertsflowers
Member
Posts: 9
Joined: Mon Aug 28, 2023 8:34 am
Phoenix Version: v1.0.7.18
Has thanked: 6 times

Re: Set default city and remove country in signup form

Post by hertsflowers »

burt wrote: Mon Aug 28, 2023 8:52 am Some payment systems depend on having the Country as part of the information.
Can you please state what payment methods you are intending to use as this info would obviously change the advice ?
I have cod and stripe setup for my shop at the moment. Thank you
User avatar
burt
Core Team
Posts: 4551
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 412 times

Re: Set default city and remove country in signup form

Post by burt »

Stripe requires country. Therefore, you need country, but it could be a hidden away field.

Please state which Country is your 2 letter Country ISO Code - you can get this ISO by finding your country in the country list at admin > locations > countries

The City can be pre-populated easily. Please state the name of the City.
I am not here to build for you.
I am here to build with you. Let's help each other.
hertsflowers
Member
Posts: 9
Joined: Mon Aug 28, 2023 8:34 am
Phoenix Version: v1.0.7.18
Has thanked: 6 times

Re: Set default city and remove country in signup form

Post by hertsflowers »

burt wrote: Mon Aug 28, 2023 9:08 am Stripe requires country. Therefore, you need country, but it could be a hidden away field.

Please state which Country is your 2 letter Country ISO Code - you can get this ISO by finding your country in the country list at admin > locations > countries

The City can be pre-populated easily. Please state the name of the City.
Thank you for assisting me with this. My country code is GB and my city is Bishop's Stortford.

Untitled-1.jpg
You do not have the required permissions to view the files attached to this post.
User avatar
burt
Core Team
Posts: 4551
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 412 times

Re: Set default city and remove country in signup form

Post by burt »

Download, Unzip, Upload. After Uploading, the file should be located at;

/includes/hooks/shop/create_account/cityCountry.php - anywhere else is incorrect.

When correctly uploaded, this file should pre-fill three fields [Country, State/County, City] in the create_account.php page.

ZIP REMOVED
I am not here to build for you.
I am here to build with you. Let's help each other.
hertsflowers
Member
Posts: 9
Joined: Mon Aug 28, 2023 8:34 am
Phoenix Version: v1.0.7.18
Has thanked: 6 times

Re: Set default city and remove country in signup form

Post by hertsflowers »

burt wrote: Mon Aug 28, 2023 9:36 am Download, Unzip, Upload. After Uploading, the file should be located at;

/includes/hooks/shop/create_account/cityCountry.php - anywhere else is incorrect.

When correctly uploaded, this file should pre-fill three fields [Country, State/County, City] in the create_account.php page.
Thank you so much for that. I really appreciate it. I have uploaded file as directed but see no change in my form. I am attaching snapshot of my form. It does not have a state. It only has city and country but the file you sent has a state. Could this be the issue?

Untitled-1.jpg

By the way, my version of Phoenix is CE-Phoenix-1.0.7.18
You do not have the required permissions to view the files attached to this post.
User avatar
burt
Core Team
Posts: 4551
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 412 times

Re: Set default city and remove country in signup form

Post by burt »

hertsflowers wrote: Mon Aug 28, 2023 9:55 am By the way, my version of Phoenix is CE-Phoenix-1.0.7.18
That's 2.5 years out of date, and was 20 releases ago.
We're currently at 1.0.8.20

You might like to install an up to date version before you go much further, else any advice given won't apply to your old shop.
I am not here to build for you.
I am here to build with you. Let's help each other.
hertsflowers
Member
Posts: 9
Joined: Mon Aug 28, 2023 8:34 am
Phoenix Version: v1.0.7.18
Has thanked: 6 times

Re: Set default city and remove country in signup form

Post by hertsflowers »

burt wrote: Mon Aug 28, 2023 10:05 am
hertsflowers wrote: Mon Aug 28, 2023 9:55 am By the way, my version of Phoenix is CE-Phoenix-1.0.7.18
That's 2.5 years out of date, and was 20 releases ago.
We're currently at 1.0.8.20

You might like to install an up to date version before you go much further, else any advice given won't apply to your old shop.
I know what you mean but I'd paid some chap on Fiverr to do a lot of customisation for me when I first started this project. He'd said he could only get them to run on this version, and so far all works great. So I'm happy with this. Isn't it possible to make your code work with my version? Is my version so different that this code will not work?
User avatar
burt
Core Team
Posts: 4551
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 412 times

Re: Set default city and remove country in signup form

Post by burt »

It's not ideal, because you'll always be working with older code, so when you need help, it's code most of us will have forgotten about :D

Each time you ask a question, just *ensure* to state that you are on a modified 1.0.7.18, the codebase engine from 1.0.7.18 (March 2021) to 1.0.8.20 (current release) is changed a lot.

Change the code in the that same hook file to;

Code: Select all

class hook_shop_create_account_cityCountry {
I am not here to build for you.
I am here to build with you. Let's help each other.


Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply