How to change attribute dropdown type to multi-select in Magento 2?

Short Answer: Not possible via Magento2 Admin Backend. Solution: You need to update eav_attribute table and edit information about backend_source, frontend_input etc. Simple query for that is: UPDATE `eav_attribute` SET `backend_model`="Magento\\\Eav\\\Model\\\Entity\\\Attribute\\\Backend\\\ArrayBackend", `backend_type`="varchar", `frontend_input`="multiselect", `source_model`=NULL WHERE `attribute_id`=YOUR_ATTRIBUTE_ID_INTEGER LIMIT 1 Replace YOUR_ATTRIBUTE_ID_INTEGER with your attribute_id like 355 Reference: https://stackoverflow.com/a/57701845/2229148

August 29, 2019 · 1 min · Harshvardhan Malpani

How to disable products in Magento2 which dont have any gallery image?

UPDATE `catalog_product_entity_int` SET `value`=2 where `entity_id` in (SELECT a.`entity_id` FROM `catalog_product_entity` AS a LEFT JOIN `catalog_product_entity_media_gallery_value` AS b ON a.entity_id = b.entity_id LEFT JOIN `catalog_product_entity_media_gallery` AS c ON b.value_id = c.value_id WHERE c.value IS NULL) and `attribute_id` = 96 It is SQL query Assumption: value=2 means disable and value=1 means enable attribute_id=96 means “status” attribute References: https://gist.github.com/tegansnyder/8464261#gistcomment-2910808 https://magento.stackexchange.com/a/83033/32283

August 22, 2019 · 1 min · Harshvardhan Malpani

How to remove sign in popup from Magento 2 checkout page?

Magento2 has this authentication pop up on checkout page, which many store owners wont like to see on their checkout page. Background of this pop up area and Related files The pop up itself is generated by Magento_Customer::account/authentication-popup.phtml But this pop up works very differently on checkout page. In fact this is a separate pop up than the one you see in header area. It is embedded in a series of js files which are governed by knockout-js ...

May 27, 2019 · 1 min · Harshvardhan Malpani

How to customize Magento 2 Maintenance mode page?

