Magento – Force Display Full Breadcrumb Path

The best practice is to override this function and create a new module. For the time being we can use the easier method 🙂

Copy core file to local: app\code\local\Mage\Catalog\Block\Breadcrumbs.php
On protected function _prepareLayout() add below code just before $title = array();

$current_category   = Mage::registry('current_category');
$current_product    = Mage::registry('current_product');
if(!$current_category && $current_product){
    $categories = $current_product->getCategoryCollection()->addAttributeToSelect('name')->setPageSize(1);
    foreach($categories as $category) {
        Mage::unregister('current_category');
        Mage::register('current_category', $category);
    }
}

After this addition of code, you will always get full magento breadcrumb. Full code looks like below:

protected function _prepareLayout()
{
    if ($breadcrumbsBlock = $this->getLayout()->getBlock('breadcrumbs')) {
        $breadcrumbsBlock->addCrumb('home', array(
            'label'=>Mage::helper('catalog')->__('Home'),
            'title'=>Mage::helper('catalog')->__('Go to Home Page'),
            'link'=>Mage::getBaseUrl()
            ));

        // Fix for Breadcrumbs start here
        $current_category   = Mage::registry('current_category');
        $current_product    = Mage::registry('current_product');
        if(!$current_category && $current_product){
            $categories = $current_product->getCategoryCollection()->addAttributeToSelect('name')->setPageSize(1);
            foreach($categories as $category) {
                Mage::unregister('current_category');
                Mage::register('current_category', $category);
            }
        }
        // Fix for Breadcrumbs ends here

        $title = array();
        $path  = Mage::helper('catalog')->getBreadcrumbPath();

        foreach ($path as $name => $breadcrumb) {
            $breadcrumbsBlock->addCrumb($name, $breadcrumb);
            $title[] = $breadcrumb['label'];
        }

        if ($headBlock = $this->getLayout()->getBlock('head')) {
            $headBlock->setTitle(join($this->getTitleSeparator(), array_reverse($title)));
        }
    }
    return parent::_prepareLayout();
}

Magento – Force Display Full Breadcrumb Path

Call to undefined function wp_dashboard_setup()

Open up the file wp-admin/index.php

Change the line below line

require_once(ABSPATH . 'wp-admin/includes/dashboard.php');

to

require_once('includes/dashboard.php');

REF: WordPress › Support » Fatal error: Call to undefined function wp_dashboard_setup()

Call to undefined function wp_dashboard_setup()

Pinterest “Pin it” button breaking ‘back’ in Internet Explorer

Change how you insert the pinit.js file. Use the code below and check

<script type="text/javascript" src="//assets.pinterest.com/js/pinit.js" data-pin-do-not-log=true></script>
Pinterest “Pin it” button breaking ‘back’ in Internet Explorer

2012 in review

The WordPress.com stats helper monkeys prepared a 2012 annual report for this blog.

Here’s an excerpt:

4,329 films were submitted to the 2012 Cannes Film Festival. This blog had 33,000 views in 2012. If each view were a film, this blog would power 8 Film Festivals

Click here to see the complete report.

2012 in review

libcrypto.so.6()(64bit) is needed


# yum whatprovides libcrypto.so.6
Loaded plugins: rhnplugin
openssl098e-0.9.8e-17.el6.i686 : A compatibility version of a general cryptography and TLS library
Repo : rhel-x86_64-server-6
Matched from:
Other : libcrypto.so.6
# yum install openssl098e

libcrypto.so.6()(64bit) is needed

PHP: Remove a single parameter from a Query String using regular expression


function remove_querystring_var($url, $key)
{
$url = preg_replace('/(.*)(\?|&)' . $key . '=[^&]+?(&)(.*)/i', '$1$2$4', $url . '&');
$url = substr($url, 0, -1);
return $url;
}

PHP: Remove a single parameter from a Query String using regular expression

Magento: remove the focus on varienform

Set second attribute to false in js function call:

var signupForm = new VarienForm('signupForm', false);

Magento: remove the focus on varienform