Woocommerce Check-out Customer Condition - wordpress

On the checkout page in woocommerce, I have provided a distinction between provinces and districts, but when the customer chooses the district, I want to assign an ID that I have previously specified to the database. I want it to print the county directly in the form of a string. Where do I write the if?
Example -> billing_adress (Okayama) to i want database write Customer country (OK8299)
Briefly; I want to register in customer country with a different ID. Not with the country name. How can i do?
Please help me thank you
Database Screenshot suit_wc_customer_lookup
As you can see, "seyhan" is writing. I want instead of "TR.00100TR". I want to complete this data by putting in excel and if else. I would be very happy if you help. For example, if Seyhan is city TR.00100TR, if Ceyhan is city TR.00102TR.
Thanks

Related

Merge ACF fields into another ACF field

I'm building an athlete profile database using ACF (Advanced Custom Fields). I have fields for First Name, Last Name, and Full Name. Athletes will be able to enter their first and last names on the front end of the website when they are creating a profile. I don't want them to enter their full name also because that's a bad user experience. But I need the full name on the backend. Is there a way to have the Full Name text field auto-generated by merging the values of First Name and Last Name? I don't want to enter the full name manually. Thanks!
with this kind of thing you are wanting to combine 2 fields into 1 record it may just be easier to ask for the full name in 1 field this is not a bad user experience as much as you may think more people actually find it more annoying needing to put different parts of there name in different boxes.
However if this is what you are wanting to move forward with I did find this which may be of some assistance Wordpress/ACF merging multiple fields value to one

Metabox Geolocation Extension: How to dynamically update Restriction based on users country selection

Meta Box Extension: Geolocation
I need to make the country restriction dynamically updated through user selection of a select dropdown containing the country iso2 values. I've tried to find any documentation that is similar to what I'm aiming for, but by far no luck.
There is no support forum as well for the plugin + extension that seems to have the answer or example that I'm looking for.
Basically what I wanna do is:
User selects a country (ie: United States) -> The expected result is the address field will limit the addresses to those in US only.

Conditional Logic for getting a list of sub categories in ACF

I am creating a business listings and Advanced Custom Field (ACF) helps me to create the backend form.
The question is, how do I get the sub category of a main category only if I set the condition.
For example,
I have 100s of City names as City Taxonomy
I have 100s of Area names as sub category of the City Taxonomy
I have created a form that includes these 2 fields.
City:_________ (Drop down selection of City Taxonomy)
Area Name:_______ (I want this sub category drop down to show up based on City selection above)
Is this possible? Or does it require coding to make it work?
I have searched enough and I could not find even a premium plugins to support this.
I can simply set these 2 fields to pull data from City Taxonomy but the data entry becomes very tough with hyphen appearing before sub-city Taxonomies and possible duplicate value under different city.
Thanks in advance.

MS Access Query matching month from two date fields

I'm new to Access and am trying to figure out the best way to write a query. I have a table that tracks security entry information for each employee which has an Employee ID field and a date field [ENTRYDATE]. Another table (tblSPACE) lists out where that employee sits and is updated each month with new information. There is a field in tblSPACE which tracks what month the information is from. [ASOFMONTHYEAR]. These two tables are related by a unique employee ID number. What I want to do is have a query that shows the entry information and the corresponding seat that that employee was in for that month. I'm thinking I need to add a criteria into one of the date fields to have it match the month of the other date field? Something like Where Month(tblSpace.ASOFMONTHYEAR) = Month(tblEntry.ENTRYDATE). But of course that doesn't work. Any guidance on how I should go about this? Sorry if I've not explained this well.

Submitting form custom module

I have a question regarding drupal 6 forms.
I have 4 tables:
location[locationid, name];
package[packageid, name],
person[personid, name, locationid, address, etc...]
pickup[pickupid, personid, packageid, locationid, _pickup_day_,...].
I've made forms and form_submit for the three tables: location, package, person (simple CRUD as usual).
Now, I want to make a form to submit data into the "pickup" table. The twist is, the only
data the user needs to input is the "pickup_day" field, which can be 1 or 0 (monday or tuesday).
So I imagine when I go to the pickups url, I'll see a list of output fields:
firstname | lastname | location | pickup day | package type
first1 last1 church1 select box (monday/tuesday) select box (type1/type2/type3)
first2 last2 church1 select box (monday/tuesday) select box (type1/type2/type3)
first3 last3 church1 select box (monday/tuesday) select box (type1/type2/type3)
[submit button]
When its submitted, the data goes into "pickup" table.
I'm trying to figure how to render the select boxes while outputting person's information.
(Just an aside, would it be possible to have a search before seeing the form...for example I search for
location to be church1, then I'll see all the users at that location in a form as above)
All help is very much appreciated...even pointing to a module that does something similar to this is fine...
I just need to get some hints on how people have approached this. Much thanks!
End goal:
So, basically, I have a number of people in my database. Each person is assigned a location where they can go and pickup food. I want to record each pickup for each week for each person. So I have a pickups table to do that. So I'm trying to make a single form (pickups), where I can go to and update who picked up what...on what day (Monday or Tuesday). But so in this form, I need to show all the people registered for a particular location. So lets say a person is registered for a church called Church 1...I want to search for the Church 1 location, then all the people who are registered for that location comes up row by row. Then I can select which day each person picked up food and what type of food they picked up...and click submit. Then I'll run a query against my database to add this information.
The big deal I guess is that instead of making a form for each person (for each row), I just make one form and when the form is submitted everyone will be added to the "pickup" table with the appropriate day and item they picked up.
I would suggest you look at the form API's built-in AHAH support. You can find more information here: http://api.drupal.org/api/drupal/developer--topics--forms_api_reference.html/6#ahah. Assuming I understand your question correctly, this is a fairly typical ajax/ahah form situation; an element in your form triggers the creation of new form elements.
For example, you can create a select box of locations. Once a location is selected (#ahah['event'] => 'change'), you can make a callback to a menu location (#ahah['path'] => path/to/callback) which can generate the new form elements to add, in this case select boxes for the persons and/or packages associated with that location.
You could also do something similar using search instead of a select element.

Resources