All Questions

Tagged with
Filter by
Sorted by
Tagged with
19
votes
2answers
21k views

Magento 2.1.1 How to load Order with Increment ID using OrderRepository object

What would be the latest best practice to load Order using increment ID (instead of Order ID) using OrderRepository
8
votes
1answer
5k views

Magento 2 Check If Customer is Subscribed to Newsletter

I am developing this custom xml export/import. In magento 2 how can I check if a customer is subscribed to newsletter? Right now I am loading the customer factory. \Magento\Framework\App\...
7
votes
1answer
640 views

Magento 2: How to set VaultProvider?

I'm working on custom payment system in which I am using Magento2 default vault functionality. Everything is working fine when if I replace below code in file Magento\Vault\Model\Method\Vault into ...
6
votes
1answer
956 views

How to add a color picker field in Admin form?

How to add color picker in my custom module of Magento 2 admin panel form? Not in System Configuration.
6
votes
4answers
4k views

How to solve admin grid error?

I am getting this error in admin custom module of Magento 2. Something went wrong with processing the default view and we have restored the filter to its original state. admin grid error.
5
votes
2answers
9k views

How can i disable module manually in Magento 2

I'd like to know if its possible to manually disable a module by changing some code like in Magento 1. I know the SSH way.
5
votes
2answers
9k views

Magento 2.1: Invoke urlBuilder->getUrl() in a controller in a custom module

I think my issue might have to do with dependency injection, which I'm still trying to grab the concept. What I would like to do is to be able to get the URL using getUrl() function from Magento\...
5
votes
3answers
4k views

Magento 2: modules are not listing in admin panel

On my test server, every installed extensions are not listing in admin panel under Stores > Settings > Configuration > Advanced > Advanced. And if the extension has configuration parameters ...
4
votes
2answers
981 views

I created a custom module ,but getting error, not able to figure out what the error is about. How to get out of this error? [duplicate]

Recoverable Error: Argument 1 passed to Webkul\Grid\Controller\Adminhtml\Grid\Index::__construct() must be an instance of Magento\Backend\App\Action\Context, instance of Magento\Framework\...
4
votes
2answers
423 views

How to add min value for a field in custom Module system.xml file?

I want to add minimum value attribute for a admin interface field in my custom module. Can anyone suggest me how I can add min attribute in field? Here is my system.xml code: <field id="...
4
votes
1answer
1k views

how to migrate custom code from magento 1.9.2 to magento 2.1

I have created custom modules in Magento 1.9.2,Now I am moving into Magento 2.1. So I need to transfer custom code from Magento 1.9.2 to Magento 2.1. Please help me.
4
votes
1answer
1k views

Magento2.1: How to override the template in custom module?

I want to create an extension that will give shop owners ability to edit their product image. So I understand I need this template Magento/ProductVideo/view/adminhtml/templates/helper/gallery.phtml I ...
3
votes
1answer
969 views

How to deploy public PHP files in Magento 2 extension?

I need to deploy a publicly accessible PHP file as part of a Magento 2 extension. Obviously this is not intended, as usually all requests should be routed through index.php, but in this case it's ...
3
votes
2answers
2k views

Magento ver. 2.1.0 - Index Management without SSH/Shell Access?

Is it possible to do Index Management without SSH/Shell Access in Magento ver. 2.1.0 ?
3
votes
1answer
634 views

Magento2 Catalog - Record the product change and changer

In Magento2.1, I want to make a module to record the product change and changer in database. I think I can use events and observers to achieve it. The catalog_product_save_after event maybe is a good ...
3
votes
2answers
2k views

How to load a popup in the home page?

I need to show a popup when the store loads and need to ask users to select the city, then only products deliverable to these cities must show. In the backend, I added some cities to a new attribute '...
3
votes
2answers
519 views

Magento 2 module not working. Override fails

I am trying to write a module that filters products in a product collection. For that I have tried to override Magento\Catalog\Model\Layer. These are the files in the module: /Viking/FilterProducts/...
3
votes
1answer
236 views

Magento Market place submit extension with licence

I have developed Magento extension that I want to upload on Magento marketplace. I have gone through the process how it works explained Here: https://magento.com/blog/magento-news/magento-...
2
votes
1answer
2k views

Magento2 Disable All Modules of a Particular Vendor Name

I would like disable all module of a particular vendor in a single command. I know we have php bin/magento module:disable [Vendor_ModuleName] command but as far as I know it doesnot take wild cards ...
2
votes
2answers
1k views

Is it okay to change the vendor files?

I am using magento 2.1 with the ultimo theme. I was customizing the login page which was not avaialable as a module in the theme. So I go to vendor and changed the login page setting like text and ...
2
votes
2answers
1k views

Magento 2: How to solve Duplicate Of Template Name?

When I installed a new module and did the setup:upgrade I received this message:
2
votes
1answer
464 views

Send custom email by using cron job magento2

I want to send an Email through a cron job for every 24hrs once.In that email need to mention all the abandoned cart details. I am new to Cron jobs so can you please explain it. Thanks in advance
2
votes
1answer
50 views

How to auto get Module A when install Module B in magento2?

For example I have two modules, Demo and Base. I want that when Module Demo gets installed, module Base is automatically fetched from Github and installed. I think it is related to composer. Edited ...
2
votes
1answer
1k views

magento2: how to use product uploader in custom module

<?xml version="1.0"?> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd"> <...
2
votes
1answer
593 views

How to change position of default welcome message in magento 2?

I am customizing my Magento theme. I have come across the problem of customizing default Magento message. Is there any way to change to position this in the middle. Right now it is on the left side. I ...
2
votes
1answer
685 views

