Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
1 vote
1 answer
2k views

Magento2 : Save Button Not Working in Admin Form Custom Module

I am Working on A magento 2 custom Module i have a Form as well a Product Grid in my form so i created tabs using block but Whenever i click on save button gives me Javascript Error TypeError: $....
5 votes
4 answers
5k views

Magento 2 - Backend custom module 404 error

I'm trying to create my custom module in the back-end, I followed a lot of tutorials, but I continue to get 404 error when I try to access to my controller. The only thing that work fine is the menu ...
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:...
0 votes
2 answers
2k views

Get Wishlist product collection in Controller of Custom module Magento2

I am trying to get Wishlist product collection in Custom module controller for the new functionality. I searched in google and I got this: Inject this class in your constructor: protected $...
1 vote
2 answers
3k views

Magento 2.3.3 - Add file upload field to Contact Page

what is the best way to add a File Upload field in the Contact Page? I want to give users option to upload a file. I try this module but is not work on my 2.3.3 Magento version. Thank you
1 vote
0 answers
106 views

How to add a text on Homepage using module (code) [closed]

Need help writing a code for adding text on Homepage. I'm running Magento 2 on localhost
1 vote
3 answers
6k views

Deprecated Functionality: Optional parameter $data declared

We're in the process of upgrading our store from Magento 2.4.2 to 2.4.4 and encountered the error shown in the image below. Please help us fix this issue. Script in the project folder: <?php ...
1 vote
1 answer
67 views

Send different email template to customer

I have a custom module which is a custom form for the user to book an appointment, this form works fine with no issues, the form once submitted sends and email to both the admin and user/customer but ...
0 votes
1 answer
466 views

what does $this->_coreRegistry->registry('current_category') return in magento 2?

what does $this->_coreRegistry->registry('current_category') return in magento 2 ?
0 votes
1 answer
632 views

Using a data patch to add the block into cms page

