There are no commands defined in the "setup" namespace : Magento 2

I have installed latest version of Megento 2, everything is working fine frontend, backend and functionality. I have one issue with bin/magento setup:upgrade command, when I run this command in...

Magento 2 How to get category by url_key

I try to get a category in Magento 2.0 by it url_key. Now I've got : $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $categoryFactory =...

Magento 2 changes in Js and CSS

I am new to magento 2 and I am creating extension for it. But I am unable to see any js and css changes. When i check on my source code my js file custom.js and css file custom.css is loaded...

To enable extensions, verify that they are enabled in those .ini files - Vagrant/Ubuntu/Magento 2.0.2

When installing Magento 2.0.2 via composer getting this error: Problem 1 - Installation request for magento/product-enterprise-edition 2.0.2 -> satisfiable by...

can't update php.ini file in Docker container

I'm trying to set Magento2 on Docker with Nginx & PHP7. I've added a custom php.ini file as recommended by the PHP7 Docker image. I can see from phpinfo.php that it's loading my php.ini file but...

Magento 2 - override layout.xml file within module

Looking at the Magento 2 docs, you can override a base/core layout.xml file - http://devdocs.magento.com/guides/v2.0/frontend-dev-guide/layouts/layout-override.html Is it possible to do so within...

How to convert HTML into PDF in Magento 2?

I want to convert HTML to PDF in my custom module in Magento 2. I don't want to use zend PDF. Is there any other method in Magento 2 which converts the HTML to PDF?

Product images not displaying in magento2

magento 2 not loaded correct path for rendering images the correct path of image will be 'bit.ind.in/gogiyacards/pub/media/catalog/product/g/o/gogia-cards-banners-610-x-245-2.jpg' but it will...

magento2 weird issue for There are no commands defined in the "setup" namespace

I am facing below issue in my entire installations of M2. [InvalidArgumentException] There are no commands defined in the "setup" namespace. weird thing is I installed fresh Xampp and set up new...

How to search using the AND operator for Elasticsearch Magento 2

By Default Magento 1 & 2 search functionality will result the records using OR operator which gives sometimes irrelevant records. In Magento 1, its possible by changing the logic in Fulltext.php ....

Magento2 Custom Email send?

I added custom html form in magento2 page. In magento2 default contact form will be there, it will work normally.But my custom email not send. How to send the custom mail with user and admin?

Magento 2 custom address attribute not loading in address book in checkout page

I created a Magento Module to 2.2.4 and 2.2.3 version that add a custom attribute in Shipping Address and Customer Address. The attribute works fine when new address is created in checkout page...

InvalidArgumentException: There are no commands defined in the "setup" namespace

I have installed Magento version 2.1 without sample data. I have an issue regarding the command php bin/magento setup:upgrade. It creates an error of [InvalidArgumentException]: There are no...

How to attach invoice PDF instead of packing slip in magento 2

I want to attach invoice pdf instead of packing slip while creating shipment. I am using Fooman Email attachment extension version 2.0.8 My magento is 2.2.5 Can anyone know how can I change the...

Why the "none" image appears in Docker and how can we avoid it

When I run the docker-compose build command to rebuild an image in Docker because I had changed something in Dockerfile, sometimes I get "none" image tags. How can we avoid this fact? I want to...

Magento 2 - How to print invoices in pdf from frontend (user account)

I am trying to get a magento 2 shop up. I managed to install everything, but I am missing the link to get the invoice as a pdf on the frontend (which is mandatory for my clients). Here's what I...

Remove added to cart message Magento 2

I want to remove the Success message when adding to cart. Right now when you click on the Add to Cart button it displays a message of Successfully added <product> to cart but I don't want to...

What is the use of Service directory in magento 2

Some of the magento vendor module contain folder named as "Service", What is the specific purpose for these directory. Generally service contract reside in "Api" directory, so already one...

Magento 2 products are not showing frontend

In our magento 2 store,products are not showing in frontend but they are in the backend. Every day we are importing products using api and at some scenarious products are not showing in...

Magento 2 Override by preference not working in my custom module

I was trying to override <preference for="Magento\Customer\Model\CustomerRegistry" type="Mycustom\Mymodule\Model\CustomerRegistry" /> under etc/di.xml. But after running the php bin/magento...

Issue when run "setup:static-content:deploy" when clone to new site

I am copying a current site (working) to new site for demo. After running "composer install" and setup permission, I run: php bin/magento setup:static-content:deploy This error is...

TCPDF writeHTML margin/padding styling not working

I have implemented TCPDF in my Magento 2 application. What I did was to create an HTML file and load it into my TCPDF instance in my controller. I added all the styling as inline style in my HTML...

Customer registration error after Magento migration

After Migration from Magento 1.9.2.4 to Magento 2.3.4 when I go to create a customer and fill all the information and click on submit(on front-end), it show me error We can't save the...

Magento 2 cannot delete module bceause ClassReader.php class not found

Magento 2.3.3 I have the module Swissup/Core installed. I had some problems and removed it. After I removed the module, (deleted from composer directory) I can no longer use Magento 2. I get the...

Varnish not keeping cache

My varnish cache will only keep items cached for a few minutes. I have changed varnish configurations to keep items cached for a week. Here is my default.vcl: # VCL version 5.0 is not supported so...

composer error while composer install and composer update?

While running composer install it's giving below error, Installing dependencies from lock file (including require-dev) Verifying lock file contents can be installed on current platform. Your lock...

Composer gives me [ErrorException] Undefined index: username after install

I'm on Ubuntu, I've installed composer as per the composer site guide: php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" php -r "if (hash_file('sha384',...

SQLSTATE[HY000]: General error: 1449 The user specified as a definer

I am trying to create, modify and update products from the Magento 2.3.7 backend and it shows me the following error: SQLSTATE[HY000]: General error: 1449 The user specified as a definer...

Magento 2 does not load css or js after setup: upgrade

My website is in default mode only. After run "setup:upgrade" my web does not load the resources css or js. "Refused to apply style from '' because its MIME type ('text/html') is not a supported...

Nginx Php-fpm 7.3 Can't read PHP files from a particular folder

We have a Magento 2 website. For some reason our Nginx/PHP-FPM is unable to read files from MAGEROOT/pub/ folder other than index.php. We are getting the following error in Nginx Log "Unable to...