Questions tagged [controllers]

Denotes questions about controllers and action methods

Filter by
Sorted by
Tagged with
0
votes
0answers
6 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(...
0
votes
1answer
30 views

Magento 2 Create Controller With No Theme?

Is it possible to create a controller with Magento 2 that doesn't have the admin menus/navbars? Essentially I want the page to return just the HTML I write and not put anything else? I considered just ...
0
votes
1answer
18 views

Missing 'return' statement in frontend Controller execute() method (IDE warning notice)

I recently use PhpStorm to write my code and it finds an error in a controller who get data from a <form> to save them in a custom model. (works fine even without correction). Class ...
1
vote
1answer
37 views

Create New Module get 404 error(How to debug code)

Hello, I have create new custom module and run frontend get 404 Page error. How to debug module what problem in code ? Please Help me. THANKS.
0
votes
1answer
23 views

Magento2.3.5: How to override \Magento\Checkout\Controller\Cart\Index Controller?

I was trying to override \Magento\Checkout\Controller\Cart\Index controller. I created a di.xml file <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
1
vote
1answer
37 views

How to get product from custom attribute in Magneto 2?

I have a Custom attribute on Product in which i have save a string i want to get count of those products which have same attribute value in Magento 2 using an Controller or Model.
0
votes
0answers
18 views

Add link and to backend modal and pass values to controller

I have a PrintButton on the backend which links me to a controller. This button should open a modal with a radioset of buttons and pass this to the controller. The xml of the backend page: <...
1
vote
0answers
29 views

How to call function in my controller in browser url which shows 'hello world' in magento 2.3.5

I am here trying to make a hello world message when trying to access my controller function using browser url demomagento.com/app/code/Icosmoz/Unicenta/Controller/Adminhtml/Home/index.php This is the ...
1
vote
2answers
56 views

How to pass Data from a UI Component Form to a Controller?

Hey I'm beginner at Magento 2, and i don't know to much about UI component... I'm creating a register form, and i want to pass Data of a UI Component Form to a Controller. So i have a Form and i got a ...
0
votes
1answer
13 views

Requesting controller action via Curl request

I am sending a CURL request to a controller action and construct() function is working(calling) but it doesn't call the execute() function of the controller. For now, I am calling the execute() ...
0
votes
1answer
32 views

Magento admin ajax call file upload

I'm trying to make a ajax call in admin page to upload a csv file in directory then to make a stock update function. In my PHTML: <form method="post" enctype="multipart/form-data" id="ajaxCall" &...
0
votes
0answers
13 views

Request validation failed for action "Apriljune\Testimonial\Controller\Index\Add\Interceptor

Here is the controller that is responsible for adding the form data from frontend to multiple database tables. namespace Apriljune\Testimonial\Controller\Index; use Magento\Framework\App\Action\...
0
votes
0answers
14 views

Bundle_option_qty not working, with programmatically add bundle product to cart (magento 2.3.2)

I would like to add a bundle product to cart programmatically, however i'm experiencing a problem with the bundle_option_qty. I can change the selection of the bundle option, however the code is ...
0
votes
1answer
23 views

Custom Router not working with IndexController in the same module

I have a module with a custom router. Here's the code: di.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:...
0
votes
1answer
21 views

Magento2: why all my post request to my controller been forward

I'm developing a module for the payment method. So I need to revise post requests with pay results but all Post requests send to my controller been forward to the home page. If request type is Get, ...
1
vote
0answers
48 views

Error add new block into block Magento 2

I'm using Magento 2.3.4 and t tried to append a block to another block like this in my controller: $category_list_subcategories = $resultPage->getLayout()->getBlock('promotion.view....
0
votes
0answers
20 views

PHTML receives no response from the Ajax Controller

In order to be able to load the product list according to the customers' selection, I tried to use an Ajax query. However, I have the problem that I do not receive the response from my controller. The ...
0
votes
1answer
43 views

magento 2 “Header already sent ” issue when there is large data in array and json_encode function using in ajax controller

I am developing functionality in Magento 2.3 version and calling controller function by using Ajax. Controller function return product data and everything is working fine when customer is not login. ...
0
votes
1answer
33 views

when iam paasing arugment to helper from controller iam getting error magento 2.3

Iam Getting the below error Recoverable Error: Object of class Magento\Framework\App\ObjectManager could not be converted to string in /var/www/html/development/amt/app/code/vendor/...
0
votes
2answers
20 views

Category Controller overriding to allow multiple Categories in URL

My custom module (AKA AraujoPhillips/SpecialCategories) should allow URLs with multiple categories, like: example.com/category1/category2.html example.com/sales/phones.html The following custom ...
0
votes
4answers
52 views

How to implement a redirect to a custom success page after submitting a form on a custom page (similar functionality like checkout)

I have a submission form and a controller, with the execute method. At the moment, after sending the form, my page reloads and on top of the page I get an alert that notifies the user about the ...
0
votes
0answers
17 views

Vertical rendering for a pdf file using Zend PDF in Magento 2

I am trying to render a pdf vertically. This is my code from my controller: public function execute() { $request = $this->getRequest(); $pdfFile = $request->...
1
vote
1answer
271 views

Magento 2 - How to add Popup on Custom Button in Order View Page and pass information to Controller for further action?

I have added a custom button on the Sales Order View page in Admin using Plugin. When that button clicks it should open a popup with form and when I submit that form then this information should pass ...
0
votes
1answer
80 views

How to set content-type header as JSON in controller Magento 2.3

I am having the controller which is responding with resultJson(\Magento\Framework\Controller\Result\JsonFactory), I have given setData. And I need to set header as JSON. I want the JSON result in the ...
0
votes
1answer
58 views

Magento 2 Webhook

Can someone help me with this issue, i'm using Braintree webhook, which is sending post data to my Magento 2 controller route, but from some reason, it always redirects me to home page, giving me 302 ...
0
votes
2answers
100 views

Magento2: Create Module without Controller [duplicate]

How to create a simple module like HelloWorld in Magento2 without controller
0
votes
0answers
22 views

Magento 2 - Display product list filtered by price range

The module I'm working on has a form with three inputs, Low Range, High Range and Sort By Price. For some reason it's not returning the product collection at all. I'm getting the following error: ...
1
vote
1answer
47 views

Error in Curl request with response in Controller

I'm trying to get curl response from js (cc-method.js) file. The curl call code is in controller file domain.com/frontname/section/index. Below is the code, public function execute() { // create ...
0
votes
0answers
14 views

How to fetch id from custom grid in Magento 1.9?

I want to fetch custom module ID and pass that ID to the form through Controller, How Can i make if($data['email']!="" && $data['phone']!="" && $data['name']!=""){ ...
0
votes
0answers
15 views

Image is not saving when upload it from frontend custom phtml file

Images are not saving when upload it from frontend custom phtml file, image names are adding in database but it is not saving in media folder Here is my Controller $path = Mage::getBaseDir('...
0
votes
1answer
19 views

Get Url of remote server

A 3rd party server is calling my webhook api controller method. Is it possible to get the URL of the server calling my magento server. I tried looking for a solution but could not find any.
0
votes
1answer
30 views

Magento controller only executing once - cannot disable cache

I have a controller that only executes once after the cache is cleared. After that the response is always the same - cache is there instead of a new execution. The class is extends\Magento\Framework\...
0
votes
0answers
24 views

Unable to access controller using AJAX in magento 2

I Have a very basic ajax function, where i want to access to the controller using AJAX.Below is the code. <script type="text/javascript"> require(['jquery', 'Magento_Customer/js/customer-data', ...
0
votes
1answer
30 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 ...
0
votes
0answers
11 views

Magento 2 in how to upload the image in multiple images (image.jpg,image1.jpg) ? ita not working in this magento fields add options

Magento 2 in how to upload the image in multiple images (image.jpg,image1.jpg) ? ita not working in this magento fields add options I need the upload image with in multiple image select to upload, ...
0
votes
1answer
46 views

Remove Item from Minicart throws Invalid Form Key error in Magento 1.9

I had installed a fresh setup of Magento ver 1.9.3.9 and when I add the product to cart and click on Remove Item from Minicart it gives me exception error and page goes to There has been an error ...
1
vote
1answer
625 views

Magento-2.3.3 getting “Request validation failed for action” error while accessing front controller url when receiving data from third party webhook

I have created one front controller in my project in order to receive data from third party webhook (e.g. sendgrid). However, when webhook access this url magento logs below error in debug.log file ...
1
vote
2answers
143 views

Magento 2 : Confirm Form Resubmission Error in Controller

I'm getting this Confirm Form Resubmission error in the Controller while going back to the browser. No errors found in Logs and Console. I'm getting this below in headers, in the Network tab. ...
0
votes
1answer
36 views

Magento 2 How to pass data from Controller to Block

I need to send data from controller to Block, I have used many ways but it does not work. I'm trying this way: Controller.php public function execute() { $order_id = $this->getRequest(...
1
vote
0answers
33 views

Excess qty adding into cart when adding product in cart with custom option programmatically

I am using this the following code to add a product in cart with custom option value. But all the time cart qty taking the value of "Maximum Qty Allowed in Shopping Cart" and then adding 1. For ...
1
vote
1answer
30 views

Magento2.3: How to send a file to another server?

I have a requirement that is sending the customer details like their wish-list details, address, names, etc., to another server(I have all the credentials for that server with me). I want to send ...
0
votes
1answer
37 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? ...
0
votes
0answers
38 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 ...
2
votes
0answers
48 views

Redirect to Magento2 website with session id

We have a small requirement like a punchout payload concept. The user will redirect to Magento 2 website from 3rd party with the session_id. We want to capture that session_id and implement our logic. ...
0
votes
1answer
149 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,...
0
votes
1answer
160 views

Magento 2 Programmatically adding a ViewModel to a Block when Creating it

I have hit a problem when trying to create a block in a controller in so much as I need the block created in the controller to also create a ViewModel type object. What I am trying to achieve but I ...
0
votes
0answers
14 views

Magento 2 get Controller data in the same page it was sent

I got help to accomplish send data from Controller to a Block, and then display the info from Block in a template. The thing is that I want to send a form and display the data from that form in the ...
0
votes
0answers
8 views

how to possible magento 2 payment card information pass to custom controller

how to pass this card information to another controller in magento 2
0
votes
0answers
177 views

Magento 2 Return Controller data in the same page

I got help to accomplish send data from Controller to a Block, and then display the info from Block in a template. The thing is that I want to send a form and display the data from that form in the ...
0
votes
1answer
182 views

Magento 2 - Call Ajax controller on click of place order?

I've set up the JS, and controller and checkout.html I need to call the controller with ajax to getPrice() method. My controller name is GetAjax.php and here is the controller code. <?php ...

1
2 3 4 5
18