I am trying to create a custom tab in Customer my account area and adding a link in the left bar to it, have followed the code structure similar to this article:
https://www.mageplaza.com/devdocs/add-custom-tab-customer-account-magento-2.html
It shows the link in the left sidebar and when I check profiler, the code shows that my controller executed, but somehow it's not reaching my template phtml file which is already located at its defined directory under the given path in this XML. (bulkAdd is the route name defined in routes.xml)
Below are the codes:
- customer_account.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="customer_account_navigation">
<block class="Magento\Customer\Block\Account\Delimiter" name="customer.account.navigation.plus91.bulk.delimiter.top"
template="Magento_Customer::account/navigation-delimiter.phtml">
</block>
<block class="Magento\Framework\View\Element\Html\Link\Current"
name="customer.account.navigation.bulk.index.index">
<arguments>
<argument name="path" xsi:type="string">bulkAdd/customer</argument>
<argument name="label" xsi:type="string" translate="true">Bulk Order</argument>
</arguments>
</block>
<!--<block class="Magento\Framework\View\Element\Template" name="bulk-link"
template="Plus91_Bulk::account/navigation.phtml" before="-"/> -->
</referenceBlock>
</body>
</page>
- bulkAdd_customer_index.xml
<?xml version="1.0" ?>
<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<css src="css/bulkadd.css" />
<script src="js/bulkadd.js"/>
</head>
<!--<update handle="customer_account"/> -->
<body>
<referenceBlock name="page.main.title">
<action method="setPageTitle">
<argument translate="true" name="title" xsi:type="string">Bulk Inquiry</argument>
</action>
</referenceBlock>
<referenceContainer name="content">
<block class="Magento\Framework\View\Element\Template" name="bulkAdd_bulkorder_index" template="Plus91_Bulk::bulkorder/index.phtml" />
</referenceContainer>
</body>
</page>
- Controller/Customer/Index.php
<?php
namespace Plus91\Bulk\Controller\Customer;
class Index extends \Magento\Framework\App\Action\Action {
public function execute() {
$this->_view->loadLayout();
$this->_view->renderLayout();
}
}
?>
- And the phtml file just contains simple html without any php code.
There is no error in the error log file, profiler shows the controller is being executed and shows the output if I put something there.
Already ran setup:upgrade and cleared cache many times, nothing worked for me.
Any quick help would be appreciated.