Required filed not being enforced upon checkout.

  • Posts: 30
  • Thank you received: 2
6 years 4 months ago #283176

-- HikaShop version -- : 3.2.1
-- Joomla version -- : 3.8.2
-- PHP version -- : 7.0.25
-- Browser(s) name and version -- : Firefox 57.0

Greetings.

We are located in the United States.

One of our clients is in Florida. It must therefore remit both state and local taxes.The local taxes are county taxes.

We modified the Hikashop setup by changing the country to be a US state and the State to be a Florida county on our site. Our issue is not with the tax, but with making the State and county fields required without a Default value.

Our configuration in the backend displays State and Local fields are required fields.

At first, people were neglecting to select the proper County since by default the system kept the first alphabetic County as a selection (that created the wrong tax amount for the customer)

So we thought best to have "**select your state" or "**select your county if in FL" in the zones under the Country and State. So, we created those entries, and now that is the first thing they see. Doing so created another issue. The required field was being bypassed by having the selection of "**select your state" or "**slect your county if in FL." since they were the default value options.

Now the customer can checkout without proper State or Local values selected and tax applied.

A recent order cought our attention when a customer was able to process their order without selecting the County and therefore the additional local tax was not applied.

In summary: During checkout, if a client selects Florida for an address, a required field of a county must be selected to complete the order apply the porper taxes then process the payment. We have the field set to be required, but that requirment is not being enforced becaus the default value we have is "**select your county if in FL" that is making the the system recognize the field as filled already.

Thus my succinct question: Any ideas on how to make that field required but without a default value so that it alerts the customer they must select a county when Florida is selected as the state?

Thank you for your help is this matter.

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 81513
  • Thank you received: 13068
  • MODERATOR
6 years 4 months ago #283182

Hi,

We actually have a specific option in the zone custom fields that you can activate in order to display a "please select" choice which will enforce the "required" requirement of the custom field. That option is called "Add a 'Please select' value".
So just activate it for both of your custom fields and it should work like you want without the need for an extra "please select" zone or anything.

Please Log in or Create an account to join the conversation.

  • Posts: 30
  • Thank you received: 2
6 years 4 months ago #283239

Thank you so much Nicolas for your quick reply!

I removed the extra "Please select" that I added previously. I activated "Add a 'Please select' value" in the custom filed per your instructions. The fields now display better on the front end. However, when I chose Florida it still allowed me to proceed with my order without enforcing the required filed for the county to add the taxes.
The state selection is enforced, but the county selection when choosing Florida or Canda is not being enforced.

I would appreciate your further thoughts on this.

The site is www.tokeshoes.com

With kind regards,

Nadine

Please Log in or Create an account to join the conversation.

  • Posts: 30
  • Thank you received: 2
6 years 4 months ago #283240
Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 81513
  • Thank you received: 13068
  • MODERATOR
6 years 4 months ago #283309

Hi,

Thank you for the details.

Remove the code:

if($field->field_required && @$field->field_options['zone_type'] == 'state')
			return true;
from the file administrator/components/com_hikashop/classes/field.php and that will fix the problem.

The following user(s) said Thank You: solia

Please Log in or Create an account to join the conversation.

  • Posts: 30
  • Thank you received: 2
6 years 4 months ago #283322

That worked perfectly. Thank you so much for the fix and the awesome support!

Nadine

Please Log in or Create an account to join the conversation.

Time to create page: 0.070 seconds
Powered by Kunena Forum