1

In the below code i am getting order status label of a the default store.But i want the store specific label.please help me .

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$orders = $objectManager->create('Magento\Sales\Model\Order')->getCollection()->addFieldToFilter('customer_id',$customerId)->setOrder(
              'created_at',
              'desc'
          )
                      'created_at',
                      'desc'
                  );

1 Answer 1

3

EDIT

In such case, you have to use \Magento\Sales\Model\ResourceModel\Order\Status\CollectionFactory which will you give the list of the status label of that store. sales_order_status table is related to that collection.

OLD

Please try with

getStatusLabel()

Also you should select the field status addFieldToFilter('status') to collection

3
  • Actually i have 2 store view one is english and another is arabic, so currently i am getting the status of default store(english).But i am not getting the label in arabic. i have added arabic in backend but not getting it.
    – christy
    May 3, 2018 at 12:02
  • have u understand what i want to tell you? Is this store label is not only comming for your code or whole website?
    – Amit Bera
    May 3, 2018 at 12:16
  • actually i need to get store specific status label using store id.
    – christy
    May 3, 2018 at 12:20

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.