The following query returns information about the URL containing cipla-product.html Query the URL’s information Request: { urlResolver(url: “cipla-product.html”) { entity_uid relative_url redirectCode type } } Response: { “data”: { “urlResolver”: { “entity_uid”: “MQ==”, “relative_url”: “joust-duffle-bag.html”, “redirectCode”: 0, “type”: “PRODUCT” } } }

$urlInterface = \Magento\Framework\App\ObjectManager::getInstance() ->get(\Magento\Framework\UrlInterface::class); $currentUrl = $urlInterface->getCurrentUrl(); Example: private $urlInterface; public function __construct( … \Magento\Framework\UrlInterface $urlInterface … ) { $this->urlInterface = $urlInterface; } public function getCurrentUrl() { return $this->urlInterface->getCurrentUrl(); }

In order to add 301 redirect in Magento 2 take the following steps: 1. Go to Admin Panel > Marketing > SEO& Search > URL Rewrites. Magento 2 301 Redirect 2. Then press the Add URL Rewrite button. (Add URL Rewrite) 3. Enter URL Rewrite Information Choose “Custom” in the Create URL Rewrite select box. Choose the store view pesklevu the URL Rewrite to be added to in the Store field. Set the path you…

you can add this code in your .xml file <fieldset name=”address”> … <field name=”country_id”> <argument name=”data” xsi:type=”array”> <item name=”options” xsi:type=”object”>Magento\Directory\Model\ResourceModel\Country\Collection</item> <item name=”config” xsi:type=”array”> <item name=”label” xsi:type=”string” translate=”true”>Country</item> <item name=”formElement” xsi:type=”string”>select</item> <item name=”sortOrder” xsi:type=”number”>100</item> <item name=”source” xsi:type=”string”>address</item><!– fieldset name –> <item name=”dataScope” xsi:type=”string”>country</item><!– ‘country’ – db table column name where country code is saved –> <item name=”validation” xsi:type=”array”> <item name=”required-entry” xsi:type=”boolean”>true</item> </item> </item> </argument> </field> <field name=”region_id”> <argument name=”data” xsi:type=”array”> <item name=”options” xsi:type=”object”>Magento\Directory\Model\ResourceModel\Region\Collection</item> <item name=”config” xsi:type=”array”>…

Faster PHP Cloud Hosting