Skip to main content
added 3677 characters in body
Source Link
Mage Explorer
  • 990
  • 15
  • 45

/app/design/frontend/Infortis/ultimo/Magento_Catalog/templates/product/view/details.phtml

look like this

<?php // @codingStandardsIgnoreFile ?> <?php $theme = $this->helper('Infortis\Base\Helper\Data'); $innerContainerClasses = ''; $jsScriptInit = ''; $mode = $theme->getCfg('product_page/tabs'); $openedTab = $theme->getCfg('product_page/opened_tab'); $jsOpenedTab = ''; if ($openedTab !== null) { $jsOpenedTab = ', "active": ' . $openedTab; } else { $jsOpenedTab = ', "active": null'; } switch ($mode) { case 1: $innerContainerClasses = 'product data items ' . $theme->getCfg('product_page/tabs_style') . ' show-tabs'; $jsScriptInit = '{"tabs": {"openedState": "active", "collapsible": true' . $jsOpenedTab . '}}'; break; case 2: $innerContainerClasses = 'product data items ' . $theme->getCfg('product_page/tabs_style'); $jsScriptInit = '{"tabs": {"openedState": "active", "collapsible": true' . $jsOpenedTab . '}}'; break; default: $innerContainerClasses = 'product data items style1 stacked-tabs'; $jsScriptInit = '{"tabs": {"openedState": "active", "collapsible": true}}'; break; } ?> <?php if ($detailedInfoGroup = $block->getGroupChildNames('detailed_info', 'getChildHtml')):?> <?php//START CODE FOR LAST TAB foreach ($detailedInfoGroup as $key => $name){ if($name == 'amasty_faq_product_tab'){ unset($detailedInfoGroup[$key]); array_push($detailedInfoGroup, $name); } }// END CODE FOR LAST TAB ?> <div class="product info detailed collateral-container"> <?php $layout = $block->getLayout(); ?> <div class="<?php echo $innerContainerClasses; ?>" <?php if ($jsScriptInit): ?>data-mage-init='<?php echo $jsScriptInit; ?>'<?php endif; ?>> <?php foreach ($detailedInfoGroup as $name):?> <?php $html = $layout->renderElement($name); if (!trim($html)) { continue; } $alias = $layout->getElementAlias($name); $label = $block->getChildData($alias, 'title'); ?> <div class="data item title" aria-labeledby="tab-label-<?php /* @escapeNotVerified */ echo $alias; ?>-title" data-role="collapsible" id="tab-label-<?php /* @escapeNotVerified */ echo $alias; ?>"> <a class="data switch" tabindex="-1" data-toggle="switch" href="#<?php /* @escapeNotVerified */ echo $alias; ?>" id="tab-label-<?php /* @escapeNotVerified */ echo $alias; ?>-title"> <strong><?php /* @escapeNotVerified */ echo $label; ?></strong> </a> </div> <div class="data item content" id="<?php /* @escapeNotVerified */ echo $alias; ?>" data-role="content"> <?php /* @escapeNotVerified */ echo $html; ?> </div> <?php endforeach;?> </div> </div> <?php endif; ?> 

/app/design/frontend/Infortis/ultimo/Magento_Catalog/templates/product/view/details.phtml

look like this

