Skip to main content
added 1946 characters in body
Source Link

1) Update GoFlyyGetOrder.php Add id in Button and a tag
Vendor/Module/Ui/Component/Listing/Column/GoFlyyGetOrder.php

public function prepareDataSource(array $dataSource)
    {
        if (isset($dataSource['data']['items'])) {
            $fieldName = $this->getData('name');
            foreach ($dataSource['data']['items'] as & $item) {
                $order  = $this->orderRepository->get($item["entity_id"]);
                $goFlyyOrderId = $order->getData("goflyy_order_id");
                if($goFlyyOrderId){
                    $item[$fieldName] = "<button"<a href='baseurl/Vendor_Module/index/index?id='.$goFlyyOrderId><button class='button' id='FlyyOrderId_$goFlyyOrderId'><span>$goFlyyOrderId<id='FlyyOrderId_$goFlyyOrderId$'><span>$goFlyyOrderId</span></button>";
                }
            }
        }

        return $dataSource;
    }

After After Call Phtml in Sales Order Grid

21) Create a File and add the code given below
File : Vendor/Module/viewController/adminhtmlAdminhtml/layoutIndex/sales_order_gridIndex.xmlphp

<?xmlphp
/**
 version="1.0"* encoding="UTF-8"?>Copyright ©  All rights reserved.
<page xmlns:xsi="http://www* See COPYING.w3txt for license details.org
 */2001
declare(strict_types=1);

namespace Vendor\Module\Controller\Adminhtml\Index;

use Magento\Framework\App\Action\HttpGetActionInterface;
use Magento\Framework\Controller\ResultInterface;
use Magento\Framework\View\Result\PageFactory;

class Index implements HttpGetActionInterface
{

    /XMLSchema-instance"**
 xsi:noNamespaceSchemaLocation="urn:magento:framework:View    * @var PageFactory
     */Layout
    protected $resultPageFactory;

    /etc**
     * Constructor
     *
     * @param PageFactory $resultPageFactory
     */page_configuration.xsd">
   <body> public function __construct(PageFactory $resultPageFactory)
    {
      <referenceContainer name="root"> $this->resultPageFactory = $resultPageFactory;
    }

    /**
 <block class="Vendor\Module\Block\Adminhtml\FlyOrder" template="Vendo_Module::  * Execute view/flyorder.phtml" name="vendor.fly.order"action
 />    *
     * @return </referenceContainer>ResultInterface
   <  */body>
</page>    public function execute()
    {
        return $this->resultPageFactory->create();
    }
}
?>

32) Create a block class and add a code
File : Vendor\Module\Block\Adminhtml\FlyOrderVendor/Module/Block/Adminhtml/Index/Index.php

<?php
/**
 * Copyright ©  All rights reserved.
 * See COPYING.txt for license details.
 */
declare(strict_types=1);

namespace Vendor\Module\Block\Adminhtml;Vendor\Module\Block\Adminhtml\Index;

class FlyOrderIndex extends \Magento\Backend\Block\Template
{ 

    /**
     * Constructor
     *
     * @param \Magento\Backend\Block\Template\Context  $context
     * @param array $data
     */Get 
 Collection of goFlyyOrderId addpublic youfunction Logic__construct(
        \Magento\Backend\Block\Template\Context $context,
        \Magento\Framework\App\Request\Http $request
        array $data = []
    ) {
        parent::__construct(
            $this->request = $request;
            $context,$data
        );
    }
    public function getFlyyOrderId(){
        -------------------$FlyyOrderId = $this->request->getParam('id', false);
        return $FlyyOrderId;
    }
}
?>

43) Create a template file flyordervendor_module_index_index.phtml in pathxml
File : Vendor/Module/view/adminhtml/templates/viewlayout/flyordervendor_module_index_index.xml

<?xml version="1.0" ?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="content">
            <block name="index.index" class="Vendor\Module\Block\Adminhtml\Index\Index" template="Vendor_Module::index/index.phtml"/>
        </referenceContainer>
    </body>
