Hi,
I am using Magento 2.1.4 and i need to display the region code instead of fullname in the State/Province dropdown in the cart.
For Example:
California --> should be CA
Alaska -> AK
Please suggest any solution...
Solved! Go to Solution.
Hi,
Thanks for your response,
We have override the Collection.php model file in app/code by our own...
I am closing the topic here..
Best and the easiest way is to use the Magento Translate feature and update the CSV with the desired Abbreviations.
You can find more details about Magento internationalization here: http://devdocs.magento.com/guides/v2.0/frontend-dev-guide/translations/xlate.html
Hi ShoaibRehman89,
We do not need to change the each and every state for the required countries manually by csv translation....
We have tried changing the following file
From
$option['label'] = $item->getName();
To
$option['label'] = $item->getCode();
in
public function toOptionArray()
path:/vendor/magento/module-directory/Model/ResourceModel/Region/Collection.php
And is working fine, but the thing is we need to override the same from our theme...as it is core file modification.
Please suggest...