Questions tagged [controllers]

Denotes questions about controllers and action methods

Filter by
Sorted by
Tagged with
0
votes
2answers
50 views

Magento2: Create Module without Controller [duplicate]

How to create a simple module like HelloWorld in Magento2 without controller
0
votes
0answers
16 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
20 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
11 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
18 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
20 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
21 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
19 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
10 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
24 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
2answers
85 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
76 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
26 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
26 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
27 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
31 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
34 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
42 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
64 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
48 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
13 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
7 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
84 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
115 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 ...
0
votes
1answer
131 views

Magento 2 pass data from Controller to Block and display in Template

I'm a little bit stuck. I want to send a form and display it in a phtml. Here is my code: 1. Controller Search.php <?php namespace Vendor\SearchStores\Controller\Index; use Magento\Framework\...
2
votes
1answer
65 views

Magento 2.3 - How to pass array from controller to template

I am working on a custom module. I am getting array of attribute values in my custom controller and I want to pass these values in my template to list in a select dropdown. Please provide a solution - ...
0
votes
1answer
22 views

Why is the name “Model” in a controller action not allowed?

I created a new controller action called "AddEmailToCustomerModel" But I got an exception after trying to call the route: Exception #0 (Magento\Framework\Exception\RuntimeException): Type Error ...
0
votes
1answer
27 views

redirect to controller from script file with param in Magento2

I have created a script file in root folder of the magento as like below <?php error_reporting(E_ALL); use \Magento\Framework\App\Bootstrap; require __DIR__ . '../../app/bootstrap.php'; $bootstrap ...
0
votes
2answers
24 views

Magento 2 : Check log in customer email id while applying coupon code on cart

I want to check customer's email id when he is applying coupon code on cart page. If customer email is valid for that coupon then coupon code will be apply otherwise display an error. For this, i ...
0
votes
2answers
112 views

How to override the category controller in Magento 2.3?

How to override the category controller in Magento 2.3? Please give me any solution?
0
votes
2answers
66 views

Magento 2 : Can't able to override controller

I need to override this below controller : Magento\Catalog\Controller\Adminhtml\Product\Attribute\Validate.php But, I can't able to override. I need to customize checkUniqueOption() function. di....
0
votes
1answer
23 views

How to set GrandTotal in the magento 2.3 via controller?

Kindly give me an example about how to set GrandTotal via the controller in magento 2.3. I am new to Magento.
0
votes
3answers
174 views

How to get product collection in controller in Magento2

I am creating a new module in magento2 and in controller file, I try to get product collection in controller index.php file so how can I get product collection in Magento 2. so give me suggestion to ...
0
votes
1answer
30 views

magento 2 get first level category from current catgeory ID in controller

I am trying to get first level category from current category ID in my controller . For example- I have Maincategory SubCategory1 SubCategory2 SubChild1 SubChild2. ...
2
votes
1answer
53 views

How to execute custom controller action for product in magento2?

I would like to write some custom code product actions in a controller is executed. When I have click on the product than showing multiple brands and after that click on brand then show product ...
1
vote
1answer
61 views

Magento2 : How To Solve Controller 404 Not Found Error On Live Server

I have create one controller and it is working fine in local environment but when i upload that files to live server is shows 404 not found error, These are my code, please let me know if anyone have ...
0
votes
1answer
39 views

Magento 2: Call Controller method from Model

How to call the controller method from model? Or How to programmatically reindexing using API? Here is my code.Below code gives me error like below. { "messages": { "error": [ ...
2
votes
4answers
106 views

Magento 2: Call to a member function setState() on array

I want to change the order Status programmatically but when I run the function realTest() as I mentioned below then it gives me an error Call to a member function setState() on array in the below ...
0
votes
3answers
62 views

How can I change the Order Status in Controller. Magento 2

I'm trying to change the specific order Order Status. for that I tried. <?php namespace Vendor\Module\Controller\Index; use Magento\Framework\App\Action\Action; use Magento\Framework\App\Action\...
0
votes
2answers
139 views

Magento 2 how to get all categories of a product in controller

I am trying to get all categories with their levels of a product through it's ID in my controller which is overriding default magento controller. Can I get product's category path url through it's id ...
1
vote
2answers
268 views

Magento 2.3: Call to undefined method Magento\Framework\View\Result\Page\Interceptor::setPath()

I want to configure Nextopia Extension, i installed it properly after that when i go to this URL http://mysite.dev.us/nsearch, i get an error like this: And the file /app/code/Nextopia/Search/...
0
votes
2answers
33 views

Get Model Data in ajax request

I am making an ajax request in my module to grab some custom CRUD data to populate a select box on the fly. I have a working ajax request and controller Javascript define(["jquery"], function($){ ...
0
votes
3answers
48 views

Block not showing in custom frontend controller

Here is my custom frontend controller namespace Namespace\Testing\Controller\Payment; class Failure extends \Magento\Framework\App\Action\Action { /** * @var \Magento\Checkout\Model\Session ...
0
votes
2answers
50 views

Custom controller action to specific path in magento 1.9

how to redirect the custom controller path to specific store name http://testurl.com/testmodule/index/testview/id/123/ to http://testurl.com/testname thanks
0
votes
0answers
201 views

Magento 2 A customer with the same email already exists in an associated website error

I'm stuck in a weird problem. Everytime I try to create an account and add an address to that account programmatically I get an error called A customer with the same email already exists in an ...
0
votes
2answers
61 views

Magento 2: Use a custom controller as website root?

I'm building a little module on magento2 and I can currently access it at mysite.com/test/mymodule. I want to be able to access it at mysite.com. How can I do that? I've tried doing a URL rewrite ...
1
vote
1answer
72 views

GET Products by brand and category

I'm trying to create some type of search method for customers where they select the product's brand they want to search and then, if they want, they can also select the category they want (if there ...
1
vote
1answer
95 views

Magento 2 how to receive a webhook body?

I'm doing an integration with a system called Sift Science. What I need to accomplish is to receive a response whenever someone in Sift Science performs an action (for example> Approve account, ban ...
3
votes
2answers
81 views

Controller URL does not work

I have the problem that i always get the error 404 not found, if I want to get the url of my controller. This is my filestructure: And this is the URL I am trying to get loaded: http://localhost/...

1 2 3 4 5 18