Hi with the below code we can easily amke a view order link in a
magento2
$this->getUrl('sales/order/view', ['order_id' => $orderId]); // $orderId is a
entity id of a order not a increment id of a order
This blog is all about magento , php javescript ,mysql codes. In this i am trying to post the posts which i really feel to have these codes always with me and i am trying to publish most challenging codes which we need to use in daily development. I personally sometime needs to spent most of times to get the idea about these codes on net,thats why i thought to put all these codes on one place and i am trying to keep this work going on and in simple way which can help the communty
Hi with the below code we can easily amke a view order link in a
magento2
$this->getUrl('sales/order/view', ['order_id' => $orderId]); // $orderId is a
entity id of a order not a increment id of a order
$store = Mage::app()->getStore();
$product_id = "1"// change your product id here
$path = Mage::getResourceModel('core/url_rewrite') ->getRequestPathByIdPath('product/'.$product_id, $store); $url = $store->getBaseUrl($store::URL_TYPE_WEB) . $path;