A no nonsense notebook for nerds
-
How to update Magento community edition using CLI
if you receive any errors post installation, try this hard fix
-
How to shift category description below products in Magento 2
In your theme folder, add Folder Magento_Catalog/layout and in layout folder add file catalog_category_view.xml
-
How to add custom attributes in Magento 2 product CSV export
Core Method is to edit the file /vendor/magento/module-catalog-import-export/Model/Export/Product.php and Edit the variable $_exportMainAttrCodes Add your attributes in the array like “custom1″,”custom2”, etc and save the file. Next time you export the csv, you will see new columns in the file.
-
Remove Compare feature from Magento 2
How to remove “Add to Compare” links in sidebar and product page in Magento 2 product pages Magento 2 Community has a default feature of comparison lists for multiple products. Learn how you can disable the “Add to Compare” feature in magento2 community edition. Add the following lines in default.xml of your theme folder
-
CORS policy for subdomains – htaccess – apache server
Works for Magento 2.2x Cross-Origin Resource Sharing header for Access-Control-Allow-Origin for Subdomains or a general format for simple copy paste:
-
How to manage Magento 2 product attribute values options using console
This is an update to my previous script which was used to add custom product attribute values using backend – Add values to product attribute Read the previous^ part to get introduction about how it works. you will have to use browser console (ctrl + shift +j in Google chrome) First of all initialize the…
-
How to find rows which exist in new table but not in old table – MySQL
SQL Query: SELECT t1.stone FROM newatt t1 LEFT JOIN att t2 ON t2.stone = t1.stone WHERE t2.stone IS NULL newatt = new table (contains updated extra rows) att = old table stone = column name on both tables
-
Insert Indian States in Magento Database
Connect to your server’s database using mysql cli or phpmyadmin and use the following query INSERT INTO `directory_country_region` VALUES (NULL,”IN”,”AP”,”Andhra Pradesh”), (NULL,”IN”,”AR”,”Arunachal Pradesh”), (NULL,”IN”,”AS”,”Assam”), (NULL,”IN”,”BR”,”Bihar”), (NULL,”IN”,”CG”,”Chhattisgarh”), (NULL,”IN”,”GA”,”Goa”), (NULL,”IN”,”GJ”,”Gujarat”), (NULL,”IN”,”HR”,”Haryana”), (NULL,”IN”,”HP”,”Himachal Pradesh”), (NULL,”IN”,”JK”,”Jammu and Kashmir”), (NULL,”IN”,”JH”,”Jharkhand”), (NULL,”IN”,”KA”,”Karnataka”), (NULL,”IN”,”KL”,”Kerala”), (NULL,”IN”,”MP”,”Madhya Pradesh”), (NULL,”IN”,”MH”,”Maharashtra”), (NULL,”IN”,”MN”,”Manipur”), (NULL,”IN”,”ML”,”Meghalaya”), (NULL,”IN”,”MZ”,”Mizoram”), (NULL,”IN”,”NL”,”Nagaland”), (NULL,”IN”,”OD”,”Odisha”), (NULL,”IN”,”PB”,”Punjab”), (NULL,”IN”,”RJ”,”Rajasthan”), (NULL,”IN”,”SK”,”Sikkim”), (NULL,”IN”,”TN”,”Tamil Nadu”), (NULL,”IN”,”TL”,”Telangana”), (NULL,”IN”,”TR”,”Tripura”), (NULL,”IN”,”UK”,”Uttarakhand”), (NULL,”IN”,”UP”,”Uttar Pradesh”),…
-
How to create Magento 2 category programmatically?
Use this code:
-
How to secure a folder by whitelisting one IP using HTACCESS and denying all others
The process involves matching all requests for an IP, if the IP does not match redirect all secured directory requests. If you want to control this IP using a script, you can add 2 lines ###CUSTOM RULES### # your rules will appear here using php script ###CUSTOM RULES### Now add a script, say happy.phpand use…
Got any book recommendations?