0

My Code is

$_obj = \Magento\Framework\App\ObjectManager::getInstance();
$category = $_obj->create('Magento\Catalog\Model\Category')->load($cat_id);
$fullCategoryPath = $category->getImageUrl();
echo $fullCategoryPath;

It is working for some categories and not working for some categories. But both have category image.

  • are the images set in the correct scope? – Philipp Sander Feb 19 at 9:43
  • yes, echo $category->getImage(); this code return also blank for some categies. – dev dev Feb 19 at 9:45
  • I'm talking about store-scope – Philipp Sander Feb 19 at 9:53
  • Please post the solution at the answer section – Amit Bera Feb 19 at 10:07
  • @AmitBera it was a configuration error on OPs side. no need to post an answer – Philipp Sander Feb 19 at 10:24

Your Answer

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

Browse other questions tagged or ask your own question.