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 |
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
Certifications
Honor
Recognition
Contributions
Categories
- Apache (2)
- ChatGPT (1)
- Domain name (2)
- eCommerce (2)
- htaccess (1)
- Humor (3)
- Instagram API (1)
- jQuery (4)
- JSON (1)
- Linux (10)
- Magento (142)
- Magento admin (58)
- Magento Certification (5)
- Magento error (13)
- Magento frontend (68)
- Magento Imagine (2)
- Magento Interview (5)
- Magento Master (2)
- Magento2 (10)
- Mobile (1)
- MySQL (7)
- OpenAI (1)
- OroCRM (2)
- Performance (2)
- PHP (8)
- Prototype JS (3)
- Security (4)
- Wordpress (3)
- XML (2)