5

Please make your code same as below code In this example i have warranty_display attribute code for Warranty Display and warranty_info attribute code for Warranty Info. Your catalog_product_view.xml code should be <page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/...


3

Please follow below step to display or remove tab into product detail page. Create custom tab via module using below reference link https://www.cloudways.com/blog/add-custom-tab-product-page-magento-2/ Then Create app/code/Cloudways/Mymodule/view/frontend/layout/catalog_product_view.xml file and past below code. <?xml version="1.0"?> <page ...


2

Create these files in your module Vendor/Module/view/frontend/layout/catalog_product_view.xml <?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="product.info.details">...


1

Finally found the solution for this question. https://mage2.pro/t/topic/121 worked for me. So In my block file, wriiten a function that overrides toHtml to blank if my flag is off. public function toHtml() { return $this->canViewWarrantyTab() ? parent::toHtml() : ''; } function canViewWarrantyTab() { /** @var Product $product */ $product = ...


1

Just override vendor\magento\module-catalog\view\frontend\templates\product\view\details.phtml to app\design\frontend\vendor\yourtheme\Magento_Catalog\templates\product\view\details.phtml with below code <?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ // @codingStandardsIgnoreFile /** @var \...


1

You need to change controller code Customtab/ImportOrders/Controller/Customer/Index.php <?php namespace Customtab\ImportOrders\Controller\Customer; class Index extends \Magento\Framework\App\Action\Action { protected $_pageFactory; public function __construct( \Magento\Framework\App\Action\Context $context, \Magento\Framework\View\...


1

You can create custom module or existing your any custom module will add this files. Create a custom file Vendor\Module_name\Model\Config\Source\Sections <?php namespace Vendor\Module_name\Model\Config\Source; use Magento\Framework\App\Utility\Files; use Magento\Framework\Option\ArrayInterface; ...


1

Create two separate block classes for each link. In those classes override _toHtml() method and check for customer's group. If the customer belongs to desired group, then return parent::_toHtml(); else return '';


Only top voted, non community-wiki answers of a minimum length are eligible