Countries SORT ORDER & STATUS

Open to all! Ask other shopowners for help.
Post Reply
User avatar
burt
Core Team
Posts: 4561
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 422 times

Countries SORT ORDER & STATUS

Post by burt »

While I was working on that Address Manager system, I had to test that it worked well with the Countries admin page, as it is on the Countries page that shopowner assigns Address Formats so I had to make sure that any new address_format entries showed up when adding/editing a country.

While I was on the country page I thought it might be nice to add in a Sort Order feature so shopowner could put important countries at the top of the drop down list (eg on create_account.php)... and a Status feature so that shopowner can disallow creation of accounts from those disallowed countries (ie, status = off means countries won't show in the dropdown list).

Admin Side

New Sort Order Column
c1.jpg
The Sort Order allows shopowner to move important countries up the list taking them out of the usual alphabetical system. In the example above I have moved UK, AU and US to the top 3.

The Sort Order number is added/edited/deleted in the usual side column;
c2.jpg
New Status Column

The Status allows shopowner to turn off countries to which you have no interest in selling to. North Korea anyone? In the example above, I have turned off Afghanistan simply because it is near the top of the usual list so it's easier to screenshot (see "shop side" below).

The Status is changed by clicking on the red/green buttons in the country listings, this is the same system as is used when (eg) turning a product on/off.
c3.jpg
Shop Side

The Shop Side countries dropdown is populated as you have designated, applicable Sort Order & applicable Status. In the image below you will see that UK, AU and US are at the top of the list, and Afghanistan (as its status is off) is nowhere to be seen.
c5.jpg
You do not have the required permissions to view the files attached to this post.


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

Re: Countries SORT ORDER & STATUS

Post by burt »

And the absolute beauty of Phoenix is that ALL of this is done with no core code changes.

Hopefully this thread can help to illustrate that it is relatively simple to bend core code to your needs, whilst also not actually touching/changing core code!

This "no touch core code, but still be able to change how core works" has taken so much code effort to get into place, but here we are - amazing system - one of the (if not THE) most flexible shopping cart system currently available is in your hands.


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