Solr: cannot sort on multivalued field

Go to the file solr/conf/schema.xml
Search for the corresponding fields starting with the tag dynamicField
Change the value multiValued="true" to multiValued="false"

Solr: cannot sort on multivalued field

Magento: Cannot complete this operation from non-admin area

Use the below code after including the file “app/Mage.php”


Mage::register('isSecureArea', true);

Magento: Cannot complete this operation from non-admin area

Magento: Reindex via SSH

The fastest way to reindex Magento data is manually via SSH. To reindex the Magento data manually, you need to have an SSH access to your web hosting account. All you need to do to reindex your Magento data manually is to log in your hosting account via SSH, go to your Magento installation directory (e.g. /var/www/html) and execute the following command:

php shell/indexer.php reindexall

To reindex individual items execute the below commands:

Category Flat Data:
php shell/indexer.php --reindex catalog_category_flat

Product Flat Data:
php shell/indexer.php --reindex catalog_product_flat

Stock Status:
php shell/indexer.php --reindex cataloginventory_stock

Catalog product price:
php shell/indexer.php --reindex catalog_product_price

Category URL Rewrites:
php shell/indexer.php --reindex catalog_url_category

Product URL Rewrites:
php shell/indexer.php --reindex catalog_url_product

URL Redirects:
php shell/indexer.php --reindex url_redirect

Catalog Category/Product Index:
php shell/indexer.php --reindex catalog_category_product

Catalog Search Index:
php shell/indexer.php --reindex catalogsearch_fulltext

Tag Aggregation Data:
php shell/indexer.php --reindex tag_summary

Product Attributes:
php shell/indexer.php --reindex catalog_product_attribute

Magento: Reindex via SSH

Magento: get root folder path

<?php echo Mage::getBaseDir('base');?>

Magento: get root folder path

Magento: Invalid backend model specified: customer/attribute_backend_data_boolean

You will be probably missing the file app/code/core/Mage/Customer/Model/Attribute/Backend/Data/Boolean.php
Add the files and the below content:


<?php
/**
* Magento Enterprise Edition
*
* NOTICE OF LICENSE
*
* This source file is subject to the Magento Enterprise Edition License
* that is bundled with this package in the file LICENSE_EE.txt.
* It is also available through the world-wide-web at this URL:
* http://www.magentocommerce.com/license/enterprise-edition
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@magentocommerce.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Magento to newer
* versions in the future. If you wish to customize Magento for your
* needs please refer to http://www.magentocommerce.com for more information.
*
* @category Mage
* @package Mage_Customer
* @copyright Copyright (c) 2013 Magento Inc. (http://www.magentocommerce.com)
* @license http://www.magentocommerce.com/license/enterprise-edition
*/

/**
* Boolean customer attribute backend model
*
* @category Mage
* @package Mage_Customer
* @author Magento Core Team
*/
class Mage_Customer_Model_Attribute_Backend_Data_Boolean
extends Mage_Eav_Model_Entity_Attribute_Backend_Abstract
{
/**
* Prepare data before attribute save
*
* @param Mage_Customer_Model_Customer $customer
* @return Mage_Customer_Model_Attribute_Backend_Data_Boolean
*/
public function beforeSave($customer)
{
$attributeName = $this->getAttribute()->getName();
$inputValue = $customer->getData($attributeName);
$sanitizedValue = (!empty($inputValue)) ? '1' : '0';
$customer->setData($attributeName, $sanitizedValue);
return $this;
}
}
Magento: Invalid backend model specified: customer/attribute_backend_data_boolean

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()