1

I want to show state drop down in phtml file in magento2

I have a country code

<?php $countryBlock = $block->getLayout()- 
 >createBlock('Magento\Directory\Block\Data');?>
            <?= $countryBlock->getCountryHtmlSelect($defValue = null, 
  $name = 'country_id', $id = 'country', $title = 'Country');?>

this shows the country name now i want to show state name also

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.