How to programmatically sign in to the administration area from a module?

I'm trying to create a module which logs in a retrieved user to the administration panel. (we're talking admins, not customers :) ) I found the following post on how to do this: How to perform auto-...
2
votes
3answers
2k views

Magento 2: How to get visitors data

I want to get visitor Id in my custom block for getting product view history of non logged in customer public function __construct( \Magento\Customer\Model\Visitor $customerVisitor ){ $...
2
votes
1answer
185 views

How to override mini-cart default template html file?

I have Magento 2.2.4 version, And I want to overwrite Magento_Checkout/template/minicart/item/default.html file in my custom module. For this, I created require-jsconfig.js file at below path /app/...
2
votes
1answer
56 views

Magento\Mtf\TestCase\Scenario Location file?

I was installing some module and found that there are some test class that extend Scenario : <?php namespace Aheadworks\SocialLogin\Test\TestCase; use Magento\Mtf\TestCase\Scenario; /** * ...
2
votes
1answer
855 views

Magento2:How to add a custom button that sends few edit form fields via ajax to call to an API to populate its response in another field?

How to implement a custom button in edit form page that takes few edit form values,sends to ajaxURL and populates some API response in another field on same page in magento2?
2
votes
1answer
1k views

Add new checkout step to force user registration

I want to add a new checkout step, and It checks whether the user is logged in or not. If yes, the user can skip this step and go to next step (shipment step), if not, the user needs to register in ...
2
votes
0answers
556 views

show currency symbol of SAR in both store view

I have store in two views Arabic and English. if I delete this code from /home/store/public_html/site/vendor/magento/zendframework1/library/Zend/Locale/Data/ar_SA.xml <numbers> <...
2
votes
4answers
173 views

Create Dirty Playground In Magento 2.1.6

The method outlined here to create a dirty playground doesn't work in magento 2.1.6: https://magento.stackexchange.com/a/40848/55108 It generates the error: Uncaught TypeError: Argument 2 passed ...
2
votes
0answers
53 views

Clear the Text box data in the magento 2 module when validation fails in beforeSave event

I have a textbox which gets a input from the User. I have created a validation point using beforeSave function. If the validation fails, An error displays. Along with this I want to delete the value ...
2
votes
0answers
554 views

How to create ui-component and get it in custom block?

In Magento 2.1.4, I created custom template in backend. Company/Module/Block/Adminhtml/Edit/Custom has template Company_Module::html/custom.phtml. custom.phtml code: <div class="sample"> ....
2
votes
1answer
462 views

Custom block not showing up on homepage

I just created my first own module. It is a Block that should be shown on the cms home page. Later on I want to change this into a custom navigation bar that is present on all pages of my shop but for ...
2
votes
1answer
588 views

Magento 2.1: Letter Case for Controller Actions URL Route

I tried to create a custom payment gateway by creating a custom module based on Paypal module, specically Paypal Express Checkout. I was able to replicate the route for controller actions: Start, ...
2
votes
0answers
275 views

Magento 2: implement your own captcha type

Out of curiosity, I was going through the captcha module of M2 and I noticed this interesting code in Magento/Captcha/Helper/Data.php public function getCaptcha($formId) { if (!array_key_exists($...
1
vote
5answers
3k views

Magento 2.1 UI component form addFieldToFilter() on null

I am trying to make a UI component form for creating products in Magento 2.1 module. However, I stuck with the problem that it throws this error: Fatal error: Method Magento\Ui\TemplateEngine\...
1
vote
2answers
3k views

Magento 2 - overwrite module Less / css with theme

I currently have a module installed inside of the following directory: httpdocs/vendor/module/module-name I've installed the module with composer and it works. However I've noticed the module is ...
1
vote
3answers
1k 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/...
1
vote
1answer
122 views

How to get helper instance on Magento 2.1?

I tested all methods that I found that were reported here all about Magento 2.0, but seems like Magento 2.1 is different, how can I do that?
1
vote
2answers
223 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
4answers
3k views

How to add js file to custome module in magento 2

I have some script code in my phtml like below. path - Company/Module/view/templates/test.phtml <script type="text/javascript"> var color = null; var framecolor = null; function ...
1
vote
3answers
990 views

Magento 2: Adding JS from module

I have a module, and I want to add a javascript generated in the module at the frontend footer. The javascript has to be built dynamically because it depends on server variables. I've thought of a ...
1
vote
1answer
617 views

M2 Multistore - Create module for one store only

In a Magento 2 multistore, is there a way to create a module available for one particular store only? I know that I can disable a module using the admin, but that only disables the output of it. Is ...
1
vote
1answer
218 views

Magento 2: How to stop event/observer if another already ran

I have 2 events running if subscribe to newsletter is checked on the checkout page. sales_model_service_quote_submit_success newsletter_subscriber_save_after Can i prevent event #2 from happening if ...
1
vote
1answer
287 views

Can't see the custom shipping method just added

I need to add a custom shipping method. I was fallowging this tutorial: https://www.mageplaza.com/devdocs/magento-2-create-shipping-method/ I was able to configure my custom shipping method. I set ...
1
vote
1answer
1k views

Magento 2 : EAV Tutorial Needed

In magento 1.9 I created a custom module with EAV models with the help of following tutorial. How to create an EAV entity? Is there any equivalent in magento 2.
1
vote
1answer
392 views

Overriding Base routing class in magento 2

I want to override this class class Base implements \Magento\Framework\App\RouterInterface this class is located in vendor/magento/framework/App/Router/Base. So here is my custom module looks like : ...