Browsed by
Author: Hidro Le

Export admin grid with selected columns

Export admin grid with selected columns

=> How can I remove columns in exported CSV from order grid? https://magento.stackexchange.com/questions/166610/magento-2-how-can-i-remove-columns-in-exported-csv-from-order-grid Hello. Key: What you see is what you export!!! When you are working with admin grids, when you want to export data from the admin grid, but you know that you these columns of the data grid has hardcoded at the backend in *[grid_id].xml*, Now I will give you a solution for this case you will export exactly columns you have selected. What you see is what you…

Read More Read More

Integration Elasticsearch On Magento 2 Community (CE)

Integration Elasticsearch On Magento 2 Community (CE)

Magento 2 Open Source (CE) does not provide integration with Elasticsearch by default, but we have other choices for this case there are Elasticsearch is built-in – Magento 2.3.4 Magento 2 Free Module: Elasticsuite from Smile-SA => https://github.com/Smile-SA/elasticsuite/ Elasticsearch Free Service cloud: https://bonsai.io Now let we are going to Install Elasticsearch extension and config Elasticsearch extension with Bonsai Elasticsearch cloud Step 1: Create an account in https://bonsai.io and create your first Cluster. After all you will have an Access URL like this: https://[username]:[password]@[application-code].ap-southeast-2.bonsaisearch.net Step 2: Let login to the…

Read More Read More

Magento 2 – PHP Optimize Tips – Part 2

Magento 2 – PHP Optimize Tips – Part 2

Continue of Part 1. After part 1 you know how to process with large Collection, why we need to use Model Factory instead of Model in __constructor and Customer data sections to load a partition of the web page without disabling FULL page cache. Today I will provide you with consultation and assist you with some tips when you’re working on data. Tip 1: Use in condition instead of for each id and load Data Model You have an array…

Read More Read More

Magento 2 PHP Optimize Tips – Part 1

Magento 2 PHP Optimize Tips – Part 1

Magento 2 PHP Optimize Tips:There are many ways to optimize Magento 2. However, the first thing you should do is optimizing your codes before touching to DB or Cache. Tip 1: Using Factory in the constructor. Why did I say that? Because of the case very simple of Dependence Injection design working in Magento 2 => _constructor, __constructor … will be called, it’s very bad if in the constructor or default functions call for each Collection.=> If your classes are Factory the…

Read More Read More

How to initialize a block loader Magento 2

How to initialize a block loader Magento 2

How to initialize a block loader Magento 2: Did you want to add loader into **templates/cart/totals.phtml**These some ways to add loader spinner into block or page. 1 Use: <div data-bind=”blockLoader: isLoadding”> /** Block Content HTML */ </div>, with this option you should add **isLoadding : ko.observable(false)** into your Component Example: Block XML Define Block templates.phtml CODE Script Javascript code: Namespace_ModuleName/js/componentjsfile 2: With <div class=”loader”> using rjsResolver js file named “Namespace_ModuleName/js/abc“ PHTML file

How to override Magento 2 js using Mixins?

How to override Magento 2 js using Mixins?

How to override Magento 2 js using Mixins? A Magento 2 RequireJS “mixins” allows you to programmatically listen for the initial instantiation of any RequireJS, How do mixins in Magento 2 work? First, create requirejs-config.js Magento_Checkout/js/model/quote js file you want to rewrite.PackageName_ModuleName/js/plugin-quote target file.plugin-quote.js You can’t access the private variable from Magento_Checkout/js/model/quote. What is a private variable If your source file is returned $.mage.[widgetName] ex : Magento_Catalog/js/price-box.js Your destination file must return $.mage.[widgetName]

Config Redis Cache with Magento 2

Config Redis Cache with Magento 2

1. Raise somaxconn above [tcp-backlog] value: sudo nano /etc/rc.local Add this: sysctl -w net.core.somaxconn=65535 When you reboot the next time, the new setting will be to allow 65535 connections instead of 128 as before. 2. Make sure to disable Linux kernel feature transparent huge pages, it will affect greatly both memory usage and latency in a negative way. This is accomplished with the following command: echo never > /sys/kernel/mm/transparent_hugepage/enabled. then add the command to your /etc/rc.local file. if test -f…

Read More Read More

How To Install Elasticsearch on Ubuntu 16.04

How To Install Elasticsearch on Ubuntu 16.04

Introduction Elasticsearch is a platform for distributed search and analysis of data in real time. Its popularity is due to its ease of use, powerful features, and scalability. Elasticsearch supports RESTful operations. This means that you can use HTTP methods (GET, POST, PUT, DELETE, etc.) in combination with an HTTP URI (/collection/entry) to manipulate your data. The intuitive RESTful approach is both developer- and user-friendly, which is one of the reasons for Elasticsearch’s popularity. Elasticsearch is a free and open…

Read More Read More

Deploy Magento 2 Project

Deploy Magento 2 Project

This post shows you how to deploy your Magento 2.1 Project to online hosting. Step one: You need to export your website database to sql or .zip file. use this command: mysqldump -u’database user’ -p’password’ [database_name] > sql_file.sql   — connect to your ssh server. Step Two: Replace your old domain with new domain in your database, using sed command sed -i ‘s/olddomain.com/newdomain.com/g’ sql_file.sql   Step Three: Upload your local code to your Web-Server, you can Compress your code then…

Read More Read More

Magento 2 System requirement.

Magento 2 System requirement.

Magento 2 System Requirements Environment Operating System Linux x86-64 Composer Composer is required for developers who want to contribute to code base, or develop extensions. Web Server Apache 2.2 or 2.4 The apache mod_rewrite module must be enabled. To learn more, see: Apache. Nginx 1.8.x (or latest mainline version) PHP 7.0.4 Magento 2.1.2 and later only. 7.0.2 , 7.0.6 to 7.1.0 Magento 2.1.x (all versions) 5.6.5 and later Magento 2.1.2 5.6.x Magento 2.1.0 and 2.1.1 Not Supported: PHP 7.1, 5.4 Not…

Read More Read More