Questions tagged [router]
The router tag has no summary.
114 questions
0 votes
1 answer
43 views
Create cutom router for redirecting to homepage || Magento 2
In Magento 2, I want to set custom route, like after baseurl/custom-route/any url it should be redirected to homepage or base url. Here, I had tried to create type of RouterList and extend ...
0 votes
1 answer
59 views
Redirect 404 Pages to HomePage
I am redirecting 404 pages to the homepage, but the URL is not changing it's the same 404 page URL I want to change it to the homepage. My code : <?php namespace Vendor\Module\App\Router; class ...
0 votes
1 answer
334 views
Magento 2 different routes per store view
I have one online store with two store views, English and French. How can I add different routes per store view in a custom module on a Magento 2.4 store, following the attached example? EN: www....
1 vote
1 answer
143 views
Route to Existing Layout
I am working on a custom page module and want to make a custom route however I would like to use the catalog_category_view.xml layout, instead of the [module_name]_index_index.xml needed for my route ...
0 votes
2 answers
729 views
Magento 2 How create front controller with a specific path?
I want create controller for specific path, but i can't know how i can do this. My controller must work with path like: site.com/usa/some-review/dynamicParam My path for controller: site.com/some-...
0 votes
2 answers
1k views
Magento 2 Custom Controller Action Created Using New Module Route Not Working
I am using magento2.3.5-p2 community edition ( open source ) I want to create a custom Controller so that I can post data using ajax to the Controller function created client side will call the ...
0 votes
1 answer
1k 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 ...
0 votes
0 answers
55 views
Magento simple module
i have an new module at app/code/MyVendor/MyModule and i try to understand structure of module magento2. I have some task of trainning list.I have an controller with execute() method echo sometext to ...
0 votes
0 answers
122 views
How to log route for every url?
I am trying to get the list of routers and followed this available module, but I am trying to get the router for every url that executed on the browser. In the code as shown below. foreach ($this->...
0 votes
0 answers
36 views
Custom route module not working anymore
I'm trying a page from a custom module, but the magento is showing me this message The URL you request is not accessible. This url is (usually) reachable, I made it over a year ago and didn't change ...
0 votes
1 answer
291 views
Route blog URL to custom route
I am using Magento 2 Magefan blog extension. The blog post URL is generated as below. http://store-url/blog/post/hurry-xmas-with-family But I want URL as below and it show the content of the above URL ...
0 votes
1 answer
633 views
Uncaught Error: Call to a member function dispatch() on null
i am creating custom tab for frontend customer dashboard. it works well but after click the custom tab, the error of the title occurs. nothing comes on debug log. this error occurs before the ...
0 votes
3 answers
2k views
Magento 2 Create Controller rendering Blank Page
I am new to Magento and I tried this tutorial where I will create a controller for Magento 2. https://www.mageplaza.com/magento-2-module-development/how-to-create-controllers-magento-2.html My problem ...
1 vote
3 answers
664 views
Error : Incompatible argument type
I am facing an error while running command di:compile This is my block file <?php namespace Company\Module\Block; class Booking extends \Magento\Framework\View\Element\Template { /** * ...
2 votes
1 answer
181 views
Add a custom/programmed block to a CMS page
I have created a page using the CMS (via Admin Portal) and now I want to add a custom block (programmed) to the page. You can see the created page here: My structure is the following: but ...