All Questions
116 questions
12
votes
7
answers
49k
views
Magento2 : How to get product id to my custom module
I am new to magento2 and currently I'm building a custom module and i want to get the product ID/SKU from the catalog.
I'm trying to call using a function located in the Block folder. please advise!
11
votes
3
answers
10k
views
Magento 2 How to uninstall attributes added by custom module?
So far I know that when uninstalling a custom module, it is possible to remove custom tables or columns added by custom module by using uninstall.php which extends \Magento\Framework\Setup\...
9
votes
6
answers
12k
views
404 Page not found error when I try to access Custom module in Magento 2
I have created 2 custom module inside vendor folder .This is my layout structure :
-app
-code
-Company
-Blog
-HelloWorld
-Controller
-Hello
-World.php
...
6
votes
1
answer
2k
views
How does the payment gateway works in Magento 2?
I want to integrate my own payment gateway in Magento 2. I've read many topics, studied the sample code from the Magento 2 repository and the braintree module.
However I've not found great posts ...
5
votes
2
answers
11k
views
Magento2 : Retrieve Multiselect Values in system.xml
I have created a system.xml file with a multiselect type field somewhere in my admin system config. I just want to know on how to retrieve the selected values in that field?
5
votes
1
answer
14k
views
Magento 2: Creating a custom layout
I'm having trouble creating a custom layout. I have successfully created a layout called home_page.xml which is a copy of the default 1column layout.
I have selected this layout for my home page, ...
5
votes
2
answers
528
views
How to use Custom Module Js to RequireJS
I add my custom Module to JS to requirejs-config.js File
var config = {
paths: {
'Test/jquery':"Test_Header/js/jquery.min" ,
'Test/popup':"Test_Header/js/jquery....
5
votes
5
answers
9k
views
Custom router is not working in Router.php Magento 2 [SOLVED]
I am trying to redirect the page/action by using a custom router as Router.php, but I am getting 100 router match iterations exception.
app\code\Custom\Module\etc\frontend\di.xml
<?xml version="1....
4
votes
1
answer
10k
views
Magento 2: Check condition on Click of "Proceed to Checkout"
May be I need to create Event Observer. I would like to check Product's Type Condition & Display Message Accordingly on Shopping Cart Page.
<event name="...
4
votes
1
answer
1k
views
Magento 2: When registration.php is called?
When we built/install new module it should have registration.php as per Magento Standard.
When we run php bin/magento setup:upgrade. Module will be installed.
How actually this command check for my ...
4
votes
2
answers
128
views
Injecting code into theme product page
The may well be too broad of a question, but I'm having extreme difficulty finding any answers. I want to know if its possible to add a phtml block/view to a product page when you have a theme ...
4
votes
6
answers
811
views
Getting Items in Cart
I've tried many methods over the web including here too but still I can't seem to be able to get items currently in cart, tried checkout sessions cart model, cart helper nothing works, It sometimes ...
4
votes
0
answers
2k
views
How to create a custom Report in Magento2 [closed]
How to create a custom Report in Magento2. Please provide any sample code / link.
4
votes
1
answer
2k
views
Magento 2: Fatal error: Uncaught Error: Call to a member function getId()
After adding custom module on Server. It's giving below error
Fatal error: Uncaught Error: Call to a member function getId() on null
in
/var/www/html/magento/vendor/magento/module-backend/Block/...
4
votes
2
answers
3k
views
Magento 2 custom module not loading and it throws error
I am using windows 7.
app\etc\config.php
<?php
return array (
'modules' =>
array (
'Test_Module1' => 1,
),
);
?>
When I add My Test_Module1 in app\etc\config.php admin all ...
3
votes
3
answers
8k
views
Magento 2: store selector for custom module in admin form
Stuck in a new issue regarding adding store selector for my custom module in admin form -
I need to add a store selector and to add the values of a store in a different table as it is working with ...
3
votes
1
answer
5k
views
Checkout page phone number validation
I am trying to give US format phone number validation in onepage checkout page
This is the layout checkout_index_index.xml that i created in my custom module. I know how to make i work by editing the ...
3
votes
2
answers
9k
views
Magento 2 - Element with same id already exists
I'm trying to set the Magento 2 pager on my custom module, my custom module get the product collection and makes some special filters on the collection. I'm able to filter my products, but when I try ...
3
votes
1
answer
2k
views
How to add default header and footer to a custom mail on magento 2.2
I have created a module where I send a custom mail.
For this, I have a custom email template.
Now what I want to do is to include the default header and footer that appears in all my Magento emails, ...
3
votes
1
answer
1k
views
Magento 2 online refund for custom payment method
I am developing a Magento 2 custom payment module for one of my clients, yet I am now totally blocked in finding a way to process an online refund for any of the created orders. I can't locate the ...
3
votes
0
answers
105
views
Production mode doesnt load any content for custom module
I have created a custom module in Magento 2. In developer mode it is working well, however same module does not show any content in the production mode of Magento its show only white screen. There is ...
3
votes
1
answer
213
views
How can i add a custom javascript module to custom module?
Hi this code is working perfect without magento.
<script src="flipbook.js"></script>
<script src="jquery.js"></script>
<script>
$('#side').FlipBook({
pdf: '...
3
votes
1
answer
675
views
How to Create Custom Grid Filter Show All "NULL" Values in Specific Column
How can I make a filter for null values of my order ID
<column name="order_id">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
...
2
votes
3
answers
4k
views
Create custom route in Custom module magento 2
How to create a custom route in Magento 2
http://127.0.0.1/magento8/trails/post/view/id/13
module:- trails
folder :-post
controller :- view
argument :-id/13
I want to http://127.0.0.1/magento8/...
2
votes
1
answer
2k
views
Magento 2 Create observer on customer create, with custom module
I want to create an observer in my custom module which called when new customer create and delete.
In my custom module i want to add custom data when customer created and delete custom data when ...
2
votes
2
answers
2k
views
How do i add product grid in customer admin section and save the checkbox values to database
I want to add product grid in Magento 2 admin customer section with a separate tab, that I got completed, but when I select the checkbox values from grid and hit save.
It does not get the values of ...
2
votes
1
answer
2k
views
Magento 2: Server side validation not showing filled up data while error [SOLVED]
I have below code
app\code\Custom\Module\Controller\MyModule\PostForm.php
namespace Custom\Module\Controller\MyModule;
use Magento\Framework\App\Request\DataPersistorInterface;
use Magento\...
2
votes
1
answer
320
views
Category-Listing on Custom Page
I want to show the category-listing on a custom module-page.
For example: [url]/brandstore/index/listing/brand/1/category/10
I tried to copy the content of the catalog_category_view.xml to my custom ...
2
votes
2
answers
207
views
want to add custom module in magento 2 admin panel
Created folders and added code for the custom module but nothing gonna work in my way please help, nothing shown up in the admin panel.
Here's my code and folders that I created:
public_html/testing2/...
2
votes
3
answers
61
views
What are the only needed files for custom module?
I've seen a lot of tutorials on how to create a custom module in Magento. But all of them are mostly those helloworld examples.
I'm wondering what files do we actually have to create in order to ...
2
votes
2
answers
898
views
Unable to override Fulltext\Collection in module etc/di.xml
Preconditions
Magento 2.1.1
Using Ubuntu/trusty64 vagrant-box, php7, apache
Steps to reproduce
Add a new custom module
Update etc/di.xml in your custom module
<?xml version="1.0"?>
<...
2
votes
1
answer
3k
views
Cannot see new custom Module in Magento 2.1.2
I am new to Magento, and I am trying to do add my very first module. I tried to follow two tutorials that show how to create a "Hello World" module, which basically shows a 'Hello World!' message on ...
2
votes
1
answer
3k
views
Magento 2 | Add Admin Configuration Button Action
I need to call a method from an admin configuration button. This is my simple custom module. The button appear on admin but notthing appen on click. No log is write. I cannot understand what I am ...
2
votes
1
answer
1k
views
Magento 2 : Custom model with EAV attributes. PUT is not working
I'm trying to figure out how works EAV attributes. So I made a simple example with API rest. Everything is working except when I call PUT function:
{
"sample" : {
"id": 22,
"name":...
2
votes
1
answer
2k
views
Magento 2: Use Custom Variable in Layout File
We can use Magento default variables in layout file using
<item name="link" xsi:type="string">{{baseUrl}}</item>
I would like to create one variable in Block File & Use it. Like
...
2
votes
2
answers
4k
views
Custom Translation of Backend in Magento 2 - path of the translate.csv?
I am familiar with translations in Magento 1 and found out also how translations in M2 work for the frontend. My questions is where to do my translation for my own custom module for the backend. Is ...
2
votes
0
answers
2k
views
Magento 2: Create a custom module for banner slider
I want to create a custom module for banner slider in Magento 2. Could anyone please guide me?
Looking forward to hearing from you.
2
votes
1
answer
370
views
Blank Magento Page without error
After enabling the module created, browsing back to the page gives me blank page instead. Viewing the source of the page gives me basic html tags.
2
votes
0
answers
212
views
Update Store Summary By Checkout Address Country Change
So Basically I want to update my checkout cart summary when user select country from shipping address ,cart price and currency change according to the country he selected in shipping address.
2
votes
1
answer
438
views
Magento2 : Create SOAP connection in magento custom module
I am using below code in M1 to establish the connection using SOAP:-
<?php
class Company_Module_Helper_Webservice extends Company_Module_Helper_Basehelper
{
private function ...
2
votes
1
answer
2k
views
Magento 2: How to define scope in di.xml & Router.php
I'm using Magento 2 CE Version 2.1.0.
app\code\Custom\Module\etc\frontend\di.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
2
votes
1
answer
2k
views
Magento 2: Submitted Form not calling Controller
To continue with the question below
Magento 2: How to define Scope For Router.php
app\code\Custom\Module\view\frontend\templates\posts\view.phtml
<form class="form post reply"
action="<?...
1
vote
2
answers
8k
views
How to change the price in quote while adding product to cart?
I want to apply a custom price for the current order. I read that I should use sales_quote_add_item, But its looks like I am doing something wrong. I found some tutorials for magento1 but not for ...
1
vote
2
answers
2k
views
How create Custom Pdf in magento 2 Like invoice , Shipment [duplicate]
I want to create custom pdf with custom text or media
can anyone suggestion me any best link or some help
Thanks
1
vote
3
answers
7k
views
Magento 2 - How can I define constants or variables once and reuse them in a custom module?
I have a few constants that I'd like to define once and reuse many times within various files throughout my custom module. For example, I write log entries to a custom file. I'd like to add its pre-...
1
vote
1
answer
3k
views
Magento 2 Custom Module Frontend Error
I'm using Magento 2 CE Version 2.1.0
I'm following http://www.mage-world.com/blog/how-to-create-a-simple-module-in-magento-2-0.html
I have followed steps when i run it gives below error.
{folder
...
1
vote
2
answers
901
views
registration.php and enable custom module
I am new to Magento and PHP, and I am using Magento 2.1.2. I tried to create a new module as explained in http://magentoexplorer.com/how-to-build-hello-world-magento-2-module-from-scratch. After ...
1
vote
2
answers
928
views
magento 2 - custom router throws Front controller reached 100 router match iterations error
I am trying to build a module that has a custom front-end router on magento 2.1.12. I am following magento doc & I am using the inchoo custom router example.
The problem is the route (MY-SITE/...
1
vote
1
answer
84
views
Magento 2 - Creating admin page error 404
I have create an admin page but i get 404 error. What i'm wrong?
etc/adminhtml/routes.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
1
vote
1
answer
2k
views
Magento 2.2 : getcollection is not working in the Block
My custom collection is not working in block file Helloworld.php
<?php
namespace New\MyModule\Block;
use Magento\Framework\View\Element\Template\Context;
use Magento\Framework\View\Element\...