1

After order status change in observer I am getting data of the order.

Now I want to get the URL of the site from where order is placed.

Like if main store then - www.example.com

if french store view then - www.example.com/fr

Please help me with this.

  • the order has a storeid which is the store where the order was created. you can get the storecode with the storemanager – Philipp Sander Aug 2 '18 at 13:28
0
   public $_storeManager;
  public function __construct(
      \Magento\Store\Model\StoreManagerInterface $storeManager,
       .....
    ) {
       ...
  $this->_storeManager=$storeManager;
    }


    $this->_storeManager->getStore()->getBaseUrl()

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.