Browsed by
Category: Magento 2

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]

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

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 WebRoot folder Step Five: Create a Local Database. >> Install Database: Install PHP, MYSQL Step Six: Navigate to your virtual host, Run step by step…

Read More Read More

Completed List Setup Ubuntu run Magento 2

Completed List Setup Ubuntu run Magento 2

First step: >> Install Apache web service and virtual host to Ubuntu Second Step: >> Install PHP v7.0 Verify PHP is installed To verify if PHP is installed already, enter php -v. If PHP is installed, messages similar to the following display: PHP 5.6.4-1+deb.sury.org~precise+1 (cli) (built: Dec 21 2014 19:26:25) Copyright (c) 1997-2014 The PHP Group Zend Engine v2.6.0, Copyright (c) 1998-2014 Zend Technologies with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies Install PHP7 On Ubuntu 1: Enter…

Read More Read More

How To Set Up Apache Virtual Hosts on Ubuntu

How To Set Up Apache Virtual Hosts on Ubuntu

How To Set Up Apache Virtual Hosts on Ubuntu Introduction The Apache web server is the most popular way of serving web content on the internet. It accounts for more than half of all active websites on the internet and is extremely powerful and flexible. Apache breaks its functionality and components into individual units that can be customized and configured independently. The basic unit that describes an individual site or domain is called a virtual host. These designations allow the…

Read More Read More

How To Install the Apache Web Server on Ubuntu

How To Install the Apache Web Server on Ubuntu

Introduction The Apache HTTP server is the most widely-used web server in the world. It provides many powerful features including dynamically loadable modules, robust media support, and extensive integration with other popular software. In this guide, we’ll discuss how to install an Apache web server on your Ubuntu 16.04 server. Prerequisites Before you begin this guide, you should have a regular, non-root user with sudo privileges configured on your server. Additionally, you will need to configure a basic firewall to…

Read More Read More