We have 5000 products at our webstore. We can not use magento default feature related products & upsell, cross-sell products. Is there any customize code or modules which can implement to display automatic related products and category based up-sell & cross-sell products? We are using magento 1.9.2.
Magento – Magento : How tomplement Automatic Related Products and Category Based Upsell Products
categorydatabasemagento-1.9product
Related Solutions
This is possible:
- Make an attribute
my_sort_attribute
- Set Used for Sorting in Product Listing to Yes
- You can now make it the default sorting in System -> Config -> Catalog -> Frontend
Only hard thing is that there is no default option for ascending or descending. You will have to write/modify code for that.
Try this module:
File : app\etc\modules\Rkt_CrossSell.xml
<?xml version="1.0"?>
<config>
<modules>
<Rkt_CrossSell>
<active>true</active>
<codePool>community</codePool>
<depends>
<Mage_Catalog />
</depends>
</Rkt_CrossSell>
</modules>
</config>
File : app\code\community\Rkt\CrossSell\etc\config.xml
<?xml version="1.0"?>
<config>
<modules>
<Rkt_CrossSell>
<version>1.0.0</version>
</Rkt_CrossSell>
</modules>
<global>
<helpers>
<rkt_crossell>
<class>Rkt_CrossSell_Helper</class>
</rkt_crossell>
</helpers>
<blocks>
<rkt_crossell>
<class>Rkt_CrossSell_Block</class>
</rkt_crossell>
</blocks>
</global>
<frontend>
<layout>
<updates>
<rkt_crossell>
<file>rkt_crossell.xml</file>
</rkt_crossell>
</updates>
</layout>
</frontend>
</config>
File : app\code\community\Rkt\CrossSell\Block\Catalog\Product\View\Crosssell.php
<?php
class Rkt_CrossSell_Block_Catalog_Product_View_Crosssell extends Mage_Checkout_Block_Cart_Crosssell
{
/**
* Get crosssell items
*
* @return array
*/
public function getItems()
{
$items = $this->getData('items');
if (is_null($items)) {
$items = $this->getProduct()->getCrossSellProducts();
$this->setData('items', $items);
}
return $items;
}
}
File : app\code\community\Rkt\CrossSell\Helper\Data.php
<?php
class Rkt_CrossSell_Helper_Data extends Mage_Core_Helper_Abstract
{
}
File : app\design\frontend\base\default\layout\rkt_crossell.xml
<?xml version="1.0"?>
<layout>
<catalog_product_view>
<reference name="product.info">
<block type="rkt_crossell/catalog_product_view_crosssell" name="product.view.crosssell" as="crosssell" template="checkout/cart/crosssell.phtml" />
</reference>
</catalog_product_view>
</layout>
Now in your view.phtml add this code in the appropriate position
<?php echo $this->getChildHtml('crosssell') ?>
clear your cache and re-run product page.
Note: please check you have specify products cross sell for appropriate product.
I hope this will help you.
Best Answer
There are many Commercial extension available for set up related, cross sell & up sell products automatically.
You can also check free community extensions below:
https://www.magentocommerce.com/magento-connect/related-products-manager.html
https://www.magentocommerce.com/magento-connect/mtoo-related-automatic-related-products.html