Error: Call to a member function getStoreId() on null in /Users/mac14/Sites/cleanlinesurf-upgrade/app/code/Fooman/PdfCustomiser/Block/AbstractSalesDocument.php:180
I’m getting this error on print Invoice from Action dropdown in Sales>Orders on admin side. Here is the code:
$storeId = $this->getSalesObject()->getStoreId();
if ($storeId === null) {
$store = $this->_storeManager->getDefaultStoreView();
$storeId = $store->getId();
}
return $storeId;
2
Answers
Try injecting
Then use
Try this code: