This is built in to most themes and all of the base themes. So I'm guessing what you want is to relocate the related products to another area.
This is possible in a few different ways:
Via layouts
Using layout XML you can provide the following block declaration to any <reference>
-
<block type="catalog/product_list_related" name="catalog.product.related" before="-" template="catalog/product/list/related.phtml"/>
This should call and render the block and associated template file.
Roll your own
Why not? You're a capable developer! In this case, you can do something very similar to what you posted in the links above. This particular example is fairly trivial but shows you what may be possible:
Edit
My what a difference a year makes. Don't load models in loops. Bad Phillip, BAD.
$related_prods = Mage::getModel('catalog/product')
->getCollection()
->addAttributeToSelect('name')
->addAttributeToSelect('sku')
->addAttributeToFilter('entity_id',array('in'=>$_product->getRelatedProductIds()));
foreach($related_prods as $related){
echo $related->getName() . " " . $related->getSku();
}
This can be placed anywhere on the product page or view.phtml
but best practice dictates that you should place this in a Block method and reference that inside the template. Bottom line, you either need to have $_product available or use Mage::registry('current_product')
.
We should take a look at: vendor/magento/module-catalog/view/frontend/layout/catalog_product_view.xml
line 103 ~ 118
<block class="Magento\Catalog\Block\Product\View\Description" name="product.info.details" template="product/view/details.phtml" after="product.info.media">
<block class="Magento\Catalog\Block\Product\View\Description" name="product.info.description" template="product/view/attribute.phtml" group="detailed_info">
......
</block>
All tabs are inside the product.info.details
element and belong to group detailed_info
. The add-to-cart element belongs to product_options_wrapper_bottom
element. We need to rearrange these elements. To do this, add the extending catalog_product_view.xml
in the app/design/frontend/{Vendor Theme}/{Theme Name}/Magento_Catalog/layout/
directory:
#app/design/frontend/{Vendor Theme}/{Theme Name}/Magento_Catalog/layout/catalog_product_view.xml
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<move element="product.info.details" destination="product.info.main" after="product_options_wrapper_bottom"/>
</body>
</page>
Here is the result:
You can read more here: http://devdocs.magento.com/guides/v2.0/frontend-dev-guide/layouts/xml-manage.html#layout_markup_rearrange
Best Answer
Two steps:
to
and make it looks like below:
At the page app/design/frontend/rwd/default/template/catalog/product/view.phtml, remove following: