Page 1 of 2

Set default city and remove country in signup form

Posted: Mon Aug 28, 2023 8:43 am
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.

Re: Set default city and remove country in signup form

Posted: Mon Aug 28, 2023 8:52 am
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 ?

Re: Set default city and remove country in signup form

Posted: Mon Aug 28, 2023 8:57 am
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

Re: Set default city and remove country in signup form

Posted: Mon Aug 28, 2023 9:08 am
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.

Re: Set default city and remove country in signup form

Posted: Mon Aug 28, 2023 9:13 am
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

Re: Set default city and remove country in signup form

Posted: Mon Aug 28, 2023 9:36 am
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

Re: Set default city and remove country in signup form

Posted: Mon Aug 28, 2023 9:55 am
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

Re: Set default city and remove country in signup form

Posted: Mon Aug 28, 2023 10:05 am
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.

Re: Set default city and remove country in signup form

Posted: Mon Aug 28, 2023 10:09 am
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?

Re: Set default city and remove country in signup form

Posted: Mon Aug 28, 2023 10:21 am
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 {