Browsed by
Category: Development

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 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 web server with ssh command line:…

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

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 a Collection. => If your classes are Factory the loop process…

Read More Read More

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 class=”Magento\Framework\View\Element\Template” name=”block-name” template=”Namespace_ModuleName::templates.phtml”> <arguments> <argument name=”jsLayout” xsi:type=”array”> <item name=”components” xsi:type=”array”> <item name=”scope_name” xsi:type=”array”> <item name=”component” xsi:type=”string”>Namespace_ModuleName/js/componentjsfile</item> </item> </item> </argument> </arguments> </block>   Block templates.phtml CODE <div id=”abc-def” data-bind=”scope: ‘scope_name'”> <div class=”product-wizard-selections” data-bind=”blockLoader: isLoading”>…

Read More Read More

How to override Magento 2 js using Mixins?

How to override Magento 2 js using Mixins?

A Magento 2 RequireJS “mixin” allows you to programmatically listen for the initial instantiation of any RequireJS, How to mixins in Magento 2 work? First, create requirejs-config.js var config = { config: { mixins: { ‘Magento_Checkout/js/model/quote’: { ‘PackageName_ModuleName/js/plugin-quote’: true } } } };   Magento_Checkout/js/model/quote js file you want to rewrite. PackageName_ModuleName/js/plugin-quote target file. plugin-quote.js /*global define*/ define([“jquery”], //defile more js here function ($) { ‘use strict’; var mixins = { getTotals: function () { //Define new content for getTotal() function…

Read More Read More

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

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.

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 Supported PHP 7.0.5…

Read More Read More

Setup Magento 2 Application.

Setup Magento 2 Application.

Setup Magento 2 application. This tutorial use: Operating System Ubuntu 16.xx Step One: Readmore about Magento 2 system requirement. >> System requirement Step One: Install System Envairoment: >> Install Apache >> Install PHP, MYSQL >> Setup Virtual Host. Step Three: Download Magento Source Code From Magento. Step Four: Extract Magento 2 source code to your Web Root folder Step Five: Create a Local Database. >> Install Database: Install PHP, MYSQL Step Six: Navigate to your virtual host, Run step by…

Read More Read More

Follow by Email
Facebook
Facebook
LinkedIn