</page>

4) Create a template file flyorder.phtml in path
File : Vendor\Module\Block\Adminhtml\Index\Index" template="Vendor_Module::index/index.phtml"

<div id="popup-modal-main<?php echo $block->getFlyyOrderId();?>" style="display:none;">
       Fly Order Id <?php echo $block->getFlyyOrderId();?>
 </div>

<script type="text/javascript">
require([
    'jquery', 
    'Magento_Ui/js/modal/modal'
    ], function($, modal) {            
        $(document).ready(function(){  
            var options = {
                type: 'popup',
                responsive: true,
                innerScroll: true,
                title: 'Open Modal'
            };              
            $("#FlyyOrderId_<?php echo $block->getFlyyOrderId();?>").on('click',function(){                                                                               
                $("#popup-modal-main<?php echo $block->getFlyyOrderId();?>").modal(options).modal('openModal');
            });
        });
    });        
</script>

1) Update GoFlyyGetOrder.php Add id in Button
Vendor/Module/Ui/Component/Listing/Column/GoFlyyGetOrder.php

public function prepareDataSource(array $dataSource)
    {
        if (isset($dataSource['data']['items'])) {
            $fieldName = $this->getData('name');
            foreach ($dataSource['data']['items'] as & $item) {
                $order  = $this->orderRepository->get($item["entity_id"]);
                $goFlyyOrderId = $order->getData("goflyy_order_id");
                if($goFlyyOrderId){
                    $item[$fieldName] = "<button class='button' id='FlyyOrderId_$goFlyyOrderId'><span>$goFlyyOrderId</span></button>";
                }
            }
        }

        return $dataSource;
    }

After Call Phtml in Sales Order Grid

2) Create a File and add the code given below
File : Vendor/Module/view/adminhtml/layout/sales_order_grid.xml

<?xml version="1.0" encoding="UTF-8"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
   <body>
      <referenceContainer name="root">
         <block class="Vendor\Module\Block\Adminhtml\FlyOrder" template="Vendo_Module::view/flyorder.phtml" name="vendor.fly.order" />
      </referenceContainer>
   </body>
</page>

3) Create a block class and add a code
File : Vendor\Module\Block\Adminhtml\FlyOrder.php

namespace Vendor\Module\Block\Adminhtml;

class FlyOrder extends \Magento\Backend\Block\Template
{
    //Get Collection of goFlyyOrderId add you Logic
    public function getFlyyOrderId(){
        ---------------------
        return
    }
}

4) Create a template file flyorder.phtml in path
File : Vendor/Module/view/adminhtml/templates/view/flyorder.phtml

<div id="popup-modal-main<?php echo $block->getFlyyOrderId();?>" style="display:none;">
       Fly Order Id <?php echo $block->getFlyyOrderId();?>
 </div>

<script type="text/javascript">
require([
    'jquery', 
    'Magento_Ui/js/modal/modal'
    ], function($, modal) {            
        $(document).ready(function(){  
            var options = {
                type: 'popup',
                responsive: true,
                innerScroll: true,
                title: 'Open Modal'
            };              
            $("#FlyyOrderId_<?php echo $block->getFlyyOrderId();?>").on('click',function(){                                                                               
                $("#popup-modal-main<?php echo $block->getFlyyOrderId();?>").modal(options).modal('openModal');
            });
        });
    });        
</script>

1) Update GoFlyyGetOrder.php Add id in Button and a tag
Vendor/Module/Ui/Component/Listing/Column/GoFlyyGetOrder.php

