Skip to content

Instantly share code, notes, and snippets.

@sirusdas
Last active September 5, 2018 11:12
Show Gist options
  • Select an option

  • Save sirusdas/e291959357fde54fa47726d9832bcca9 to your computer and use it in GitHub Desktop.

Select an option

Save sirusdas/e291959357fde54fa47726d9832bcca9 to your computer and use it in GitHub Desktop.
Magento Technical Doc

Re-index your code!

  php bin/magento indexer:reindex

When in trouble try this code

    rm -rf generated
    php bin/magento setup:upgrade
    php bin/magento setup:di:compile
    php bin/magento setup:static-content:deploy -f
    php bin/magento cache:clean
    php bin/magento cache:flush

Change the product category image size

Open the file eg: app/design/frontend/Sm/sport/etc/view.xml Go to category_page_grid xml and change its width and height then run this below code. Follow this link if stuck anywhere https://nwdthemes.com/2017/12/19/magento-2-product-image-size/

  php bin/magento catalog:image:resize
  php bin/magento cache:clear

Change from production mode to developer mode

If you’re changing from production mode to developer mode, delete the contents of the var/generation and var/di directories:

rm -rf <your Magento install dir>/var/di/* <your Magento install dir>/var/generation/* 

Set the mode:

magento deploy:mode:set developer

Sometime there will be issue in the static contents and the admin and front will stop responding. You will also get a requirejs error. To fix this

In Mysql

insert core_config_data (config_id, scope, scope_id, path, value) values (null, 'default', 0, 'dev/static/sign', 0);

and then clear cache and try everything possible. Then too if its not working. Watch the console and copy paste the required files with creating directory.

Use the above code carefully which means only use when you know what it does!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment