Questions tagged [admin-controller]

Denotes questions related to Admin Area's Controller. A controller is a part of Model-View-Controller Architecture.

Filter by
Sorted by
Tagged with
0 votes
0 answers
11 views

magento 2.4.3 Request validation failed for action "\Controller\Adminhtml\Import\Save\

4.3 admin custom controller redirecting to dashboard <form enctype="multipart/form-data" method="post" action="<?php echo $block->getFormAction(); ?>" id=&...
user avatar
0 votes
0 answers
26 views

How we can call multiple blocks in a single controller?

Is there a way to call multiple blocks in a single controller in Magento 2? The below code only populate the single grid but I want it to return two blocks. public function execute() { /* @...
user avatar
  • 195
0 votes
1 answer
30 views

Capture payment online after create quote programmatically

I need programmatically to capture payment online using the PayPal Payflowpro method and credit card details. Also, create an order number and invoice after creating a quote then setting quote_id in ...
user avatar
  • 11
0 votes
1 answer
40 views

Custom link in order grid not able to access custom controller but forward to order details page

I've successfully create a column in order grid page. The sales_order_grid.xml <?xml version="1.0" encoding="UTF-8"?> <listing xmlns:xsi="http://www.w3.org/2001/...
user avatar
  • 2,048
0 votes
1 answer
32 views

Get Controller of each request

What I want just to print out name of each controller called at a specific request? So How can I do that any help thanks in advance?
user avatar
0 votes
0 answers
21 views

How to link a custom button to a controller file in magento form

So I have a custom module where I have custom form and custom product grid section. So I have created some custom button on both pages through UI components. Now I want to link these buttons with a ...
user avatar
0 votes
1 answer
24 views

Magento 1: Can't override Enterprise/GiftCardAccount/controllers/Adminhtml/GiftcardaccountController.php

I can't override the controller inside of the Enterprise/GiftCardAccount/controllers/Adminhtml/ folder <config> ... <admin> <routers> <adminhtml> <...
user avatar
0 votes
1 answer
251 views

Magento 2 Add Button in Edit Product page and land back there after POST request

So, as the title says, I want to add an Admin button in the Edit Product Admin page. That button, when pressed, will call the respective controller of a URL, sending along the product id, the ...
user avatar
  • 107
0 votes
0 answers
89 views

Magento 2 Admin Menu buttons (UiComponent buttons) behaviour

Question What do I need to setup a Button's behaviour, or is there CRUD built-in Magento 2 behaviour when I do not specify a Controller? This is The tutorial article I am following. I found the ...
user avatar
0 votes
1 answer
33 views

Magento 2 custom dashboard Page

I want to show a completely custom dashboard. I have a controller for that. I just want to show this page when Admin login. I don't want to show the default Magento dashboard controller I want my ...
user avatar
  • 828
0 votes
1 answer
39 views

Magento 2 : Acl admin controller

I can see below code in file use Magento\Backend\App\Action; /** * Abstract assignment controller */ abstract class Assignment extends Action { /** * Authorization level of a basic admin ...
user avatar
  • 367
0 votes
2 answers
173 views

How can i override abstract class protected function

I want to override abstract class Magento\Sales\Controller\Adminhtml\Order\Create of the below method protected function _processActionData($action = null){ } I have tried using preference but it ...
user avatar
  • 5,856
0 votes
0 answers
56 views

Magento 2 how to redirect backend controller to previous page?

I'm trying to redirect a controller that is executed in Order Detail. If I end the controller returning redirect like this, it throws an error: return $resultRedirect; If I end the controller with ...
user avatar
0 votes
1 answer
34 views

check admin loggedIn on frontend magento 2

i have tried through this method public function isAdmin() { $this->_coreSession->start(); echo $this->_coreSession->getMessage(); echo 'session test4'; ...
user avatar
  • 198
0 votes
1 answer
40 views

how to check admin loggedin or not on frontend magento 2 [duplicate]

how to check admin loggedIn or not on front-end magento 2 .I have tried this class BackendAuthUserLoginSuccess implements ObserverInterface { const DEFAULT_SESSION_NAME_OF_FRONTEND = 'PHPSESSID'; ...
user avatar
  • 198
0 votes
1 answer
130 views

how to get magento admin users from magento 1.9

I want to get magento admin users and assign them a mobile number, from each particular agent panel, agent can able make a call from that number.
user avatar
0 votes
1 answer
36 views

Magento 2 admin controller is not working

Here am added a admin controller, here is my code etc/adminhtml/routes.xml <?xml version="1.0" ?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
user avatar
0 votes
2 answers
719 views

save admin form and redirect back url in magento 2.3

I have create admin sales grid. All is working fine. And i have added one link in order view page. This link click redirect custom admin form. And Finally i want to save custom admin form. And ...
user avatar
  • 3,187
1 vote
0 answers
118 views

Magento 2 add text input to massaction from dropdown

In magento 1, if I wanted to add a text input to send a custom value with my massaction to my controller, I would do something like: $this->getMassactionBlock()->addItem('add_ship_method', array(...
user avatar
  • 372
0 votes
2 answers
545 views

Type Error occurred when creating object

I am having the massaction "delete" in the ui_component and it is then process by a controller MassDelete in my adminhtml folder. like this: <?php namespace Apriljune\Testimonial\...
user avatar
1 vote
1 answer
441 views

How To Add Fixed Filter In Custom Admin Block Grid in Magento 2?

Here is my custom grid i wan to show only those data that status is paid but now the data present with paid and unpaid both . how can i set default filter to these custom block grid... here is my ...
user avatar
1 vote
0 answers
246 views

Magento 2 override admin Controller Address Save.php

How to override admin controller address save.php I am using this code - di.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
user avatar
  • 1,143
2 votes
5 answers
4k views

Custom Module Controller: Invalid security or form key. Please refresh the page

I have a custom module with an admin controller, but when I try to access from the administration page I get the following error: My controller is in Controller/Adminhtml/Login/Index.php class Index ...
user avatar
  • 529
0 votes
1 answer
53 views

Find backoffice controller

I have a javascript call to this url : https://mysite/admin/admin/export/export/key/b7c4bdb5a1b9f5147f498741adc99/entity/catalog_product/file_format/csv From this url how can I find where is located ...
user avatar
  • 3
1 vote
1 answer
240 views

Magento 2 admin Ajax call failed bad request

I'm using custom js in Product Add/Edit page of magento 2 admin. I need to make a ajax call when the product save button clicked. I used the below code. require(['jquery', 'domReady!'], function ($) {...
user avatar
  • 828
1 vote
1 answer
609 views

Magento 2 Admin controller is not working 404 error

I don't why my admin controller is not working, I have checked it and everything seems to be ok. This is my code: etc/adminhtml/routes.xml <?xml version="1.0"?> <config xmlns:xsi="http://...
user avatar
0 votes
1 answer
60 views

How to collect customer data who has added the product to wishlist?

I have a requirement that is collect customers data like wishlist, address and send them to another server using SFTP. These all should be programmatically. Could anyone please guide me on this? ...
user avatar
0 votes
0 answers
118 views

My ajax request isn't working properly in phtml

vendor\module_name\view\adminhtml\templates\tab\customer_view.phtml <?php $buttonTitle = __('Invalidate Quotes');?> <div class="fieldset-wrapper customer-information"> <div ...
user avatar
1 vote
1 answer
528 views

Magento 2: Abstract Controller class is not being override

I am trying to override an abstract class vendor/magento/module-sales/Controller/Adminhtml/Order/Create.php using di.xml but it is not working. I need to do some changes in method protected function ...
user avatar
0 votes
1 answer
798 views

How to override product attribute Save.php controller using modulein magento 2?

I am trying to create a module in which I am facing some issues to override Save.php Controller as well as save that data in the new table. here is my updated di.xml code, but now after click on save,...
user avatar
0 votes
1 answer
439 views

Magento 2 Custom Admin module 404 Not Found

I have been struggling with this error all day, I have tried all the solutions on Internet, but it keeps showing 404 Error when I click the link on my custom menu. Here is my code /app/code/Vendor/...
user avatar
2 votes
3 answers
550 views

Magento 2: How to get current category id in admin controller

I have made a custom button on category edit page in admin. The button redirects to custom admin controller. I need to fetch the current category id in the controller.
user avatar
  • 548
3 votes
1 answer
853 views

How can I make my controller return JSON back to my template PHTML

Controller: <?php namespace MyCompany\ExampleAdminNewPage\Controller\Adminhtml\Product; use Magento\Framework\App\Action\Context; use Magento\Framework\Controller\ResultFactory; class Product ...
user avatar
1 vote
2 answers
477 views

How to create controller without creating menu in Adminhtml Magento 2

I have referred below Article to display button in my Configuration page. https://magecomp.com/blog/add-a-button-in-magento-2-stores-configuration-with-custom-action/ In file app\code\Vendor\...
user avatar
  • 765
3 votes
1 answer
466 views

Magento 2 - How to pass parameter from menu.xml

Is there any way to pass a parameter to controller from menu.xml file? Actual URL : http://127.0.0.1/mg231/admin/vendor/module/index/key/...
user avatar
0 votes
1 answer
318 views

Can't access admin after update Magento 2.3.1

I recently updated my Magento 2.3.0 to 2.3.1, and my site works, but I when I try to go to my admin url I get a 504 error. I have tried clearing my cache, and I tried following advice to clear the ...
user avatar
1 vote
1 answer
422 views

Can we redirect controller to another controller in another custom function rather execute function?

Can we redirect controller to another controller in such a way that previous controller continue its working in its execute method and next controller works render the layout at a same time? and after ...
user avatar
  • 1,331
3 votes
0 answers
54 views

Extension works fine on local system but on live instance it gives me error

Can someone please give me some detail about my issue. I am duplicating categories along with the product on my local system it works fine although it takes little more time but works fine on my live ...
user avatar
  • 1,331
4 votes
0 answers
40 views

System stuck on a controller on live instance does not return any thing nor redirect

I am duplicating the category tree with products works fine on my system while checking on live instance. scenario Duplicate category and subcategory but not products works fine. Duplicate category ...
user avatar
  • 1,331
1 vote
1 answer
120 views

Magento 1.9 custom module for managing admin users in different role

Am working on a custom module for managing admin users in a custom role. Just finished the grid section. I need to edit the listed users, also a add form. I just tried by overriding the 'Mage/...
user avatar
  • 147
0 votes
1 answer
315 views

Magento2 Admin UI Component: On fileUploader ajax completion in ui component, how can I reload the page it is on?

I have a grid that just shows a collection of a specific table. below is a file upload component that I want to use for CSV upload, that will replace all old collection. Image reference is below: ...
user avatar
  • 201
0 votes
0 answers
37 views

Magento 1.9 admin menu is going to 404!

I am using custom module to getting tax report. It is working fine on demo site. Below is the etc/config.xml: <?xml version="1.0" ?> <config> <modules> <DS_News> ...
user avatar
  • 1,967
0 votes
0 answers
45 views

Custom action won't work?

My Customized controller seems not work. Added new method which suppose to update some values in table, here is my method: public function reorderAction() { Mage::log('=> test',true,'...
user avatar
  • 867
2 votes
2 answers
169 views

Grid with multiple Resource Models

I'm trying to use one grid for multiple ResourceModels, so far I've got one grid working fine. I can load the grid up fine using http:{}/admin/grid/grid/ However when i create a new route to load ...
user avatar
1 vote
1 answer
737 views

call block from controller via ajax

I call controller function from phtml via ajax, it calls controller function Now i am trying to call block function in controller it is not working Controller code public function __construct( ...
user avatar
0 votes
2 answers
771 views

Registry not working in magento 2

I need to call the controller function from block . in magento 2 i use the registry. In my block i wrote public function __construct( Template\Context $context, \Magento\Catalog\...
user avatar
0 votes
1 answer
901 views

override Magento\Sales\Controller\Adminhtml\Order\Create\Save.php file

How to override Magento\Sales\Controller\Adminhtml\Order\Create\Save.php the file can you please help me out?
user avatar
0 votes
1 answer
59 views

Magento 2 Custom admin module not working

I have created my custom module for order export and this is working fine in my magento 2.5 and magento 2.6 but this OR any other module is installed in my magento 2.2 it will not show in admin and ...
user avatar
2 votes
2 answers
4k views

Fatal error: Uncaught Error: Call to a member function isLoggedIn() on null in

di.xml <preference for="Magento\Catalog\Controller\Adminhtml\Category\Save" type="Modulename\Complexgrd\Controller\Adminhtml\Category\Save" /> Save.php <?php namespace Modulename\...
user avatar
3 votes
2 answers
882 views

Controller function not working after overwrite afterExecute : M2

Di.xml <type name="Magento\Catalog\Controller\Adminhtml\Category\Save"> <plugin name="mymodule" type="Module\Name\Plugin\Controller\Adminhtml\Category\Save"/> </type> ...
user avatar