Advertisement
Guest User

ToHtml

a guest
Jun 1st, 2015
403
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.70 KB | None | 0 0
  1. <?php
  2. //Get current category url
  3. $current_category = Mage::registry('current_category')->getUrl();
  4.  
  5. //Get brandname
  6. $brandname = Mage::getModel('catalog/product')->load($_product->getId())->getAttributeText('manufacturer');
  7.  
  8. //Strip .html and add the stuff from the layered navigation to it
  9. $brandurl = str_replace(".html", "/l/". strtolower($brandname) .".html", $current_category);   
  10. $brandnamemurl = "of <a href="" . $brandurl . "">" . $brandname . "</a>";
  11.  
  12. //breadcrumb stuff
  13. $breadcrumbs = $this->getLayout()->getBlock('breadcrumbs');
  14. $breadcrumbs->addCrumb('manufacturer', array('label'=>$brandnamemurl, 'title'=>$brandname));
  15.  
  16. echo $this->getLayout()->getBlock('breadcrumbs')->toHtml();
  17. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement