Skip to main content
14 votes

Magento 2 - State/Province dropdown and Country Dropdown in Contact form

Following method will add Country and Region dropdown to contact us form, [namespace]/[modulename]/etc/di.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-...
Ekta Puri's user avatar
  • 1,116
9 votes
Accepted

Magento2 where state/regions are stored

In magento region is not saved in xml it's stored in database table named directory_country_region
Murtuza Zabuawala's user avatar
4 votes
Accepted

Removing various states/provinces from shipping but not billing address

It is possible to change it in the checkout for example create these module files Block/Checkout/LayoutProcessor.php <?php namespace Vendor\Module\Block\Checkout; use Magento\Directory\Helper\...
Mr. Lewis's user avatar
  • 1,931
3 votes
Accepted

Magento2 : What is the difference between Order Status And Order State

The order state and order status are usually mixed up since their names and functions are similar. An order state is a position of an order in the current processing flow. Magento has the following ...
Dhiren Vasoya's user avatar
3 votes
Accepted

How to get USA states dropdown list magento2 custom phtml

Add following code in your block class <?php ... private $directoryData; public function __construct( ... \Magento\Directory\Block\Data $directoryData ... ...
Dinesh Yadav's user avatar
  • 6,457
3 votes
Accepted

Getting status from object returns different value compared to var_dump

This is because getStatus() of order items (this is what your collection returns!) is an actual method and not a magic getter: public function getStatus() { return $this->getStatusName($this-&...
Fabian Schmengler's user avatar
2 votes

Change from frontend area to adminhtml area

That’s because of the following guard clause #File: vendor/magento/framework/App/State.php public function setAreaCode($code) { if (isset($this->_areaCode)) { throw new ...
Ravi Oza's user avatar
  • 478
2 votes

Magento: How to remove certain States from state/region list at Checkout or registration?

Magento 1.9.2 Step 1: Copy file from: app/code/core/Mage/Directory/Helper/Data.php to: app/code/local/Mage/Directory/Helper/Data.php Step 2: Override _getRegions($storeId) method of ...
gundam japan's user avatar
2 votes

What are the definitions of the order statuses? OR: Where should I integrate my order state?

The different order states are defined in Mage_Sales_Model_Order: const STATE_NEW = 'new'; const STATE_PENDING_PAYMENT = 'pending_payment'; const STATE_PROCESSING = 'processing'; ...
Stefan's user avatar
  • 1,507
2 votes

Magento2 : What is the difference between Order Status And Order State

The “order state” and “order status” are usually mixed up since their names and functions are quite similar. 1,Order Status. All orders have an order status that is associated with a stage in the ...
junaidh's user avatar
  • 63
1 vote
Accepted

How to show abbreviations of State/Province instead of Full names in Magento 2

I am overriding code as per requirement that is working so please check the below change. first created a new module so please check all below step. Created a new file registration.php /var/www/html/...
mohit vamja's user avatar
1 vote

Change Active filter position Magento 2

Please add the below code in your custom module : app/code/Vendor/Module/view/frontend/layout/catalog_catagory_view_type_layered.xml <?xml version="1.0"?> <!-- /** * Copyright © ...
Grazitti Dev's user avatar
1 vote

How to get USA states dropdown list magento2 custom phtml

$objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $regionFactory = $objectManager->create('Magento\Directory\Model\ResourceModel\Region\CollectionFactory')->create(); $...
Vithal Bariya's user avatar
1 vote

Magento2 : What is the difference between Order Status And Order State

The order status is just a label for the order state. It doesn't represent any logic or workflow. You could even assign the "status" closed for pending payments. If you have PayPal, CC and Checkmo ...
Mage2 Habibi's user avatar
1 vote

Magento 2 system configuration state multiselect dropdown

1.If you need multi-select field at the system.xml of all country list then add the filed just like below in your group. <field id="address_country_id" translate="label comment" type="...
Rasik Miyani's user avatar
1 vote
Accepted

Magento 2 : How to change state list for USA?

This issue has already been asked and resolved here - How to change state list for USA in Magento 2? Quoting it for your reference; You can filter out the options using a Plugin for the ...
Vivek Kumar's user avatar
  • 5,665
1 vote

Change from frontend area to adminhtml area

You can also try to emulate adminhtml area code by using emulateAreaCode from Magento\Framework\App\State . Check this class implementation as reference: Magento\Widget\Controller\Adminhtml\Widget\...
George M's user avatar
  • 601
1 vote

Required State not working in Checkout

This appears to be a core bug, you can view the info on the ticket raised here. Magento say: This issue has been delivered to 2.1.3, 2.0.10 as well as 2.2.0 But other people say this is not the ...
Ben Crook's user avatar
  • 15.7k
1 vote

Removing various states/provinces from shipping but not billing address

If you want to remove from shipping and billing adress form, you can try this code namespace Vendor\CheckoutScripts\Block\Checkout; use Magento\Checkout\Block\Checkout\LayoutProcessorInterface; ...
omelandr's user avatar
  • 1,267
1 vote
Accepted

Custom order status not working like magento predefined order status

There was state issue use default state new and set your status on that backorders $order->setData('state', 'new'); $order->setStatus('backorders'); $history = $order->...
Qaisar Satti's user avatar
  • 32.5k
1 vote
Accepted

Magento 2: What is purpose of StateInterface & when to use?

Those functions are set/change the status of In-line translation. public function suspend($status = false) { if ($this->storedStatus === null) { $this->storedStatus = $this->...
Krishna ijjada's user avatar
1 vote

Magento 2 - State/Province dropdown and Country Dropdown in Contact form

In Phtml <div class="field company required"> <label class="label" for="company"><span><?php echo __('Company') ?></span></label> ...
eswar's user avatar
  • 103

Only top scored, non community-wiki answers of a minimum length are eligible