Edit the file pub/errors/default/503.phtml and put the following code <?php /** * How to edit and customize code of Magento 2 Maintenance 503 Page * Add analytics if any * Replace <COMPANY NAME> with your Organization Name */ ?> <!doctype html> <title>Site Maintenance</title> <style> body { text-align: center; padding: 150px; } h1 { font-size: 50px; } body { font: 20px Helvetica, sans-serif; color: #333; } article { display: block; text-align: left; width: 650px; margin: 0 auto; } a { color: #dc8100; text-decoration: none; } a:hover { color: #333; text-decoration: none; } </style> <article> <h1>We&rsquo;ll be back soon!</h1> <div> <p>Sorry for the inconvenience but we&rsquo;re performing some maintenance at the moment. If you need to you can always <a href="mailto:abcd@COMPANY NAME">contact us</a>, otherwise we&rsquo;ll be back online shortly!</p> <p>&mdash; Team COMPANY NAME</p> </div> </article>

February 4, 2019 · 1 min · Harshvardhan Malpani
CMS

Top CMS out there in 2018.

CMS: A content management system is a software that helps us to manage our content and site. You can literally manage everything from a blog to an e-commerce site, using CMS. You can manage an article if you have a blog, or manage your product if it is an e-commerce business. It has made our life so easier that we just can’t imagine having a site without CMS. You can operate most CMS out there even if you have no prior technical knowledge. ...

October 25, 2018 · 3 min · Harshvardhan Malpani

Fix Magento 2 – php cli error on cpanel or other hostings

The problem: On a fresh install of Magento2 on cpanel based hosting, you receive the following error while running any command on SSH [eee@e1 www]$ php bin/magento cache:clean X-Powered-By: PHP/7.0.31 Content-type: text/html; charset=UTF-8 bin/magento must be run as a CLI application [eee@e1 www]$ php bin/magento setup:upgrade X-Powered-By: PHP/7.0.31 Content-type: text/html; charset=UTF-8 bin/magento must be run as a CLI application The Solution: You have to point php to correct binary; Use the following code in order: First, open the file which can alter the runtime variables like .bash_profile or .bashrc ...

September 10, 2018 · 1 min · Harshvardhan Malpani

Magento 2 cli commands [continued]

1. Setting GD2 as defualt image adapter from command line Magento >= 2.2 php bin/magento config:set dev/image/default_adapter GD2 php bin/magento cache:clean Magento >= 2.2 mysql --host=(host) --user=(user) --password=(password) -D (database) -e "\ UPDATE core_config_data SET value = 'GD2' WHERE 'dev/image/default_adapter' = path; \"; 2. Disable Minify CSS Files option from command line Magento >= 2.2 php bin/magento config:set dev/css/minify_files 0 php bin/magento cache:clean Magento < 2.2 mysql --host= --user= --password= -D -e "\ UPDATE core_config_data SET value = 0 WHERE 'dev/css/minify_files' = path; \"; php bin/magento cache:clean 3. Disable Merge CSS Files option from command line php bin/magento config:set dev/css/merge_css_files 0 php bin/magento cache:clean Magento < 2.2 mysql --host= --user= --password= -D -e "\ UPDATE core_config_data SET value = 0 WHERE 'dev/css/merge_css_files' = path; \"; php bin/magento cache:clean

August 1, 2018 · 1 min · Harshvardhan Malpani

How to install theme in Magento 2

Download the theme and copy the app folder and paste it in your magento root directory Open Shell, in the root directory, enter ***php bin/magento setup:upgrade .***This will upgrade all the magento files. Also, Clear cache ,type php bin/magento cache:clean . Now force deploy the static files by typing ***php bin/magento setup:static-content:deploy -f .***It will take a while. Now, Go in the dashboard and select content->configuration. ...

July 29, 2018 · 1 min · Harshvardhan Malpani

Magento 2 all cli commands

[~/www]# php bin/magento list Magento CLI version 2.2.4 Usage: command [options] [arguments] Options: -h, --help Display this help message -q, --quiet Do not output any message -V, --version Display this application version --ansi Force ANSI output --no-ansi Disable ANSI output -n, --no-interaction Do not ask any interactive question -v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug Available commands: help Displays help for a command list Lists commands admin admin:user:create Creates an administrator admin:user:unlock Unlock Admin Account app app:config:dump Create dump of application app:config:import Import data from shared configuration files to appropriate data storage cache cache:clean Cleans cache type(s) cache:disable Disables cache type(s) cache:enable Enables cache type(s) cache:flush Flushes cache storage used by cache type(s) cache:status Checks cache status catalog catalog:images:resize Creates resized product images catalog:product:attributes:cleanup Removes unused product attributes. config config:sensitive:set Set sensitive configuration values config:set Change system configuration config:show Shows configuration value for given path. If path is not specified, all saved values will be shown cron cron:install Generates and installs crontab for current user cron:remove Removes tasks from crontab cron:run Runs jobs by schedule customer customer:hash:upgrade Upgrade customer's hash according to the latest algorithm deploy deploy:mode:set Set application mode. deploy:mode:show Displays current application mode. dev dev:di:info Provides information on Dependency Injection configuration for the Command. dev:profiler:disable Disable the profiler. dev:profiler:enable Enable the profiler. dev:query-log:disable Disable DB query logging dev:query-log:enable Enable DB query logging dev:source-theme:deploy Collects and publishes source files for theme. dev:template-hints:disable Disable frontend template hints. A cache flush might be required. dev:template-hints:enable Enable frontend template hints. A cache flush might be required. dev:tests:run Runs tests dev:urn-catalog:generate Generates the catalog of URNs to *.xsd mappings for the IDE to highlight xml. dev:xml:convert Converts XML file using XSL style sheets i18n i18n:collect-phrases Discovers phrases in the codebase i18n:pack Saves language package i18n:uninstall Uninstalls language packages import import:categories Run category importer script indexer indexer:info Shows allowed Indexers indexer:reindex Reindexes Data indexer:reset Resets indexer status to invalid indexer:set-mode Sets index mode type indexer:show-mode Shows Index Mode indexer:status Shows status of Indexer info info:adminuri Displays the Magento Admin URI info:backups:list Prints list of available backup files info:currency:list Displays the list of available currencies info:dependencies:show-framework Shows number of dependencies on Magento framework info:dependencies:show-modules Shows number of dependencies between modules info:dependencies:show-modules-circular Shows number of circular dependencies between modules info:language:list Displays the list of available language locales info:timezone:list Displays the list of available timezones maintenance maintenance:allow-ips Sets maintenance mode exempt IPs maintenance:disable Disables maintenance mode maintenance:enable Enables maintenance mode maintenance:status Displays maintenance mode status module module:disable Disables specified modules module:enable Enables specified modules module:status Displays status of modules module:uninstall Uninstalls modules installed by composer sampledata sampledata:deploy Deploy sample data modules sampledata:remove Remove all sample data packages from composer.json setup setup:backup Takes backup of Magento Application code base, media and database setup:config:set Creates or modifies the deployment configuration setup:cron:run Runs cron job scheduled for setup application setup:db-data:upgrade Installs and upgrades data in the DB setup:db-schema:upgrade Installs and upgrades the DB schema setup:db:status Checks if DB schema or data requires upgrade setup:di:compile Generates DI configuration and all missing classes that can be auto-generated setup:install Installs the Magento application setup:performance:generate-fixtures Generates fixtures setup:rollback Rolls back Magento Application codebase, media and database setup:static-content:deploy Deploys static view files setup:store-config:set Installs the store configuration. Deprecated since 2.2.0. Use config:set instead setup:uninstall Uninstalls the Magento application setup:upgrade Upgrades the Magento application, DB data, and schema store store:list Displays the list of stores store:website:list Displays the list of websites theme theme:uninstall Uninstalls theme varnish varnish:vcl:generate Generates Varnish VCL and echos it to the command line

July 27, 2018 · 3 min · Harshvardhan Malpani

Magento File Directory

/app The etc folder contains the di.xml configuration file The di.xml file contains class mapping and interface preferences Contains the design folder for themes. /bin The directory contains the magento file or a Command Line Interface script /dev Magento 2 testing and development tools are placed in this folder. /lib The internal and web subfolders are located here The internal directory contains server-side libraries and several font files; The web subfolder contains client-side libraries, jquery, modernizr, requirejs, prototype, scriptaculous ...

July 27, 2018 · 1 min · Harshvardhan Malpani