Browsing articles tagged with "state Archives - Kalpesh Mehta"
Jun 25, 2014
kalpesh

Magento get State Code, ID, Name from Region ID

Magento get state name, ID, code from region ID or region code.

Get state code from state id

$region = Mage::getModel('directory/region')->load(12);
$state_code = $region->getCode(); //CA

Get state name from state id

$region = Mage::getModel('directory/region')->load(12);
$state_name = $region->getName(); //California

Get state id from state code

$region = Mage::getModel('directory/region')->loadByCode('CA', 'US');
$state_id = $region->getId(); //12
Apr 21, 2012
kalpesh

Magento: Difference between order states and statuses

If you are building website in Magento, you may have noticed that there are two columns in sales_flat_order table which are confusing. These are state and status. You might think what is the difference between these two, both having same meaning.

Well, this is not the case. They both are different. State is used by magento to tell if the order is new, processing, complete, holded, closed, canceled, etc.; while Statuses are the one that YOU would be defining at the backend in System -> Order Statuses. Magento displays order STATUSES and not STATES in the backend order detail page to let you know which status is assigned as per your mapping. Remember, multiple statuses can be mapped with one state, while vice versa is not possible. Continue reading »

Welcome to my Blog

Kalpesh MehtaHelping Magento developers in their day-to-day development problems since 2011. Most of the problems and solutions here are my own experiences while working on different projects. Enjoy the blog and don't forget to throw comments and likes/+1's/tweets on posts you like. Thanks for visiting!

Certifications

Honor

Recognition

Magento top 50 contributors

Magento top 50 contributors

Contributions