Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. <div class="page-title category-title">
  2. <h1><?php echo $_category->getName(); ?></h1>
  3. </div>
  4.  
  5. <?php
  6. if (Mage::registry('current_category')) {
  7. echo Mage::registry('current_category')->getName();
  8. }
  9. else {
  10. $categoryIds = $_product->getCategoryIds();
  11. if (count($categoryIds)) {
  12. $firstCategoryId = $categoryIds[0];
  13. $_category = Mage::getModel('catalog/category')->load($firstCategoryId);
  14.  
  15. echo $_category->getName();
  16. }
  17. }
  18. ?>
  19.  
  20. <?php if($_category instanceof Mage_Catalog_Model_Category): ?>
  21. <div class="page-title category-title">
  22. <h1><?php echo $_category->getName(); ?></h1>
  23. </div>
  24. <?php endif; ?>
  25.  
  26. <div class="page-title category-title">
  27. <h1>
  28. <?php if ($_category instanceof Mage_Catalog_Model_Category) : ?>
  29. <?php echo $_category->getName(); ?>
  30. <?php endif; ?>
  31. </h1>
  32. </div>
  33.  
  34. <?php $_category = Mage::registry('current_category'); ?>
  35.  
  36. <?php if($_category instanceof Mage_Catalog_Model_Category && $_category->getId()): ?>
  37. <div class="page-title category-title">
  38. <h1><?php echo $_category->getName(); ?></h1>
  39. </div>
  40. <?php endif; ?>
  41.  
  42. $categoryIds = $_product->getCategoryIds();
  43.  
  44. if(count($categoryIds) ){
  45. $firstCategoryId = $categoryIds[0];
  46. $_category = Mage::getModel('catalog/category')->load($firstCategoryId);
  47.  
  48. echo $_category->getName();
  49. }
  50.  
  51. <div class="page-title category-title">
  52.  
  53. <h1><?php if (Mage::registry('current_category')) {
  54.  
  55. $_category=Mage::registry('current_category');
  56. echo $_category->getName();
  57. } ?>
  58. </h1>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement