I am trying to remove the product description tab entirely, and I would like the Additional info tab to be opened by default. Previous answers to this question are for different versions of magento, and the catalog.xml file seems to have changed. Currently using 1.9. I've looked through all the template files and can't find anywhere to get rid of description and add the active class to additional into, any ideas?
Magento – How to remove description tab and make additional info open by default
tabs
Related Solutions
I've had the same issue and here's a solution.
Please note there will probably be a better way of doing this but I haven't had time to look into this much.
So, I believe your issue is that the "10 Reviews" link jumps down to the reviews tab, but the "Add you review" link doesn't. If you look in the summary/summary_short.phtml files, the links are exactly the same...
<a href="<?php echo $this->getReviewsUrl() ?>">
If you look into the method itself, you can see that it's just redirecting to the reviews page...
public function getReviewsUrl()
{
return Mage::getUrl('review/product/list', array(
'id' => $this->getProduct()->getId(),
'category' => $this->getProduct()->getCategoryId()
));
}
I've had a quick look for some script that forces the "10 Reviews" link to jump down the page but can't find anything. Here's a work around...
First off, you'll need to add the review form into the reviews tab... (local.xml)
<catalog_product_view>
<reference name="product.info">
<block type="review/product_view_list" name="product.reviews.tab" as="reviews" template="review/product/view/list.phtml" after="product.spec">
<action method="addToParentGroup"><group>detailed_info</group></action>
<action method="setTitle" translate="value"><value>Reviews</value></action>
<block type="review/form" name="product.review.form" as="review_form">
<block type="page/html_wrapper" name="product.review.form.fields.before" as="form_fields_before" translate="label">
<label>Review Form Fields Before</label>
<action method="setMayBeInvisible"><value>1</value></action>
</block>
</block>
</block>
</reference>
</catalog_product_view>
Next off, remove the href from the links and add a class which we'll pick up with script. Do this in the summary_short/summary.phtml files...
Change..
<a href="<?php echo $this->getReviewsUrl() ?>#review-form"><?php echo $this->__('Add Your Review') ?></a>
To...
<a class="no-rating-link"><?php echo $this->__('Add Your Review') ?></a>
Then if you look in app.js, you'll see..
//Open the first accordion if desired.
if (startOpen) {
dts.eq(0).trigger('click');
}
Underneath that, add the following script which will open the reviews tab and also make the page jump down to the reviews form...
// Added to force review links to jump down to review tab
jQuery('.no-rating-link').click(function(){
dts.eq(2).trigger('click');
window.location.href = '#review-form';
});
The reason i said this could be done better is because obviously, if you change the position of the reviews tab within the tabs, this will then open the wrong tab because the dts.eq(2) will always open the 3rd tab. Nevertheless, it's a workaround for you. Hope this helps!
First of all u need to create ur theme http://devdocs.magento.com/guides/v2.1/frontend-dev-guide/themes/theme-create.html
In your theme u have to override Magento Default files.
magento\app\design\frontend\Custom\YourTheme\Magento_Catalog\layout\catalog_product_view.xml
<?xml version="1.0"?>
<!--
/**
* Copyright © 2016 SW-THEMES. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<script src="Magento_Catalog::js/jquery.zoom.min.js"/>
</head>
<body>
<referenceBlock name="product.attributes" remove="true"/>
</body>
</page>
magento\app\design\frontend\Custom\YourTheme\Magento_Catalog\templates\product\view\attribute.phtml as per your requirement.
/**
* Copyright © 2016 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
// @codingStandardsIgnoreFile
/**
* Product view template
*
* @see \Magento\Catalog\Block\Product\View\Description
*/
?>
<?php
$_helper = $this->helper('Magento\Catalog\Helper\Output');
$_product = $block->getProduct();
$_call = $block->getAtCall();
$_code = $block->getAtCode();
$_className = $block->getCssClass();
$_attributeLabel = $block->getAtLabel();
$_attributeType = $block->getAtType();
$_attributeAddAttribute = $block->getAddAttribute();
if ($_attributeLabel && $_attributeLabel == 'default') {
$_attributeLabel = $_product->getResource()->getAttribute($_code)->getFrontendLabel();
}
if ($_attributeType && $_attributeType == 'text') {
$_attributeValue = ($_helper->productAttribute($_product, $_product->$_call(), $_code)) ? $_product->getAttributeText($_code) : '';
} else {
$_attributeValue = $_helper->productAttribute($_product, $_product->$_call(), $_code);
}
$colorValue = $_product->getResource()->getAttribute('color')->getFrontend()->getValue($_product);
?>
<?php if ($colorValue): ?>
<div><?php echo $colorValue; ?></div>
<?php endif; ?>
<?php if ($_attributeValue): ?>
<div class="product attribute <?php /* @escapeNotVerified */ echo $_className?>">
<?php if ($_attributeLabel != 'none'): ?><strong class="type"><?php /* @escapeNotVerified */ echo $_attributeLabel?></strong><?php endif; ?>
<div class="value" <?php /* @escapeNotVerified */ echo $_attributeAddAttribute;?>><?php /* @escapeNotVerified */ echo $_attributeValue; ?></div>
</div>
<?php endif; ?>
Display as per your design requirement.
Let me know if any issue.
Thanks
Best Answer
To Remove product description tab entirely, comment following code from
\app\design\frontend\shopper\default\layout\local.xml
Which is around line number 217.
Once commented you will be able to load Additional info tab by default.
Best Of Luck !!!!