All Questions
1,419 questions
0
votes
2
answers
3k
views
How to add phtml file at edit tab of Magento 2 custom module in admin?
I have created a custom module. When we click on the admin grid to edit, it opens edit page. In that I am showing tabs. When I click on that tab I need to show template file. If you see the below ...
0
votes
1
answer
2k
views
How to change price for configurable products in Product Listing using drop down options in Magento 2
I have created a custom module in magento2, and I want to show configurable products options in the drop-down for the configurable product.
I have done using custom code, but problem is that when I ...
0
votes
1
answer
148
views
magento 2 admin not working correctly
I used wamp to install Magento 2 but admin not working correctly, how can I fix it
when I opened "inspect" I found this error
0
votes
3
answers
89
views
How to show custom block on success page programmatically
I'm using Magento 2.4.7-p1 and I'm trying to show programmatically a customer block on the success page from my module but without success.
The module seems correctly enabled and registered but the ...
0
votes
2
answers
2k
views
Magento 2 Get data to admin UI Form without key and collection
Is there a way to get data from a DataProvider to my UI Form component, without having a collection or a key?
My DataProvider currently only has a "getData" function and the form is rendered, but I ...
4
votes
5
answers
8k
views
Magento 2 : We cant place the order : SQLSTATE[HY000]: General error: 1449 The user specified as a definer your_db_user@% does not exist
I have migrated a Magento 2 site to a new server and getting the below error when placing order
We cant place the order :
SQLSTATE[HY000]: General error: 1449 The user specified as a definer
...
5
votes
1
answer
3k
views
Create custom “Catalog Input Type for Store Owner” for magento 2
I need to create a special input type in adminhtml product form. My input will display as a table but save data as a standard text input.
Following the module Edge ProductAttachments I've created the ...
1
vote
1
answer
2k
views
Magento 2 - Prevent form submit on page reload when Product add from sample script to Magento Shopping Cart
Below sample PHP script will list simple/configurable product with add to cart button. When user clicks on submit button, it will redirect to Magento shopping cart page and selected product will be ...
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.
0
votes
1
answer
110
views
Magento 2 - Add 2 New fields in bundle item option Selection
I'm trying to create a module which adds 2 fields in bundle option.
I've already managed to add 2 field:
However, it doesn't save the values in my database.
The columns are created, but they are not ...
4
votes
2
answers
7k
views
Magento2 : How to add Observer for catch when new order placed
I wanted to save the orders from magento2 to my local Database.
I am planning to Create a module and add Observer to catch once a order is placed.
I don't know much about the Events & observer, ...
2
votes
3
answers
2k
views
How to call an observer from custom module: Magento 2
I built a custom module which has a custom observer OrderSaveAfter.php. How can I call any function inside the custom observer from another custom code ?
2
votes
1
answer
3k
views
How to get and set custom field of customer_group table Magento 2
I create new extention and add some columns in customer_group table. but i can't get/set custom field.
namespace [NameSpace]\[Extension]\Block\Adminhtml\Group\Edit;
use Magento\Customer\Controller\...
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
0
votes
0
answers
38
views
Magento 2 : Fail to override interface module
I face problem with extension interface in website.
My extension_attributes.xml:
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:...
18
votes
5
answers
19k
views
Why `code` folder is missing under `app` folder in magento 2 stable version?
I have downloaded Magento 2 stable from https://www.magentocommerce.com/download with sample data and installed.
It's working fine in both areas i.e. frontend & backend.
But I could not find app/...
7
votes
2
answers
6k
views
How to set cronjob dynamic schedule from database in Magento 2
I am working on a custom module for Magento 2. I did setup crontab there and it is working good with static schedule.
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
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
21
votes
6
answers
33k
views
How can I decrypt an encrypted configuration value?
This is the code that I'm using to get the value from a specific field saved via the admin panel.
protected $_paymentData;
protected $_scopeConfig;
protected $logger;
public function __construct(
...
0
votes
0
answers
339
views
How to create custom payment module in magento 2?
I want to get payment request in Test\Testpayment\Gateway\Request
Request.php
namespace Test\Testpayment\Gateway\Request;
use Magento\Payment\Gateway\ConfigInterface;
use Magento\Payment\Gateway\...
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
...
0
votes
1
answer
46
views
updating product description via coding correctly shows text on product page but admin side's edit description with pagebuilder shows old values?
In my custom module, I am able to set the description of an existing product successfully using the code below & the product url shows correct output for description:
$product = $this->...
0
votes
0
answers
18
views
filtering by multiselect attribute displaying values in static block
When filtering by text attribute type the module block and phtml template retrieve values by attribute code, however its not not returning values on MultiSelect
ive tried the following:
// Build a ...
1
vote
0
answers
157
views
Magento 2.4 How to implement BfCache
I want to implement BFCache into Magento but did not find the proper resources for implementing it using a custom module.
BFCache Reference link : https://web.dev/articles/bfcache
Can anyone guide me ...
1
vote
0
answers
62
views
Adobe Live Search Compatibility Custom Extension
Can we make custom extension compatible with Adobe Live Search which not contains any specific entity data like Catalog, i.e.?
2
votes
4
answers
11k
views
Include external PHP library in Magento 2 module
I am trying to include an external PHP library inside my Magento 2 module, specifically the eKomi PHP library (https://github.com/ekomi-dev/ekomi-api).
I have added the PHP files into the module so ...
1
vote
1
answer
1k
views
How to change price, the price calculation in cart through custom module Magento 2?
Here
in my custom module:
This product with 50 quantities price is 6,000
But when I add to cart this multiplies
So how I can fix this?
Can I use observer to change this or are there any ...
1
vote
2
answers
1k
views
Magento 2 : Add custom notification in admin
I see some module has a custom notification, my question is how to add it in my module
Update:
vendor/module/etc/adminhtml/events.xml
<?xml version="1.0"?>
<!--
/**
* Copyright © Magento, ...
-2
votes
1
answer
1k
views
how to show shipping method selection for each item in cart
Can anyone give the solution for the below.
I am using magento 2 CE. I want to show all shipping methods for each item in the cart on the shopping cart page and the customer can select the shipping ...
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 ...
2
votes
3
answers
4k
views
Magento 2 : Check Static Block with same identifier in InstallData Script
I am creating module which will create static block & cms page at time of site transfer.
So my InstallData file like below :
class InstallData implements InstallDataInterface
{
/**
* @var ...
0
votes
1
answer
63
views
Magento 2: REST API Endpoint uses wrong locale
I'm implementing an endpoint where the users can create products from a CSV, using the same logic that Magento implements in the backend to import CSV seems to work great but I have a problem, the ...
1
vote
1
answer
72
views
Event observer hangs on order creation
Situation:
I'm creating a Magento 2 module that listens to specific event observers, gets the ID's associated with those events, and sends them to a third-party Node app. This Node app will receive ...
1
vote
1
answer
2k
views
Magento 2: How many options do I have to use with addFieldToFilter? [closed]
What out-of-the-box logical conditions can I use with the addFieldToFilter method?
$this->addFieldToFilter();
Thanks
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
0
answers
110
views
Magento 2 Remove Tier Price using Plugin
How to remove tier price using plugin ?
I have no idea how to remove this price :(
0
votes
1
answer
644
views
Magento 2: How to add custom text after product image in product list & grid view page via custom module?
How to add custom text after product image in product list & grid view page via a custom module?
I want to add custom text before the product name, like shown in the picture.
4
votes
3
answers
3k
views
Custom Module Admin Grid View "Search by Keyword" Not Working
How to make my search bar work in my custom grid module? I have added the search field by inserting this code <filterSearch name="fulltext"/> inside my <listingToolbar name="listing_top"> ...
0
votes
1
answer
790
views
Magento 2 Setup Custom Module Download Using Composer
GitHub Link -> https://github.com/mahesh-code-work/Module-Learn/
I create one small basic module and try to install using composer.
How to set up the whole setting and what is the right way to do ...
17
votes
10
answers
49k
views
How to create a Magento 2 Patch?
I am working on a Magento module that requires a quick fix.
I assume I can fix it by creating Magento 2 "patch" way.
I have never created a patch file before, can anyone help me to create a ...
1
vote
1
answer
605
views
How To Disable Page Builder for specific form field in Magento 2?
I want to disable the page builder for specific fields in my custom module.
I want to show the default wysiwyg editor.
and all other page I need page builder with wysiwyg editor
Here is my UI ...
0
votes
0
answers
49
views
Child block is not loaded when the main block is called in a CMS page
I made a custom module block with the following layout:
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:...
1
vote
1
answer
436
views
Create an incoming data Magento 2 Webhook
I am looking into creating a module which would listen to incoming data from another custom service.
For example, the said external service would send data to domain.com/webhook (which would be ...
0
votes
2
answers
197
views
Cron job that delete customer in database
below is the cron job code that suppose to delete customer if they have value of 1 in deleteOrders field but it not doing that, what am i missing?
<?php
namespace Vendor\ThreeYearOrders\Cron;
use ...
8
votes
4
answers
16k
views
How to Change Footer Copyright Text in Magento2?
I want to customize Magento\Theme\Block\Html\Footer class in magento2.
how can i change some text and style of footer copyright text with custom module..
2
votes
4
answers
4k
views
Magento 2, preference for Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection does not work
When filters + Ancor is enabled for category, sorting by product name doesn't work. I know the fix as I tested in Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection. So now I'm trying to ...
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?
0
votes
1
answer
436
views
Trying to listen to the add to cart event
This is my first time playing around with Magento. I'm building a module and I want to listen when a product is added to the cart so, I've tried to use the ...
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 ?
16
votes
6
answers
32k
views
How to get the base url from a JS file?
I want to retrieve a base URL and append it with my module controller link from a JS file, so it's impossible to use a block to get the base URL. So far I've done this:
define([
'jquery',
'mage/...