I want to change the order of shipping address like "name" , "last name" , "address" how will i do it in magento 2 admin panel.
-
1There's no way to do it with admin configurations, you have to create a custom module/template and change some xml. You want to change it in guest checkout, in customer panel or both?– lpFranzCommented Jul 18, 2018 at 19:51
-
i just want to change it from admin view , how can i do it ?– Wahaj MoinCommented Jul 19, 2018 at 7:41
Add a comment
|
1 Answer
Sadly this can't be done from admin view.
You need to create a module, here you can find how.
In that module you need to create a plugin for the LayoutProcessor. In there you can change the order of fields by using the following code.
/**
* @param \Magento\Checkout\Block\Checkout\LayoutProcessor $subject
* @param array $jsLayout
* @return array
*/
public function aroundProcess(
\Magento\Checkout\Block\Checkout\LayoutProcessor $subject,
\Closure $proceed,
array $jsLayout
)
{
$jsLayoutResult = $proceed($jsLayout);
if ($this->getQuote()->isVirtual()) {
return $jsLayoutResult;
}
&$jsLayoutResult['components']['checkout']['children']['steps']['children']['shipping-step']['children']['shippingAddress']['children']['shipping-address-fieldset']['children']['telephone']['sortOrder'] = 122;
return $jsLayoutResult;
}
Hope this helps.