public function prepareDataSource(array $dataSource)
    {
        if (isset($dataSource['data']['items'])) {
            $fieldName = $this->getData('name');
            foreach ($dataSource['data']['items'] as & $item) {
                $order  = $this->orderRepository->get($item["entity_id"]);
                $goFlyyOrderId = $order->getData("goflyy_order_id");
                if($goFlyyOrderId){
                    $item[$fieldName] = "<a href='baseurl/Vendor_Module/index/index?id='.$goFlyyOrderId><button class='button' id='FlyyOrderId_$goFlyyOrderId$'><span>$goFlyyOrderId</span></button>";
                }
            }
        }

        return $dataSource;
    }

After Call Phtml in Sales Order Grid

1) Create a File and add the code given below
File : Vendor/Module/Controller/Adminhtml/Index/Index.php

<?php
/**
 * Copyright ©  All rights reserved.
 * See COPYING.txt for license details.
 */
declare(strict_types=1);

namespace Vendor\Module\Controller\Adminhtml\Index;

use Magento\Framework\App\Action\HttpGetActionInterface;
use Magento\Framework\Controller\ResultInterface;
use Magento\Framework\View\Result\PageFactory;

class Index implements HttpGetActionInterface
{

    /**
     * @var PageFactory
     */
    protected $resultPageFactory;

    /**
     * Constructor
     *
     * @param PageFactory $resultPageFactory
     */
    public function __construct(PageFactory $resultPageFactory)
    {
        $this->resultPageFactory = $resultPageFactory;
    }

    /**
     * Execute view action
     *
     * @return ResultInterface
     */
    public function execute()
    {
        return $this->resultPageFactory->create();
    }
}
?>

2) Create a block class and add a code
File : Vendor/Module/Block/Adminhtml/Index/Index.php

<?php
/**
 * Copyright ©  All rights reserved.
 * See COPYING.txt for license details.
 */
declare(strict_types=1);

namespace Vendor\Module\Block\Adminhtml\Index;

class Index extends \Magento\Backend\Block\Template
{ 

    /**
     * Constructor
     *
     * @param \Magento\Backend\Block\Template\Context  $context
     * @param array $data
     */ 
    public function __construct(
        \Magento\Backend\Block\Template\Context $context,
        \Magento\Framework\App\Request\Http $request
        array $data = []
    ) {
        parent::__construct(
            $this->request = $request;
            $context,$data
        );
    }
    public function getFlyyOrderId(){
        $FlyyOrderId = $this->request->getParam('id', false);
        return $FlyyOrderId;
    }
}
?>

3) Create a vendor_module_index_index.xml
File : Vendor/Module/view/adminhtml/layout/vendor_module_index_index.xml

<?xml version="1.0" ?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="content">
            <block name="index.index" class="Vendor\Module\Block\Adminhtml\Index\Index" template="Vendor_Module::index/index.phtml"/>
        </referenceContainer>
    </body>
</page>

4) Create a template file flyorder.phtml in path
File : Vendor\Module\Block\Adminhtml\Index\Index" template="Vendor_Module::index/index.phtml"

<div id="popup-modal-main<?php echo $block->getFlyyOrderId();?>" style="display:none;">
       Fly Order Id <?php echo $block->getFlyyOrderId();?>
</div>

<script type="text/javascript">
require([
    'jquery', 
    'Magento_Ui/js/modal/modal'
    ], function($, modal) {            
        $(document).ready(function(){  
            var options = {
                type: 'popup',
                responsive: true,
                innerScroll: true,
                title: 'Open Modal'
            };              
            $("#FlyyOrderId_<?php echo $block->getFlyyOrderId();?>").on('click',function(){                                                                               
                $("#popup-modal-main<?php echo $block->getFlyyOrderId();?>").modal(options).modal('openModal');
            });
        });
    });        
</script>
added 179 characters in body
Source Link
<div id="popup-modal-main<?php echo $block->getFlyyOrderId();?>" style="display:none;">
       Fly Order Id <?php echo $block->getFlyyOrderId();?>
 </div>

