Enterprise Magento2.3.2 Unable to get Category Image Url ProgrammaticallyCategory image is not getting displayed in top navigation menu after Block overrideProduct Category Thumbnail Image Not Workingsome category image not showing magento 2Magento 2.3: category image gets overwrittenHow to get category image based on category ID?Category Image Not Showing on frontend in magento2view image magento 2.3.2 after import with magmi 7.23 of product with url
Number of matrices with bounded products of rows and columns
A curiosity on a first three natural numbers
Earliest evidence of objects intended for future archaeologists?
Chess software to analyze games
What causes burn marks on the air handler in the attic?
Repurpose telephone line to ethernet
Is there such a thing as too inconvenient?
Starships without computers?
Playing a fast but quiet Alberti bass
Are there any OR challenges that are similar to kaggle's competitions?
Can I check a small array of bools in one go?
awkward stretchy fingering
Saying something to a foreign coworker who uses "you people"
Can 'in-' mean both 'in' and 'no'?
Can I submit a paper computer science conference using an alias if using my real name can cause legal trouble in my original country
Why should I pay for an SSL certificate?
Radix2 Fast Fourier Transform implemented in C++
Would it be illegal for Facebook to actively promote a political agenda?
What is the evidence on the danger of feeding whole blueberries and grapes to infants and toddlers?
Meaning of words заштырить and отштырить
Metal that glows when near pieces of itself
When does The Truman Show take place?
Output with the same length always
Why don't politicians push for fossil fuel reduction by pointing out their scarcity?
Enterprise Magento2.3.2 Unable to get Category Image Url Programmatically
Category image is not getting displayed in top navigation menu after Block overrideProduct Category Thumbnail Image Not Workingsome category image not showing magento 2Magento 2.3: category image gets overwrittenHow to get category image based on category ID?Category Image Not Showing on frontend in magento2view image magento 2.3.2 after import with magmi 7.23 of product with url
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
<?php
namespace VendorModuleControllerIndex;
use MagentoFrameworkAppActionAction;
use MagentoFrameworkControllerResultJsonFactory;
use MagentoFrameworkAppActionContext;
use MagentoFrameworkViewResultPageFactory;
class Index extends Action
protected $resultJsonFactory;
/**
* @var MagentoCatalogHelperCategory
*/
protected $categoryHelper;
/**
* @var MagentoCatalogModelCategoryRepository
*/
protected $categoryRepository;
protected $resultPageFactory;
public function __construct(Context $context,
JsonFactory $jsonFactory,
MagentoCatalogHelperCategory $categoryHelper,
MagentoCatalogModelCategoryRepository $categoryRepository,
PageFactory $pageFactory)
$this->resultJsonFactory = $jsonFactory;
$this->categoryHelper = $categoryHelper;
$this->categoryRepository = $categoryRepository;
$this->resultPageFactory = $pageFactory;
parent::__construct($context);
public function execute()
$selectedCatId = $this->getRequest()->getParam('subCatId');
$categoryObj = $this->categoryRepository->get($selectedCatId);
var_dump($categoryObj->getImageUrl());
exit;
I have set the image in admin for category Id: 358:
Below is the output of print_r($categoryObj->getData());
<pre>Array(
[entity_id] => 358
[attribute_set_id] => 12
[parent_id] => 2
[created_at] => 2019-08-05 11:43:07
[updated_at] => 2019-08-05 12:08:06
[path] => 1/2/358
[position] => 22
[level] => 2
[children_count] => 34
[row_id] => 358
[created_in] => 1
[updated_in] => 2147483647
[store_id] => 1
[abacos_codigo] =>
[abacos_codigo_pai] =>
[all_children] =>
[automatic_sorting] =>
[available_sort_by] =>
[category_zone] =>
[children] =>
[custom_apply_to_products] => 0
[custom_design] =>
[custom_design_from] =>
[custom_design_to] =>
[custom_layout_update] =>
[custom_use_parent_settings] => 0
[default_sort_by] =>
[description] =>
[display_mode] => PRODUCTS
[filter_price_range] =>
[hide_desktop] => 0
[image] =>
[include_in_menu] => 0
[is_active] => 1
[is_anchor] => 0
[landing_page] =>
[meta_description] =>
[meta_keywords] =>
[meta_title] =>
[mobile_img] =>
[name] => Start
[nav-image] =>
[page_layout] => category-full-width
[path_in_store] =>
[thumbnail] =>
[url_key] => start
[url_path] => start
[weltpixel_category_url] =>
[weltpixel_category_url_newtab] => 0
[weltpixel_mm_bottom_block] =>
[weltpixel_mm_bottom_block_cms] =>
[weltpixel_mm_bottom_block_type] => none
[weltpixel_mm_columns_number] => 4
[weltpixel_mm_column_width] => auto
[weltpixel_mm_display_mode] => sectioned
[weltpixel_mm_left_block] =>
[weltpixel_mm_left_block_cms] =>
[weltpixel_mm_left_block_type] => none
[weltpixel_mm_mob_hide_allcat] => 0
[weltpixel_mm_right_block] =>
[weltpixel_mm_right_block_cms] =>
[weltpixel_mm_right_block_type] => none
[weltpixel_mm_top_block] =>
[weltpixel_mm_top_block_cms] =>
[weltpixel_mm_top_block_type] => none
)
magento2.3.2 category-image
add a comment |
<?php
namespace VendorModuleControllerIndex;
use MagentoFrameworkAppActionAction;
use MagentoFrameworkControllerResultJsonFactory;
use MagentoFrameworkAppActionContext;
use MagentoFrameworkViewResultPageFactory;
class Index extends Action
protected $resultJsonFactory;
/**
* @var MagentoCatalogHelperCategory
*/
protected $categoryHelper;
/**
* @var MagentoCatalogModelCategoryRepository
*/
protected $categoryRepository;
protected $resultPageFactory;
public function __construct(Context $context,
JsonFactory $jsonFactory,
MagentoCatalogHelperCategory $categoryHelper,
MagentoCatalogModelCategoryRepository $categoryRepository,
PageFactory $pageFactory)
$this->resultJsonFactory = $jsonFactory;
$this->categoryHelper = $categoryHelper;
$this->categoryRepository = $categoryRepository;
$this->resultPageFactory = $pageFactory;
parent::__construct($context);
public function execute()
$selectedCatId = $this->getRequest()->getParam('subCatId');
$categoryObj = $this->categoryRepository->get($selectedCatId);
var_dump($categoryObj->getImageUrl());
exit;
I have set the image in admin for category Id: 358:
Below is the output of print_r($categoryObj->getData());
<pre>Array(
[entity_id] => 358
[attribute_set_id] => 12
[parent_id] => 2
[created_at] => 2019-08-05 11:43:07
[updated_at] => 2019-08-05 12:08:06
[path] => 1/2/358
[position] => 22
[level] => 2
[children_count] => 34
[row_id] => 358
[created_in] => 1
[updated_in] => 2147483647
[store_id] => 1
[abacos_codigo] =>
[abacos_codigo_pai] =>
[all_children] =>
[automatic_sorting] =>
[available_sort_by] =>
[category_zone] =>
[children] =>
[custom_apply_to_products] => 0
[custom_design] =>
[custom_design_from] =>
[custom_design_to] =>
[custom_layout_update] =>
[custom_use_parent_settings] => 0
[default_sort_by] =>
[description] =>
[display_mode] => PRODUCTS
[filter_price_range] =>
[hide_desktop] => 0
[image] =>
[include_in_menu] => 0
[is_active] => 1
[is_anchor] => 0
[landing_page] =>
[meta_description] =>
[meta_keywords] =>
[meta_title] =>
[mobile_img] =>
[name] => Start
[nav-image] =>
[page_layout] => category-full-width
[path_in_store] =>
[thumbnail] =>
[url_key] => start
[url_path] => start
[weltpixel_category_url] =>
[weltpixel_category_url_newtab] => 0
[weltpixel_mm_bottom_block] =>
[weltpixel_mm_bottom_block_cms] =>
[weltpixel_mm_bottom_block_type] => none
[weltpixel_mm_columns_number] => 4
[weltpixel_mm_column_width] => auto
[weltpixel_mm_display_mode] => sectioned
[weltpixel_mm_left_block] =>
[weltpixel_mm_left_block_cms] =>
[weltpixel_mm_left_block_type] => none
[weltpixel_mm_mob_hide_allcat] => 0
[weltpixel_mm_right_block] =>
[weltpixel_mm_right_block_cms] =>
[weltpixel_mm_right_block_type] => none
[weltpixel_mm_top_block] =>
[weltpixel_mm_top_block_cms] =>
[weltpixel_mm_top_block_type] => none
)
magento2.3.2 category-image
try print_r($categoryObj->getImageUrl());
– Shafeel Sha
Aug 8 at 8:28
add a comment |
<?php
namespace VendorModuleControllerIndex;
use MagentoFrameworkAppActionAction;
use MagentoFrameworkControllerResultJsonFactory;
use MagentoFrameworkAppActionContext;
use MagentoFrameworkViewResultPageFactory;
class Index extends Action
protected $resultJsonFactory;
/**
* @var MagentoCatalogHelperCategory
*/
protected $categoryHelper;
/**
* @var MagentoCatalogModelCategoryRepository
*/
protected $categoryRepository;
protected $resultPageFactory;
public function __construct(Context $context,
JsonFactory $jsonFactory,
MagentoCatalogHelperCategory $categoryHelper,
MagentoCatalogModelCategoryRepository $categoryRepository,
PageFactory $pageFactory)
$this->resultJsonFactory = $jsonFactory;
$this->categoryHelper = $categoryHelper;
$this->categoryRepository = $categoryRepository;
$this->resultPageFactory = $pageFactory;
parent::__construct($context);
public function execute()
$selectedCatId = $this->getRequest()->getParam('subCatId');
$categoryObj = $this->categoryRepository->get($selectedCatId);
var_dump($categoryObj->getImageUrl());
exit;
I have set the image in admin for category Id: 358:
Below is the output of print_r($categoryObj->getData());
<pre>Array(
[entity_id] => 358
[attribute_set_id] => 12
[parent_id] => 2
[created_at] => 2019-08-05 11:43:07
[updated_at] => 2019-08-05 12:08:06
[path] => 1/2/358
[position] => 22
[level] => 2
[children_count] => 34
[row_id] => 358
[created_in] => 1
[updated_in] => 2147483647
[store_id] => 1
[abacos_codigo] =>
[abacos_codigo_pai] =>
[all_children] =>
[automatic_sorting] =>
[available_sort_by] =>
[category_zone] =>
[children] =>
[custom_apply_to_products] => 0
[custom_design] =>
[custom_design_from] =>
[custom_design_to] =>
[custom_layout_update] =>
[custom_use_parent_settings] => 0
[default_sort_by] =>
[description] =>
[display_mode] => PRODUCTS
[filter_price_range] =>
[hide_desktop] => 0
[image] =>
[include_in_menu] => 0
[is_active] => 1
[is_anchor] => 0
[landing_page] =>
[meta_description] =>
[meta_keywords] =>
[meta_title] =>
[mobile_img] =>
[name] => Start
[nav-image] =>
[page_layout] => category-full-width
[path_in_store] =>
[thumbnail] =>
[url_key] => start
[url_path] => start
[weltpixel_category_url] =>
[weltpixel_category_url_newtab] => 0
[weltpixel_mm_bottom_block] =>
[weltpixel_mm_bottom_block_cms] =>
[weltpixel_mm_bottom_block_type] => none
[weltpixel_mm_columns_number] => 4
[weltpixel_mm_column_width] => auto
[weltpixel_mm_display_mode] => sectioned
[weltpixel_mm_left_block] =>
[weltpixel_mm_left_block_cms] =>
[weltpixel_mm_left_block_type] => none
[weltpixel_mm_mob_hide_allcat] => 0
[weltpixel_mm_right_block] =>
[weltpixel_mm_right_block_cms] =>
[weltpixel_mm_right_block_type] => none
[weltpixel_mm_top_block] =>
[weltpixel_mm_top_block_cms] =>
[weltpixel_mm_top_block_type] => none
)
magento2.3.2 category-image
<?php
namespace VendorModuleControllerIndex;
use MagentoFrameworkAppActionAction;
use MagentoFrameworkControllerResultJsonFactory;
use MagentoFrameworkAppActionContext;
use MagentoFrameworkViewResultPageFactory;
class Index extends Action
protected $resultJsonFactory;
/**
* @var MagentoCatalogHelperCategory
*/
protected $categoryHelper;
/**
* @var MagentoCatalogModelCategoryRepository
*/
protected $categoryRepository;
protected $resultPageFactory;
public function __construct(Context $context,
JsonFactory $jsonFactory,
MagentoCatalogHelperCategory $categoryHelper,
MagentoCatalogModelCategoryRepository $categoryRepository,
PageFactory $pageFactory)
$this->resultJsonFactory = $jsonFactory;
$this->categoryHelper = $categoryHelper;
$this->categoryRepository = $categoryRepository;
$this->resultPageFactory = $pageFactory;
parent::__construct($context);
public function execute()
$selectedCatId = $this->getRequest()->getParam('subCatId');
$categoryObj = $this->categoryRepository->get($selectedCatId);
var_dump($categoryObj->getImageUrl());
exit;
I have set the image in admin for category Id: 358:
Below is the output of print_r($categoryObj->getData());
<pre>Array(
[entity_id] => 358
[attribute_set_id] => 12
[parent_id] => 2
[created_at] => 2019-08-05 11:43:07
[updated_at] => 2019-08-05 12:08:06
[path] => 1/2/358
[position] => 22
[level] => 2
[children_count] => 34
[row_id] => 358
[created_in] => 1
[updated_in] => 2147483647
[store_id] => 1
[abacos_codigo] =>
[abacos_codigo_pai] =>
[all_children] =>
[automatic_sorting] =>
[available_sort_by] =>
[category_zone] =>
[children] =>
[custom_apply_to_products] => 0
[custom_design] =>
[custom_design_from] =>
[custom_design_to] =>
[custom_layout_update] =>
[custom_use_parent_settings] => 0
[default_sort_by] =>
[description] =>
[display_mode] => PRODUCTS
[filter_price_range] =>
[hide_desktop] => 0
[image] =>
[include_in_menu] => 0
[is_active] => 1
[is_anchor] => 0
[landing_page] =>
[meta_description] =>
[meta_keywords] =>
[meta_title] =>
[mobile_img] =>
[name] => Start
[nav-image] =>
[page_layout] => category-full-width
[path_in_store] =>
[thumbnail] =>
[url_key] => start
[url_path] => start
[weltpixel_category_url] =>
[weltpixel_category_url_newtab] => 0
[weltpixel_mm_bottom_block] =>
[weltpixel_mm_bottom_block_cms] =>
[weltpixel_mm_bottom_block_type] => none
[weltpixel_mm_columns_number] => 4
[weltpixel_mm_column_width] => auto
[weltpixel_mm_display_mode] => sectioned
[weltpixel_mm_left_block] =>
[weltpixel_mm_left_block_cms] =>
[weltpixel_mm_left_block_type] => none
[weltpixel_mm_mob_hide_allcat] => 0
[weltpixel_mm_right_block] =>
[weltpixel_mm_right_block_cms] =>
[weltpixel_mm_right_block_type] => none
[weltpixel_mm_top_block] =>
[weltpixel_mm_top_block_cms] =>
[weltpixel_mm_top_block_type] => none
)
magento2.3.2 category-image
magento2.3.2 category-image
edited Aug 8 at 8:19
Dinesh Rajput
asked Aug 7 at 5:16
Dinesh RajputDinesh Rajput
1019 bronze badges
1019 bronze badges
try print_r($categoryObj->getImageUrl());
– Shafeel Sha
Aug 8 at 8:28
add a comment |
try print_r($categoryObj->getImageUrl());
– Shafeel Sha
Aug 8 at 8:28
try print_r($categoryObj->getImageUrl());
– Shafeel Sha
Aug 8 at 8:28
try print_r($categoryObj->getImageUrl());
– Shafeel Sha
Aug 8 at 8:28
add a comment |
3 Answers
3
active
oldest
votes
Try to use this below code in your controller. It maybe helpful for you :
protected $categoryFactory
public function __construct(
.....
MagentoCatalogModelCategoryFactory $categoryFactory
.....
)
.....
$this->categoryFactory = $categoryFactory;
.....
public function execute()
$selectedCatId = $this->getRequest()->getParam('subCatId');
$categoryObj = $this->categoryFactory->create()->load($selectedCatId);
echo $categoryObj->getImageUrl();
Output :
Its not working. If returns null array.
– Dinesh Rajput
Aug 7 at 5:30
It seems like you didn't set image in that category.
– Ankita Patel
Aug 7 at 5:31
Please make sure that image set in that appropriate category.
– Ankita Patel
Aug 7 at 5:31
Please check my edited question with image screenshot of Admin.
– Dinesh Rajput
Aug 7 at 5:34
remove generated and clean cache please.
– Ankita Patel
Aug 7 at 5:39
|
show 3 more comments
Try this:
protected $_storeManager;
public function __construct(
MagentoStoreModelStoreManagerInterface $storeManager,
$data = []
)
$this->_storeManager = $storeManager;
parent::__construct($data);
$categoryFactory = $objectManager->create('MagentoCatalogModelResourceModelCategoryCollectionFactory');
$categories = $categoryFactory->create()
->addAttributeToSelect('*')
->setStore($this->_storeManager->getStore()); //categories from current store will be fetched
foreach ($categories as $category)
print_r($category->getImageUrl());
die('end');
add a comment |
The issue was having in Enterprise Magento. Its been fixed after reindexing.
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f284633%2fenterprise-magento2-3-2-unable-to-get-category-image-url-programmatically%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
Try to use this below code in your controller. It maybe helpful for you :
protected $categoryFactory
public function __construct(
.....
MagentoCatalogModelCategoryFactory $categoryFactory
.....
)
.....
$this->categoryFactory = $categoryFactory;
.....
public function execute()
$selectedCatId = $this->getRequest()->getParam('subCatId');
$categoryObj = $this->categoryFactory->create()->load($selectedCatId);
echo $categoryObj->getImageUrl();
Output :
Its not working. If returns null array.
– Dinesh Rajput
Aug 7 at 5:30
It seems like you didn't set image in that category.
– Ankita Patel
Aug 7 at 5:31
Please make sure that image set in that appropriate category.
– Ankita Patel
Aug 7 at 5:31
Please check my edited question with image screenshot of Admin.
– Dinesh Rajput
Aug 7 at 5:34
remove generated and clean cache please.
– Ankita Patel
Aug 7 at 5:39
|
show 3 more comments
Try to use this below code in your controller. It maybe helpful for you :
protected $categoryFactory
public function __construct(
.....
MagentoCatalogModelCategoryFactory $categoryFactory
.....
)
.....
$this->categoryFactory = $categoryFactory;
.....
public function execute()
$selectedCatId = $this->getRequest()->getParam('subCatId');
$categoryObj = $this->categoryFactory->create()->load($selectedCatId);
echo $categoryObj->getImageUrl();
Output :
Its not working. If returns null array.
– Dinesh Rajput
Aug 7 at 5:30
It seems like you didn't set image in that category.
– Ankita Patel
Aug 7 at 5:31
Please make sure that image set in that appropriate category.
– Ankita Patel
Aug 7 at 5:31
Please check my edited question with image screenshot of Admin.
– Dinesh Rajput
Aug 7 at 5:34
remove generated and clean cache please.
– Ankita Patel
Aug 7 at 5:39
|
show 3 more comments
Try to use this below code in your controller. It maybe helpful for you :
protected $categoryFactory
public function __construct(
.....
MagentoCatalogModelCategoryFactory $categoryFactory
.....
)
.....
$this->categoryFactory = $categoryFactory;
.....
public function execute()
$selectedCatId = $this->getRequest()->getParam('subCatId');
$categoryObj = $this->categoryFactory->create()->load($selectedCatId);
echo $categoryObj->getImageUrl();
Output :
Try to use this below code in your controller. It maybe helpful for you :
protected $categoryFactory
public function __construct(
.....
MagentoCatalogModelCategoryFactory $categoryFactory
.....
)
.....
$this->categoryFactory = $categoryFactory;
.....
public function execute()
$selectedCatId = $this->getRequest()->getParam('subCatId');
$categoryObj = $this->categoryFactory->create()->load($selectedCatId);
echo $categoryObj->getImageUrl();
Output :
edited Aug 7 at 6:05
answered Aug 7 at 5:22
Ankita PatelAnkita Patel
8611 bronze badges
8611 bronze badges
Its not working. If returns null array.
– Dinesh Rajput
Aug 7 at 5:30
It seems like you didn't set image in that category.
– Ankita Patel
Aug 7 at 5:31
Please make sure that image set in that appropriate category.
– Ankita Patel
Aug 7 at 5:31
Please check my edited question with image screenshot of Admin.
– Dinesh Rajput
Aug 7 at 5:34
remove generated and clean cache please.
– Ankita Patel
Aug 7 at 5:39
|
show 3 more comments
Its not working. If returns null array.
– Dinesh Rajput
Aug 7 at 5:30
It seems like you didn't set image in that category.
– Ankita Patel
Aug 7 at 5:31
Please make sure that image set in that appropriate category.
– Ankita Patel
Aug 7 at 5:31
Please check my edited question with image screenshot of Admin.
– Dinesh Rajput
Aug 7 at 5:34
remove generated and clean cache please.
– Ankita Patel
Aug 7 at 5:39
Its not working. If returns null array.
– Dinesh Rajput
Aug 7 at 5:30
Its not working. If returns null array.
– Dinesh Rajput
Aug 7 at 5:30
It seems like you didn't set image in that category.
– Ankita Patel
Aug 7 at 5:31
It seems like you didn't set image in that category.
– Ankita Patel
Aug 7 at 5:31
Please make sure that image set in that appropriate category.
– Ankita Patel
Aug 7 at 5:31
Please make sure that image set in that appropriate category.
– Ankita Patel
Aug 7 at 5:31
Please check my edited question with image screenshot of Admin.
– Dinesh Rajput
Aug 7 at 5:34
Please check my edited question with image screenshot of Admin.
– Dinesh Rajput
Aug 7 at 5:34
remove generated and clean cache please.
– Ankita Patel
Aug 7 at 5:39
remove generated and clean cache please.
– Ankita Patel
Aug 7 at 5:39
|
show 3 more comments
Try this:
protected $_storeManager;
public function __construct(
MagentoStoreModelStoreManagerInterface $storeManager,
$data = []
)
$this->_storeManager = $storeManager;
parent::__construct($data);
$categoryFactory = $objectManager->create('MagentoCatalogModelResourceModelCategoryCollectionFactory');
$categories = $categoryFactory->create()
->addAttributeToSelect('*')
->setStore($this->_storeManager->getStore()); //categories from current store will be fetched
foreach ($categories as $category)
print_r($category->getImageUrl());
die('end');
add a comment |
Try this:
protected $_storeManager;
public function __construct(
MagentoStoreModelStoreManagerInterface $storeManager,
$data = []
)
$this->_storeManager = $storeManager;
parent::__construct($data);
$categoryFactory = $objectManager->create('MagentoCatalogModelResourceModelCategoryCollectionFactory');
$categories = $categoryFactory->create()
->addAttributeToSelect('*')
->setStore($this->_storeManager->getStore()); //categories from current store will be fetched
foreach ($categories as $category)
print_r($category->getImageUrl());
die('end');
add a comment |
Try this:
protected $_storeManager;
public function __construct(
MagentoStoreModelStoreManagerInterface $storeManager,
$data = []
)
$this->_storeManager = $storeManager;
parent::__construct($data);
$categoryFactory = $objectManager->create('MagentoCatalogModelResourceModelCategoryCollectionFactory');
$categories = $categoryFactory->create()
->addAttributeToSelect('*')
->setStore($this->_storeManager->getStore()); //categories from current store will be fetched
foreach ($categories as $category)
print_r($category->getImageUrl());
die('end');
Try this:
protected $_storeManager;
public function __construct(
MagentoStoreModelStoreManagerInterface $storeManager,
$data = []
)
$this->_storeManager = $storeManager;
parent::__construct($data);
$categoryFactory = $objectManager->create('MagentoCatalogModelResourceModelCategoryCollectionFactory');
$categories = $categoryFactory->create()
->addAttributeToSelect('*')
->setStore($this->_storeManager->getStore()); //categories from current store will be fetched
foreach ($categories as $category)
print_r($category->getImageUrl());
die('end');
answered Aug 7 at 5:39
Shafeel ShaShafeel Sha
50015 bronze badges
50015 bronze badges
add a comment |
add a comment |
The issue was having in Enterprise Magento. Its been fixed after reindexing.
add a comment |
The issue was having in Enterprise Magento. Its been fixed after reindexing.
add a comment |
The issue was having in Enterprise Magento. Its been fixed after reindexing.
The issue was having in Enterprise Magento. Its been fixed after reindexing.
answered Aug 7 at 8:45
Dinesh RajputDinesh Rajput
1019 bronze badges
1019 bronze badges
add a comment |
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f284633%2fenterprise-magento2-3-2-unable-to-get-category-image-url-programmatically%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
try print_r($categoryObj->getImageUrl());
– Shafeel Sha
Aug 8 at 8:28