cancel
Showing results for 
Search instead for 
Did you mean: 

Customer Account Information data in uppercase

Customer Account Information data in uppercase

is possible to change automatically Customer Account Information data written in lowercase to uppercase?

For example a client write is name jhon dole and i need change to Jhon Dole.

 

Regads!

20 REPLIES 20

Re: Customer Account Information data in uppercase

You could fairly easily write an observer that looks for events where that data is saved and update it using a PHP ucwords() call.   Perhaps look into the customer_save_before event.

 

Certified Plus Magento Developer | Top 50 Magento Contributor for 2017 | CEO/Founder at Jamersan | I make Magento videos at Ecommerce-aholic

Re: Customer Account Information data in uppercase

Hi,

thanks for you answer, but  could you explain in more detail how I can do this task?

Re: Customer Account Information data in uppercase

other option valid to me it´s all text in caps, how can make this task?

Re: Customer Account Information data in uppercase

Create Observer

 

Here is some info on creating the observer on the event you need.   In the observer file, just ucwords anything you need updated.  I haven't tested the code below....

 

$customer = $observer->getCustomer();

$customer->setData( 'first_name', ucwords($customer->getData('first_name'));
Certified Plus Magento Developer | Top 50 Magento Contributor for 2017 | CEO/Founder at Jamersan | I make Magento videos at Ecommerce-aholic

Re: Customer Account Information data in uppercase

If its only the display in account dashboard information you cared about, I suggest to modify template or css if possible, e.g.

<?php echo $this->htmlEscape(ucwords($this->getCustomer()->getName())) ?>

in customer/account/dashboard/info.phtml

Re: Customer Account Information data in uppercase

In case you are willing to uppercase addresses in order then this extension may help

 

https://redchamps.com/address-formatter-magento-2-extension.html

Re: Customer Account Information data in uppercase

resolved my issue blogger at : best vertical offset smoker

Re: Customer Account Information data in uppercase

Customer Account Information data in uppercase · please explain full Jugal Kishor · i want to add ucwords on my code uc word convert custome

Re: Customer Account Information data in uppercase

Thanks my issue solved with your guide for blog top rated men's face wash brands