Text transform for address input at checkout

  • Posts: 32
  • Thank you received: 0
  • Hikashop Business
9 years 1 month ago #217314

-- HikaShop version -- : 2.5.0
-- Joomla version -- : 3.3.6
-- PHP version -- : 5.3.29
-- Browser(s) name and version -- : Google Chrome 45.0.2454.101 m

Hi there! I'm getting crazy having three days trying to figure the following:

In the checkout process, adding a new billing address, in the fields, I need to force some fields to lowercase, uppercase and capitalize.

just I need to add

style="text-transform:capitalize|lowercase|uppercase;"
to each field.
for example:
<tr class="hikashop_billing_address_address_lastname" id="hikashop_billing_address_address_lastname" style"text-transform:capitalize;">

What exact line should I edit in the display editor or php file to do that?

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

  • Posts: 82908
  • Thank you received: 13378
  • MODERATOR
9 years 1 month ago #217316

Hi,

You should add such CSS:
#hikashop_billing_address_address_lastname{
text-transform:capitalize !important;
}

to the CSS file of your template, or to the frontend CSS of HikaShop:
www.hikashop.com/support/support/documen...ize-the-display.html

The following user(s) said Thank You: fernando.alh

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

  • Posts: 32
  • Thank you received: 0
  • Hikashop Business
9 years 1 month ago #217442

Hi there! So simple solution! One more time: THANK YOU! ;)

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

  • Posts: 2
  • Thank you received: 0
8 years 10 months ago #225307

Hi

I am trying to do the same for the postcode field.

I have some shipping methods setup with prefixes such as "SO" (uppercase) but if the customer types "So" or "so" they do not work.

The method mentioned above with CSS does not save the data as uppercase it only displays on the page as uppercase the data saved to the address remains in lowercase, is there a way to force uppercase and save to the address in uppercase?

can I add a javascript validation to the form?, or php strtoupper to convert to uppdercase on save? if so where would I do it?

I don't want to create several versions of each shipping method just to cover the variations of what the customer might type.

Thanks

Andy

Last edit: 8 years 10 months ago by awaddon.

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

  • Posts: 82908
  • Thank you received: 13378
  • MODERATOR
8 years 10 months ago #225309

Hi,

You can use the "regex check" setting of your custom post code field. You can find it when you edit your field via the menu Display>Custom fields.
There, you can enter for example:

^[0-9A-Z]+$
and that will only allow numbers and uppercase letters.

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

  • Posts: 2
  • Thank you received: 0
8 years 10 months ago #225464

Thanks Nicolas

But I don't see that setting anywhere on the page (screenshot)

Where do I need to enter it?

Thanks

Andy

Attachments:

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

  • Posts: 82908
  • Thank you received: 13378
  • MODERATOR
8 years 10 months ago #225513

Hi,

Then it means that you have an old version of HikaShop.
Update and you should see that field.

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

Time to create page: 0.081 seconds
Powered by Kunena Forum