<script type="text/javascript">
require([
    'jquery', 
    'Magento_Ui/js/modal/modal'
    ], function($, modal) {            
        $(document).ready(function(){  
            var options = {
                type: 'popup',
                responsive: true,
                innerScroll: true,
                title: 'Open Modal'
            };              
            $("#FlyyOrderId_<?php echo $block->getFlyyOrderId();?>").on('click',function(){                                                                               
                $("#popup-modal-main<?php echo $block->getFlyyOrderId();?>").modal(options).modal('openModal');
            });
        });
    });        
</script>
<script type="text/javascript">
require([
    'jquery', 
    'Magento_Ui/js/modal/modal'
    ], function($, modal) {            
        $(document).ready(function(){  
            var options = {
                type: 'popup',
                responsive: true,
                innerScroll: true,
                title: 'Open Modal'
            };              
            $("#FlyyOrderId_<?php echo $block->getFlyyOrderId();?>").on('click',function(){                                                                               
                $("#popup-modal-main<?php echo $block->getFlyyOrderId();?>").modal(options).modal('openModal');
            });
        });
    });        
</script>
<div id="popup-modal-main<?php echo $block->getFlyyOrderId();?>" style="display:none;">
       Fly Order Id <?php echo $block->getFlyyOrderId();?>
 </div>

<script type="text/javascript">
require([
    'jquery', 
    'Magento_Ui/js/modal/modal'
    ], function($, modal) {            
        $(document).ready(function(){  
            var options = {
                type: 'popup',
                responsive: true,
                innerScroll: true,
                title: 'Open Modal'
            };              
            $("#FlyyOrderId_<?php echo $block->getFlyyOrderId();?>").on('click',function(){                                                                               
                $("#popup-modal-main<?php echo $block->getFlyyOrderId();?>").modal(options).modal('openModal');
            });
        });
    });        
</script>
Source Link

1) Update GoFlyyGetOrder.php Add id in Button
Vendor/Module/Ui/Component/Listing/Column/GoFlyyGetOrder.php

public function prepareDataSource(array $dataSource)
    {
        if (isset($dataSource['data']['items'])) {
            $fieldName = $this->getData('name');
            foreach ($dataSource['data']['items'] as & $item) {
                $order  = $this->orderRepository->get($item["entity_id"]);
                $goFlyyOrderId = $order->getData("goflyy_order_id");
                if($goFlyyOrderId){
                    $item[$fieldName] = "<button class='button' id='FlyyOrderId_$goFlyyOrderId'><span>$goFlyyOrderId</span></button>";
                }
            }
        }

        return $dataSource;
    }

After Call Phtml in Sales Order Grid

2) Create a File and add the code given below
File : Vendor/Module/view/adminhtml/layout/sales_order_grid.xml

<?xml version="1.0" encoding="UTF-8"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
   <body>
      <referenceContainer name="root">
         <block class="Vendor\Module\Block\Adminhtml\FlyOrder" template="Vendo_Module::view/flyorder.phtml" name="vendor.fly.order" />
      </referenceContainer>
   </body>
</page>

3) Create a block class and add a code
File : Vendor\Module\Block\Adminhtml\FlyOrder.php

namespace Vendor\Module\Block\Adminhtml;

class FlyOrder extends \Magento\Backend\Block\Template
{
    //Get Collection of goFlyyOrderId add you Logic
    public function getFlyyOrderId(){
        ---------------------
        return
    }
}

4) Create a template file flyorder.phtml in path
File : Vendor/Module/view/adminhtml/templates/view/flyorder.phtml

<script type="text/javascript">
require([
    'jquery', 
    'Magento_Ui/js/modal/modal'
    ], function($, modal) {            
        $(document).ready(function(){  
            var options = {
                type: 'popup',
                responsive: true,
                innerScroll: true,
                title: 'Open Modal'
            };              
            $("#FlyyOrderId_<?php echo $block->getFlyyOrderId();?>").on('click',function(){                                                                               
                $("#popup-modal-main<?php echo $block->getFlyyOrderId();?>").modal(options).modal('openModal');
            });
        });
    });        
</script>