To disable all cache types, Issue the following command
php bin/magento cache:disable
To disable all cache types, Issue the following command
php bin/magento cache:disable
Follow the below steps to override layout xml. Here I am creating a module ‘PHPCodez_Layout’ that will remove header and footer content from the active theme.
Declare Module
File : app/code/PHPCode/Layout/etc/module.xml Continue reading Magento 2 Override layout xml
Customers and admin are not able to login to magento 2 when memcached is enabled and to fix it increase the default value of innodb_buffer_pool_size in my.ini
I have faced the same issue when memcached was configured for Magento 2. The system was throwing the below error
Warning: ini_set(): Cannot find save handler ‘memcached’ in E:\xampp\htdocs\mage2\vendor\magento\framework\Session\SessionManager.php on line 570
In my case it was due to save_handler value was not udated in php.ini file.
So Make sure that save_handler is modified in php.ini file as well.
Please follow Configure Memcached Magento 2
Memcached is an open-source memory object caching system that web sites can use to help accelerate page load times. Memcached works by caching in RAM frequently accessed data, such as the results of API calls, database calls, and more.
Click here to undersatnd how to configure memcached in XAMPP – WIndows 10
To enable memcached for Magento 2, you need to change some settings in the env.php file. To do this, follow these steps:
1) Open the file app/etc/env.php
2) Locate the following section in the env.php file:
‘session’ =>
array (
‘save’ => ‘files’,
),
Modify this section as follows:
‘session’ =>
array (
‘save’ => ‘memcached’,
‘save_path’ => ‘127.0.0.1:11211’
),
3)Save your changes to the env.php file.
4) Edit the php ini.file
Seacch for the string in php.ini file ‘session.save_handler=files’ and update it to ‘session.save_handler=memcached’
Now memcached is enabled for you magento site
You can remove header and footer content from all the Magento pages by adding the following code in default layout xml file.
<?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="header.container" remove="true" /> <referenceContainer name="footer" remove="true" /> </body> </page>
For example in case of the theme Luma, the file need to be edited is vendor\magento\theme-frontend-luma\Magento_Theme\layout\default.xml
Check out the extension to that removes the header and footer content.
Here I will explaing how to create custom paymnet method in Magento 2.
Follow the below steps.
Declare Module Continue reading Create Payment Method Magento 2
Following query will help you to get the active payment methods in magento 2.
select * from core_config_data where path like '%payment%' and path like '%active%' and value=1;
In this tutorial I will explain how to create product from CLI.
Declare the module
File: app/code/PHPCodez/Product/etc/module.xml Continue reading Create product programmatically Magento 2
MariaDB [magento]> select * from catalog_category_product where product_id=2047 limit 10;
+———–+————-+————+———-+
| entity_id | category_id | product_id | position |
+———–+————-+————+———-+
| 5178 | 3 | 2047 | 0 |
| 5179 | 4 | 2047 | 0 |
+———–+————-+————+———-+
2 rows in set (0.00 sec)