Posts

UI Grid Component in Magento 2

A new concept in Magento is the usage of UIComponents, which enables us to manipulate UI components using XML files. This article will provide a walkthrough involving the UI Grid Component in Magento 2.
To start with, set up your module by adding the module’s module.xml file.
// app/code/Siphor/News/etc/module.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
...

Add a Route in Expressjs

The basic Express Skeleton Application generates two routes, the default ‘index’ (or ‘/’) route and a ‘users’ route.
This can be seen within the project’s app.js near the top.
// app.js
var express = require('express');
var path = require('path');
var favicon = require('serve-favicon');
var logger = require('morgan');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');

Magento 2 Product Collection Data

Magento developers may find themselves with a task of working with collection class whether that be trying to add a product programmatically, or set an attribute value against it. Here is a simple overview how to manipulate Magento 2 product collection data.
Magento has its very own ProductFactory class to obtain the product collection. This ...

Website Setup with MAMP 4

MAMP is a software solution that allows you to set up a local server environment on your computer. This post will demonstrate a simple guide on how to go about a website setup with MAMP 4, the latest version.
If you haven’t already, download the MAMP application from https://www.mamp.info/en/downloads/ and run through the setup wizard.

Magento 2 Data Scripts

Magento 2 data scripts are responsible for adding data to the database. In terms of adding a module, the setup scripts will construct the table(s), and then the data scripts will import the data.
Magento 1 used this concept and added any data scripts to the ‘data’ directory in the module’s folder structure.
Within Magento ...

Magento 2 RequireJS

Magento 2 makes use of RequireJS, which is a JavaScript module loader and thus eliminates the need to add your JavaScript files in a particular order.
In Magento 1, adding JavaScript files in a particular order could prove tricky. An example of this is needing to add a jQuery plugin JavaScript file after firstly ...

Add System Configuration in Magento 2

Many Magento modules require the ability to have configuration settings within the admin area so that the merchant can edit them to suit their needs. This article will show you how to add System Configuration in Magento 2.
If you’re familiar with Magento 1.x versions, you could add custom configuration by creating a system.xml and ...

CSS Floating and Clearing

Floats in CSS are properties used to float HTML elements and take the element out of the normal flow in order to position it either left or right of its surrounding container.
A simple example of floats in use is seen when text is wrapped around an image. Consider the following HTML.
<!DOCTYPE html>
<html>

Database Adapters in Zend Framework 2

As with many web applications, at some point we require a connection to the database. Database Adapters in Zend Framework 2 are fairly simple to implement, and this can be seen below by viewing the following steps below.
As some parts of the database configuration is often specific to your local environment, parts of the ...

Magento 2 Install Setup Scripts

Setup scripts are a key feature in the Magento application. They provide the ability for a developer to add, update or remove data from the database using PHP classes. This guide will focus on how to add Magento 2 install setup scripts.
Let’s add a new module to start with called ‘Siphor_Names’. Start with the ...