Hi,
i dont know how to add related products for view detail product, pls help me
7 answers
The related products you mentioned actually are up-sells products
When editting or creating products in back-end, at the up-sells tab please make sure that you select some products there.
Hi Sherlock holmes,
So i want to display related product pls give me solution
Kien
To show related products, please open file ..\app\design\frontend\default\jm_megamalltemplat e\catalog\product\view.phtml
At line 267, before this code:
Code:
<?php if($baseconfig['showupsell']): $upsell_products = $this->getChild('upsell_products'); if($upsell_products) { $upsell_products->setItemLimit("upsell",$baseconfig['upsellnumber']); if($upsell_products = $this->getChildHtml('upsell_products')): ?> <?php echo $upsell_products; ?> <?php endif; } endif; ?>
Add this code:
Code:
<?php echo $this->getChildHtml('related_products'); ?>
Hope this help.
Thank Nicky DG,
One more question pls help me
Attachment 35633
I want to add block !
Kien
If you want to add CMS Static Block, you add this code:
PHP Code:
<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('your_static_block_id')->toHtml() ?>
to the product view file:
..\app\design\frontend\default\jm_megamalltemplat e\catalog\product\view.phtml
To learn more on how to create static block, you can follow this guide:
http://www.magentocommerce.com/knowl…-static-blocks
Hi Nicky,
I tried this solution with the Jm Crafts Theme but it changes nothing to the page. I can only show upsell products as related products.
Do you have any idea?
Thanks,
Vinny
To add a new block on product detail, please follow steps below:
1. Go to your admin, create a static block.
2. Open the file …\app\design\frontend\default\jm_megamalltempla te\catalog\product\view.phtml
After this code:
Code:
<div id="ja-tab-products" class="product-collateral">
Add this code:
Code:
<div class="block-product"> <?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('your_block_identifier')->toHtml() ?> </div>
Note: your_block_identifier is your block’s identifier which you created in your admin
3. Add style for this via this file ..\skin\frontend\default\jm_megamall\css\styles.cs s
After this code:
Code:
.product-collateral { margin: 0 0 40px 0; position: relative }
Add this code:
Code:
.block-product { float: left; margin: 130px 0 0; top: 130px; width: 265px; }
Hope this helps.