<?php // @codingStandardsIgnoreFile ?> <?php $theme = $this->helper('Infortis\Base\Helper\Data'); $innerContainerClasses = ''; $jsScriptInit = ''; $mode = $theme->getCfg('product_page/tabs'); $openedTab = $theme->getCfg('product_page/opened_tab'); $jsOpenedTab = ''; if ($openedTab !== null) { $jsOpenedTab = ', "active": ' . $openedTab; } else { $jsOpenedTab = ', "active": null'; } switch ($mode) { case 1: $innerContainerClasses = 'product data items ' . $theme->getCfg('product_page/tabs_style') . ' show-tabs'; $jsScriptInit = '{"tabs": {"openedState": "active", "collapsible": true' . $jsOpenedTab . '}}'; break; case 2: $innerContainerClasses = 'product data items ' . $theme->getCfg('product_page/tabs_style'); $jsScriptInit = '{"tabs": {"openedState": "active", "collapsible": true' . $jsOpenedTab . '}}'; break; default: $innerContainerClasses = 'product data items style1 stacked-tabs'; $jsScriptInit = '{"tabs": {"openedState": "active", "collapsible": true}}'; break; } ?> <?php if ($detailedInfoGroup = $block->getGroupChildNames('detailed_info', 'getChildHtml')):?> <?php//START CODE FOR LAST TAB foreach ($detailedInfoGroup as $key => $name){ if($name == 'amasty_faq_product_tab'){ unset($detailedInfoGroup[$key]); array_push($detailedInfoGroup, $name); } }// END CODE FOR LAST TAB ?> <div class="product info detailed collateral-container"> <?php $layout = $block->getLayout(); ?> <div class="<?php echo $innerContainerClasses; ?>" <?php if ($jsScriptInit): ?>data-mage-init='<?php echo $jsScriptInit; ?>'<?php endif; ?>> <?php foreach ($detailedInfoGroup as $name):?> <?php $html = $layout->renderElement($name); if (!trim($html)) { continue; } $alias = $layout->getElementAlias($name); $label = $block->getChildData($alias, 'title'); ?> <div class="data item title" aria-labeledby="tab-label-<?php /* @escapeNotVerified */ echo $alias; ?>-title" data-role="collapsible" id="tab-label-<?php /* @escapeNotVerified */ echo $alias; ?>"> <a class="data switch" tabindex="-1" data-toggle="switch" href="#<?php /* @escapeNotVerified */ echo $alias; ?>" id="tab-label-<?php /* @escapeNotVerified */ echo $alias; ?>-title"> <strong><?php /* @escapeNotVerified */ echo $label; ?></strong> </a> </div> <div class="data item content" id="<?php /* @escapeNotVerified */ echo $alias; ?>" data-role="content"> <?php /* @escapeNotVerified */ echo $html; ?> </div> <?php endforeach;?> </div> </div> <?php endif; ?> 
added 14 characters in body
Source Link
Mage Explorer
  • 990
  • 15
  • 45

I tried to extends the Tab.php by creating a module, but didnt' work

<?php /** * @author Amasty Team * @copyright Copyright (c) 2019 Amasty (https://www.amasty.com) * @package Amasty_Faq */ namespace Amasty\Faq\Block\Catalog\Product; use Amasty\Faq\Model\ConfigProvider; use Magento\Framework\View\Element\Template; class Tab extends \Amasty\Faq\Block\AbstractBlock implements \Magento\Framework\DataObject\IdentityInterface { /** * @var ConfigProvider */ private $configProvider; /** * Tab constructor. * * @param Template\Context $context * @param ConfigProvider $configProvider * @param array $data */ public function __construct( Template\Context $context, ConfigProvider $configProvider, array $data = [] ) { parent::__construct($context, $data); $this->configProvider = $configProvider; } /** * @return int */ public function getShortAnswerBehavior() { return (int)$this->configProvider->getProductPageShortAnswerBehavior(); } /** * @return bool */ public function showAskQuestionForm() { return $this->configProvider->isShowAskQuestionOnProductPage(); } /** * Render block HTML * * @return string */ protected function _toHtml() { $count = $this->getChildBlock('amasty_faq_questions')->getCollection()->count(); $this->setTitle(__('FAQ''Product Questions') . (($count) ? ' (' . $count .')' : '')); return parent::_toHtml(); } /** * Return identifiers for produced content * * @return array */ public function getIdentities() { return [\Amasty\Faq\Model\ResourceModel\Question\Collection::CACHE_TAG]; } } 

I tried to extends the Tab.php but didnt' work

<?php /** * @author Amasty Team * @copyright Copyright (c) 2019 Amasty (https://www.amasty.com) * @package Amasty_Faq */ namespace Amasty\Faq\Block\Catalog\Product; use Amasty\Faq\Model\ConfigProvider; use Magento\Framework\View\Element\Template; class Tab extends \Amasty\Faq\Block\AbstractBlock implements \Magento\Framework\DataObject\IdentityInterface { /** * @var ConfigProvider */ private $configProvider; /** * Tab constructor. * * @param Template\Context $context * @param ConfigProvider $configProvider * @param array $data */ public function __construct( Template\Context $context, ConfigProvider $configProvider, array $data = [] ) { parent::__construct($context, $data); $this->configProvider = $configProvider; } /** * @return int */ public function getShortAnswerBehavior() { return (int)$this->configProvider->getProductPageShortAnswerBehavior(); } /** * @return bool */ public function showAskQuestionForm() { return $this->configProvider->isShowAskQuestionOnProductPage(); } /** * Render block HTML * * @return string */ protected function _toHtml() { $count = $this->getChildBlock('amasty_faq_questions')->getCollection()->count(); $this->setTitle(__('FAQ') . (($count) ? ' (' . $count .')' : '')); return parent::_toHtml(); } /** * Return identifiers for produced content * * @return array */ public function getIdentities() { return [\Amasty\Faq\Model\ResourceModel\Question\Collection::CACHE_TAG]; } } 