my task sounds like : "Using a data patch to add the block into cms page" i have data patch cms block class CmcBlock implements DataPatchInterface { const CMC_BLOCK = 'first_cmc_block';...
1 vote
1 answer
35 views

Getting and Error

I'm installing SEO Suite Installation via Composer but during installation I'm getting an error. Can anyone help me for the solution of this. Screenshot of error is attached.
2 votes
1 answer
28 views

Do I need to make a module or not?

I need a specific equation on some parts of my website, the question is: is it better to create a module, or put all the code in phtml files?
3 votes
3 answers
109 views

Is it possible to execute code for every fired event without too much boilerplate code?

This is mostly out of curiousity, as I think it would be very useful in some situations. Is there are a way in Magento to execute a piece of code every time an event is fired, regardless of the event? ...
1 vote
4 answers
2k views

How to check installed extensions on database magento 2

I need to check installed module on database table I hope your help Thanks Thomas
0 votes
2 answers
20 views

Can not add2cart grouped product when 1 input field is diabled

I need to disable the input field when customergroup = 0 or 1 and quantity is < 0 but when I add the argument 'disabled' to the input, the add2cart button does not put the other available items in ...
1 vote
1 answer
800 views

Magento 2.4 - PayPal Smart Button Style

I want to change the button style of the PayPal Express Checkout, but is not work, I have create a module to rewrite the PayPal but how I can add my changes there? I create di.xml file on following ...
0 votes
1 answer
103 views

Magento 2 - How I can rewrite this file

I want to change the following file: vendor/magento/module-paypal/Model/SmartButtonConfig.php but if I made the modifications directly in the vendor file when I will upgrade my store this ...
0 votes
1 answer
143 views

custom module stop working after Magento 2.4.3 upgrade

I have a module that extend the functionality of other module, in fact it display the product name and product price as a variable, after I upgrade the Magento to 2.4.3 this module stop working and I ...
0 votes
2 answers
519 views

Change order status for custom module

I want to use one offline payment method module, I install this module is there any way to change the status of the order to be Processing instead of Pending? Right now all my orders have status ...
0 votes
1 answer
53 views

Can't access Magento 2.2.1 admin,

Can't access Magento 2.2.1 admin, Stores > Configuration, anyone have this error before? How I can fix this. Thank you 1 exception(s): Exception #0 (Exception): Notice: Undefined offset: 2 in /home/...
0 votes
1 answer
86 views

Folder and file structure for state restriction module in Magento 2.3

I am new to Magento and am using the following "how to" guide to create a state restriction module in my Magento 2.3.3 instance: https://www.dckap.com/blog/how-to-restrict-specific-us-states-in-...
0 votes
1 answer
448 views

Magento 2 - How I can get category for related products

How I can get categories for related products like in the following image: I use this code: $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $category = $objectManager->get('...
1 vote
1 answer
173 views

How to know if my Magento 2 is in developer mode via PHP?

I'm using Magento 2.4 to develop a new module and I need to check if the store is running in developer mode or production mode. How could I get the Magento Mode via PHP?
0 votes
1 answer
105 views

Remove Items from Mass Action Menu

I am using the following to remove an Item from the Mass Action menu in the orders screen, I am struggling with making it work for multiple items. class MassAction extends \Magento\Ui\Component\...
1 vote
2 answers
3k views

Magento 2: How to Override File in Vendor Folder

I installed a 3rd party PHP sdk via composer and need to override a couple files in my own module. However, I'm not quite sure what the best practice is to override these files from the vendor folder. ...
1 vote
1 answer
694 views

Call current product in custom phtml file in Magento 2

On the product page I created a custom module to override the form.phtml file. I also added the option to include a new file called customFile.phtml when the user clicks on a button that is positioned ...
1 vote
0 answers
143 views

JSON response does not return as an array from external API for AyMakan carrier (shipping method module), but still data posted & saved to AyMakan web

I want to get an array as JSON response from POST request to external API for AyMakan carrier (shipping method module), but still OK data posted & saved to AyMakan web server. Therefore, The ...
1 vote
1 answer
374 views

How can i get customer data after registration?

I have the following code but it is not working. vendorName/moduleName/etc/module.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
0 votes
1 answer
114 views

Intercom with Magento 2.3.3 ver problem

we get the below error when we install Intercom on Magento 2.3.3 ver problem https://i.ibb.co/qxSbXSX/2019-12-06-124841.jpg
0 votes
1 answer
628 views

Class contains 1 abstract method

During the install module we get issue: Compilation was started. Proxies code generation... 0/7 [>---------------------------] 0% < 1 sec 34.0 ...
5 votes
3 answers
6k views

magento 2 - backend page with tab and form on custom module

I created my custom module for backend, I created the controller, I added the link on standard menu and the acl configuration, all these part works fine. Now I'm trying to add a tab list on the left ...
0 votes
2 answers
649 views

Magento 2.3.0 Get Country Name

I'm trying to insert the current store country name through a CMS Page/Block by following this article. I've created a Block file countryname.php in app/code/Vendor/Countryname/Block with the ...
3 votes
1 answer
1k views

Magento2.1 Helper; what's the difference between "extend" and "use" of AbstractHelper

In Magento 2 we have to create a lot of data for ourselves using helper-modules. In the Vendor/Example/Helper/Data.php I often see either of these two at the top of the file: use Magento\Framework\...
0 votes
3 answers
2k views

How to re-submit form data in custom module?

I want to get post data in phtml . In case form data not save then show error and already fill form . <form class="trail-register-form" action="<?php echo htmlspecialchars($this->...
0 votes
2 answers
289 views

Magento 2: Getting Error When Adding Customer Address Attribute

I'm using Magento 2.2.3, i need to add Customer Address Attribute, but when i run setup:upgrade I'm getting error of Wrong Entity ID. Here is My code: CustomerAddress\Attribute\Setup\InstallData.php ...
0 votes
1 answer
564 views

Invalid argument supplied for foreach() in /var/www/html/app/code/Ves/Megamenu/Model/Config/Source/StoreCategories.php on line 284

I have this error when I add special characters to menu or categories like "&" It's from module Ves Megamenu. Warning: Invalid argument supplied for foreach() in /var/www/html/app/code/Ves/...
0 votes
2 answers
2k views

Magento 2.3 - Product stock alert not display

I use Magento 2.3 and I create a custom theme based on Luma theme. I enable the Magento_ProductAlert module from backend but the message "notify me when this product is in stock" is not display in ...
0 votes
1 answer
363 views

Magento 2 - Add subcategories images in Top Navigation Menu

I want to add subcategories images in Top Navigation Menu, I found this module but display only parents categories, I need to be on subcategories. I want to be like this:
1 vote
3 answers
2k views

Get Store Information Magento 2.3.0

Using Magento 2.3.0 with php7.1 I'm trying to use this module to get store information. I have modified the folder names as such app/code/Vendor/SiteInfo/Block/SiteInfo.php And used the following ...
1 vote
1 answer
759 views

What is the best version of Magento? [closed]

I will kindly appreciate if you let me know what is the difference between magento versions 1.9.2.4 and the latest one I think is 2.0.10? I am not a developer I just build a Magento website and my VPS ...
0 votes
0 answers
548 views

How to show Prices for OUT of stock products in Magento 2

Here is my question - How to show prices for all out of stock products? Here pic http://prntscr.com/krhurk I created the module from here https://magento.stackexchange.com/questions/160145/magento-2-...
1 vote
1 answer
182 views

Magento 2 - How I can remove default extensions

I want to remove some Magento 2 components like: Magento_Analytics, Magento_Braintree ... I just want to have just a product management system. How I can remove this modules completely, files and ...
2 votes
1 answer
726 views

Notice: Undefined index: modules in ../Converter.php line 47 - Magento 2 - (Solved)

Hi i am getting error in magento 2 frontend after creating my custom module.(Here mmm2 is my magento directory) a:4:{i:0;s:134:"Notice: Undefined index: modules in /home/vhost/_default/mmm2/lib/...
1 vote
1 answer
1k views

Magento 2 custom module - get media base url

I use this module and I create a image upload field in my custom module. Everything is okay but I want to get the full url of image in the frontend. How I can do this? if I use this in the Data.php ...
0 votes
1 answer
960 views

Magento 2 Custom Module Insert Data Issue not working

I want to save custom data from Ajax Request in my database but it's not working and not saving any data. namespace/Getquote/controller/index <?php namespace namespace\Getquote\Controller\...
0 votes
1 answer
151 views

Magento 2 Custom Cli comand Area not set

I am geting this error comand "[Magento\Framework\Exception\LocalizedException] Area code is not set " this is my code which I want to add a product. Tip if a comment " $product->save();" I am not ...
0 votes
2 answers
72 views

Magento 2.2 - I need little help with install one module

I try to add this new module in Magento 2.2.2, but after php bin/magento setup:upgrade nothing happens. I try to enable this module in the app/etc/config.php too but is the same. I can't install it. ...
0 votes
1 answer
995 views

Magento 2 custom module install issue

I create a new custom module for Magento 2 and I can't install it through composer. This is the error: Your requirements could not be resolved to an installable set of packages. Problem 1 ...
2 votes
1 answer
8k views

Missed required argument request in parent::__construct call

I'm working on a Magento module for the past month, and everything works great on my local machine. Then I decided to release the module as a beta and test it online in a newly installed store, and ...
0 votes
1 answer
215 views

Magento 2 custom module admin field output must be true

I want to add a filed in the Magento 2 admin panel, this field must return in the frontend True if in admin is selected Yes. I try to add this in the system.xml: <field id="do_something" translate=...