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.

1
  • the order has a storeid which is the store where the order was created. you can get the storecode with the storemanager Aug 2, 2018 at 13:28

1 Answer 1

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 and acknowledge you have read our privacy policy.

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