I tried to extends the Tab.php by creating a module, but didnt' work

<?php /** * @author Amasty Team * @copyright Copyright (c) 2019 Amasty (https://www.amasty.com) * @package Amasty_Faq */ namespace Amasty\Faq\Block\Catalog\Product; use Amasty\Faq\Model\ConfigProvider; use Magento\Framework\View\Element\Template; class Tab extends \Amasty\Faq\Block\AbstractBlock implements \Magento\Framework\DataObject\IdentityInterface { /** * @var ConfigProvider */ private $configProvider; /** * Tab constructor. * * @param Template\Context $context * @param ConfigProvider $configProvider * @param array $data */ public function __construct( Template\Context $context, ConfigProvider $configProvider, array $data = [] ) { parent::__construct($context, $data); $this->configProvider = $configProvider; } /** * @return int */ public function getShortAnswerBehavior() { return (int)$this->configProvider->getProductPageShortAnswerBehavior(); } /** * @return bool */ public function showAskQuestionForm() { return $this->configProvider->isShowAskQuestionOnProductPage(); } /** * Render block HTML * * @return string */ protected function _toHtml() { $count = $this->getChildBlock('amasty_faq_questions')->getCollection()->count(); $this->setTitle(__('Product Questions') . (($count) ? ' (' . $count .')' : '')); return parent::_toHtml(); } /** * Return identifiers for produced content * * @return array */ public function getIdentities() { return [\Amasty\Faq\Model\ResourceModel\Question\Collection::CACHE_TAG]; } } 
added 2834 characters in body
Source Link
Mage Explorer
  • 990
  • 15
  • 45

/public_html/vendor/amasty/module-faq-product-questions/Block/Catalog/Product/Tab.php

questions_tabI tried to extends the Tab.phtmlphp but didnt' work

/app/code/Kw/Renametab/Block/Catalog/Product/Tab.php

<?php /** * @author Amasty Team * @copyright Copyright (c) 2019 Amasty (https://www.amasty.com) * @package Amasty_Faq */ namespace Kw\Renametab\Block\Catalog\Product; use Magento\Framework\View\Element\Template; class Tab extends \Amasty\Faq\Block\Catalog\Product\Tab { /** * Render block HTML * * @return string */ protected function _toHtml() { $count = $this->getChildBlock('amasty_faq_questions')->getCollection()->count(); $this->setTitle(__('Q&A') . (($count) ? ' (' . $count .')' : '')); return parent::_toHtml(); } } 

Amasty_Faq::product/questions_tab.phtml

looks like this

The /vendor/amasty/module-faq-product-questions/Block/Catalog/Product/Tab.php

/vendor/amasty/module-faq-product-questions/Block/Catalog/Product/Tab.php

looks like this, i'm not sure how to override the function, so i edit the original file for the mean time

/public_html/vendor/amasty/module-faq-product-questions/Block/Catalog/Product/Tab.php

questions_tab.phtml looks like this

The /vendor/amasty/module-faq-product-questions/Block/Catalog/Product/Tab.php looks like this, i'm not sure how to override the function, so i edit the original file for the mean time

/vendor/amasty/module-faq-product-questions/Block/Catalog/Product/Tab.php

I tried to extends the Tab.php but didnt' work

/app/code/Kw/Renametab/Block/Catalog/Product/Tab.php

<?php /** * @author Amasty Team * @copyright Copyright (c) 2019 Amasty (https://www.amasty.com) * @package Amasty_Faq */ namespace Kw\Renametab\Block\Catalog\Product; use Magento\Framework\View\Element\Template; class Tab extends \Amasty\Faq\Block\Catalog\Product\Tab { /** * Render block HTML * * @return string */ protected function _toHtml() { $count = $this->getChildBlock('amasty_faq_questions')->getCollection()->count(); $this->setTitle(__('Q&A') . (($count) ? ' (' . $count .')' : '')); return parent::_toHtml(); } } 

Amasty_Faq::product/questions_tab.phtml

looks like this

The

/vendor/amasty/module-faq-product-questions/Block/Catalog/Product/Tab.php

looks like this, i'm not sure how to override the function, so i edit the original file for the mean time

added 2834 characters in body
Source Link
Mage Explorer
  • 990
  • 15
  • 45
Loading
added 189 characters in body
Source Link
Mage Explorer
  • 990
  • 15
  • 45
Loading
Source Link
Mage Explorer
  • 990
  • 15
  • 45
Loading