Skip to content
Snippets Groups Projects
Commit 0a4fe2d8 authored by Christel Loftus's avatar Christel Loftus
Browse files

start implementation

parent 6c214a1e
No related branches found
No related tags found
2 merge requests!201.0.41,!15Tracking page
<?php
namespace BobGroup\BobGo\Block;
class TrackOrder extends \Magento\Framework\View\Element\Template
{
public function __construct(
\Magento\Backend\Block\Template\Context $context,
array $data = []
)
{
parent::__construct($context, $data);
}
public function getHelloWorld()
{
return 'Hello World';
}
}
<?php
namespace BobGroup\BobGo\Controller\Test;
use Magento\Framework\App\Action\Action;
use Magento\Framework\App\Action\Context;
class Index extends Action
{
public function __construct(Context $context)
{
parent::__construct($context);
}
public function execute()
{
echo "Test controller works!";
exit;
}
}
<?php
namespace BobGroup\BobGo\Controller\TrackOrder;
class Index extends \Magento\Framework\App\Action\Action
{
/**
* @var \Magento\Framework\View\Result\PageFactory
*/
protected $resultPageFactory;
/**
* @param \Magento\Framework\App\Action\Context $context
* @param \Magento\Framework\View\Result\PageFactory resultPageFactory
*/
public function __construct(
\Magento\Framework\App\Action\Context $context,
\Magento\Framework\View\Result\PageFactory $resultPageFactory
)
{
$this->resultPageFactory = $resultPageFactory;
parent::__construct($context);
}
/**
* Default customer account page
*
* @return void
*/
public function execute()
{
return $this->resultPageFactory->create();
}
}
......@@ -28,7 +28,13 @@
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
<comment>Displays the delivery timeframe and additional service level description, as configured on Bob Go.</comment>
</field>
<field id="enable_track_order" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Enable Track My Order</label>
<comment>When this setting is enabled, your customers will be presented with a page to track orders.</comment>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
</field>
</group>
</section>
</system>
</config>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
<router id="standard">
<route id="trackorder" frontName="trackorder">
<module name="BobGroup_BobGo" />
</route>
</router>
</config>
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<update handle="customer_account"/>
<head>
<title>
Your First Link
</title>
</head>
<body>
<referenceContainer name="content">
<block class="BobGroup\BobGo\Block\TrackOrder" name="bobgo.trackorder.index" template="BobGroup_BobGo::trackorder/index.phtml" cacheable="false" />
</referenceContainer>
</body>
</page>
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="customer_account_navigation">
<!-- Add menu to the end of the sidebar -->
<block class="Magento\Framework\View\Element\Html\Link\Current" name="customer-account-navigation-your-first-link">
<arguments>
<argument name="path" xsi:type="string">BobGo/TrackOrder/index</argument>
<argument name="label" xsi:type="string">Your First Link</argument>
</arguments>
</block>
<block class="Magento\Framework\View\Element\Html\Link\Current" name="customer-account-navigation-your-second-link">
<arguments>
<argument name="path" xsi:type="string">BobGo/TrackOrder/index</argument>
<argument name="label" xsi:type="string">Your Second Link</argument>
</arguments>
</block>
</referenceBlock>
</body>
</page>
<h2>
<?php echo $block->getHelloWorld(); ?>
</h2>
echo 'My First Link Page';
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment