In this post I am going to explain how to get state details by id in PrestaShop 1.7.
// Your State Id
$id_state = 8;
// Load State object
$state = new State((int) $id_state);
// Validate State object
if (Validate::isLoadedObject($state)) {
// Get State Name
echo $state->name;
// Get State ISO Code
echo $state->iso_code;
// Get State Country ID
echo $state->id_country;
// Print State Object
echo "<pre>";
print_r($state);
echo "</pre>";
}
Write an article about ecommerce that help people to grow their ecommerce business. You’ll find best ecommerce guide, news, tips & more!



Leave a Reply