Guest User

Untitled

a guest
Jul 19th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. $_category = $this->getCurrentCategory();
  2. $_children = $_category->getChildrenCategories();
  3. foreach( $_children as $child ){
  4. if( $child->getIsActive() ){
  5. echo "<p>" . $child->getImageUrl() . "</p>";
  6.  
  7. bool(false)
  8.  
  9. public function getImageUrl(){
  10. $url = false;
  11. $image = $this->getImage();
  12. if ($image) {
  13.  
  14. /* @var $_children MagentoCatalogModelResourceModelCategoryCollection */
  15. $_children = $this->getCurrentCategory()->getCollection();
  16. $_children->addAttributeToSelect('image')
  17. ->addAttributeToFilter('is_active', 1))
  18. ->addIdFilter($_category->getChildren())
  19. ->setOrder('position', MagentoFrameworkDBSelect::SQL_ASC);
  20.  
  21. foreach( $_children as $child ){
  22. echo "<p>" . $child->getImage(); . "</p>";
Add Comment
Please, Sign In to add comment