1) In the Admin Panel, select Catalog > Manage Products.
2) Select the product you wish to configure cross-sell products for by clicking its respective row.
3) Click on the Cross-sells tab from the left side panel.
4) Click on the button “Reset Filter” and select the products to be listed
5)Once cross-sell products are selected, click Save at the top right of the page.
6) Clear your cache and refresh the product information page to assure that it’s working to your satisfaction.
All posts by Pramod T P
How to get the page identifier – Magento
<?php
$pageId = Mage::getBlockSingleton('cms/page')->getPage()->getIdentifier()
?>
How to read the current logged in admin details – Magento
<?php
Mage::getSingleton('core/session', array('name' => 'adminhtml'));
$session = Mage::getSingleton('admin/session');
if ( $session->isLoggedIn() ){
echo "Admin is logged in";
}
?>
Downgrade PHP from 5.3 to 5.2 – PHP
How to check if an user is logged in – Magento
<?php
if ($this->helper('customer')->isLoggedIn() ){
echo '<a href="<?php echo $this->getUrl('customer/account/login/');?>">Login</a>';
}else {
echo '<a href="<?php echo $this->getUrl('customer/account/logout/');?>">Logout</a>';
}
?>
How to get the logged in user details on phtml page – Magento
<?php
$customer = Mage::getSingleton('customer/session')->getCustomer();
$email = $customer->getEmail();// for email address
$firstname = $customer->getFirstname();// For first name
$lastnam e= $customer->getLastname();// For last name
?>
Scrollers – Javascript
Follow the below given link
Strip HTML tags except the given – PHP
<?php $text = '<p>TestP</p><b>Tesb</b> <a href="">TestA</a>'; echo strip_tags($text); //Strip all tags echo strip_tags($text, '<p><a>'); //Strip all tags except p and a ?>
How to get the current page url – Magento
<?php
$currentUrl = $this->helper('core/url')->getCurrentUrl();
// Displays URL of the current page
?>
List category and subcategory on sidebar – Magento
<?php
$obj = new Mage_Catalog_Block_Navigation();
$store_cats = $obj->getStoreCategories();
$current_cat = $obj->getCurrentCategory();
$current_cat = (is_object($current_cat) ? $current_cat->getName() : '');?>
<?php foreach ($store_cats as $cat)
{ if ($cat->getName() == $current_cat) {
echo '<li style="padding-left:5px;">
<a href="'.$this->getCategoryUrl($cat).'">'.$cat->getName()."
</a>n<ul>n";
foreach ($obj->getCurrentChildCategories() as $subcat)
{ echo '<li style="padding-left:15px;">
<a href="'.$this->getCategoryUrl($subcat).'">'.$subcat->getName()."</a>
</li>n"; }
echo "</ul>n</li>n"; }
else
{ echo '<li><a href="'.$this->getCategoryUrl($cat).'">'.$cat->getName()."
</a></li>n"; }}
?>