Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Magento 2 Development Essentials
Magento 2 Development Essentials

Magento 2 Development Essentials: Get up and running with Magento 2 to create custom solutions, themes, and extensions effectively

eBook
$9.99 $25.99
Paperback
$32.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Table of content icon View table of contents Preview book icon Preview Book

Magento 2 Development Essentials

Chapter 1. Magento Fundamentals

Magento is a highly customizable e-commerce platform and content management system. Magento is one of the most used e-commerce systems to create online stores around the world by providing management of inventory, orders, customers, payments, and much more. It has a powerful scalable architecture.

Are you ready to start on the world of Magento development?

First of all, we will need to set up our environment. In this book, we will cover how to set up a local environment. It is very important to have this local ecosystem development to work smoothly and in an agile way.

In every chapter of this book, we will work with a mini project. It's kind of a sprint to learn the path. In this chapter, our mission is to create a work environment and understand the basic concepts of Magento (http://magento.com/).

After setting up the environment, you'll study the Magento folder structure and work on a basic Model View Controller (MVC) software architecture pattern and Magento basic setup.

Basically, we will work on this chapter with the following topics:

  • XAMPP PHP development environment
  • Magento e-commerce system
  • Magento system structure
  • Magento basic setup

Are you ready for fun some? Let's go!

XAMPP PHP development environment

The XAMPP is a complete web development environment. On its install package, we can find Apache, MySQL, PHP, and Perl. This is everything that you will want to develop your solutions!

At this time, you can imagine the meaning of XAMPP, but the X before the AMPP has the meaning of cross or cross-platform. So, we have XAMMP: (X) Cross-platform, Apache, Maria DB, PHP, and Perl.

The goal of XAMPP is to build an easy-to-install distribution for developers to get into the world of Apache. XAMPP is a project of Apache Friends (Apache Friends is a non-profit project to promote the Apache web server).

Why we are working with this software? Let's find out:

  • Apache (http://httpd.apache.org/): This has been the most popular web server on the Internet since April 1995 providing secure, efficient, and extensible HTTP services in sync with the current HTTP standards
  • MariaDB (https://mariadb.org/): This strives to be the logical choice for database professionals looking for a robust, scalable, and reliable SQL server
  • PHP (http://php.net/): This is a popular general-purpose scripting language that is especially suited to web development; and, most importantly, it is the main language of Magento
  • Perl (https://www.perl.org/): This is a highly capable, feature-rich programming language with over 27 years of development

So far so good, but how about doing some action?

XAMPP installation

First of all, let's access the XAMPP website on https://www.apachefriends.org/.

XAMPP installation

XAMPP has three distinct versions for different operating systems (OS): Windows, Linux, and OS X. Choose your preferred version to download, and start the installation process.

XAMPP for Windows installation

XAMPP for Windows has three different kinds of installation files:

  • Installer: This is a classic Windows installation method
  • Zip: This method uses compressed files to install manually
  • 7zip: This method uses compressed files to install manually

The (.exe) installer is the most popular process to install. Download it and execute to start the installation process, shown as follows:

XAMPP for Windows installation
  1. You can skip FileZilla FTP Server, Mercury Mail Server, and Tomcat for our installation purposes but feel free to consult Apache Friends Support Forum for further information at https://community.apachefriends.org.
  2. On XAMPP, we have the option to use Bitnami (https://bitnami.com/xampp), but for learning purposes, we will install Magento in a classic way.
  3. Complete the installation by pressing the Finish button.
    XAMPP for Windows installation
  4. In order to start XAMPP for Windows, you can execute xampp-control.exe and start the Apache web server.
  5. To test if everything is working, type http://localhosturl in your favorite web browser. You will see the XAMPP start page:
    XAMPP for Windows installation

XAMPP for Linux installation

XAMPP for Linux has two main versions of installation files:

  • 32-bit version
  • 64-bit version

Choose the file according to your architecture and follow these steps:

  1. Change the permissions to the installer:
    chmod 755 xampp-linux-*-installer.run
  2. Run the installer:
    sudo ./xampp-linux-*-installer.run
    

    XAMPP is now installed below the /opt/lampp directory.

  3. To start XAMPP, execute this command on terminal:
    sudo /opt/lampp/lampp start
    
  4. To test if everything is working, type the http://localhost URL in your favorite web browser. You will see the XAMPP start page:
    XAMPP for Linux installation

XAMPP for OS X installation

To install XAMPP for OS X, you simply need to follow these steps:

  1. Download the DMG image file.
  2. Open the image file to start the installation process.
  3. The steps are pretty much the same as Windows installation.
  4. To test if everything is working, type the http://localhost URL in your favorite web browser. You will see the XAMPP start page:
    XAMPP for OS X installation

The XAMPP htdocs folder is the docroot folder of your server. Everything that you save on htdocs can be accessed via any browser. For example, if you save index.php inside the htdocs root, you can access this script by entering http://localhost/index.php. If you save your file in the packt folder, you can access it by http://localhost/packt/index.php. Piece of cake!

Magento

Magento is an open source content management system for e-commerce websites. It's one of the most important e-commerce systems, which has grown fast since its launch in 2008.

Basically, Magento works with two different types of Magento: Community Edition (CE) and Enterprise Edition (EE). In this book, we will cover CE.

On a study provided by aheadWorks (https://aheadworks.com/) in October 2014, Magento CE has taken the leading position among examined e-commerce platforms.

Magento

Now, we have solid concepts about "where we are going". It's very important to have solids concepts about every aspect that you are working on in this moment. Globally, e-commerce shows a remarkable potential market and Magento professionals are welcome.

Magento installation

First of all, we need to create a user account on the Magento website (http://www.magento.com) to download Magento CE. Click on the top-menu link My Account and after clicking the button labeled Register, fill out the form and confirm your registration.

Once registered, you gain access to download Magento CE. You can access the Products | Open Source/CE and VIEW AVAILABLE DOWNLOADS menus.

Magento installation

On this page, we have three important options:

  • Full Release (ZIP with no sample data): This is a complete download of the last and stable Magento version
  • Full Release with Sample Data (ZIP with sample data): This is important to create example products to our store for testing.
  • Download with Composer: This is the dependency management installation tool

Choose the Full Release with Sample Data (ZIP with sample data) option for downloading Magento. Extract the compressed files in the XAMPP htdocsfolder and rename the folder to packt.

Note

Remember to start Apache and MySQL services on the XAMPP panel before the installation.

Before starting the Magento installation, we'll need to create a new MySQL database instance to store the Magento data. phpMyAdmin is a MySQL web app to manage your database and can be accessed at http://localhost/phpmyadmin/.

Click on the Databases menu and the Create database option to create the packt database.

Magento installation

Now, let's start our Magento installation. On your browser, access http://localhost/packt/setup.

By now, you will see this installation page on your browser:

Magento installation

Let's start the Magento installation by following these steps:

  1. Readiness Check: Check the environment for the correct PHP version, PHP extensions, file permissions, and compatibility.
  2. Add a Database: Fill the database form with your connection information. By default, you can follow the suggestions given here:
    Magento installation
  3. Web Configuration: Enter you store address and admin address here:
    Magento installation
  4. Customize Your Store: In this step you provide the time zone, currency, and language information:
    Magento installation
  5. Create an Admin Account: Enter with personal login information and set the admin address to packt-admin.

After all these steps, we are done! Congratulations! We have our first Magento installation!

You can access your new site by accessing the URL at http://localhost/packt:

Magento installation

And you can access the admin area by accessing the URL at http://localhost/packt/admin-packt:

Magento installation

For more information about Magento installation, access http://devdocs.magento.com/guides/v2.0/install-gde/bk-install-guide.html.

Magento MVC architecture

MVC is an architectural software pattern that works with three different but interconnected parts. Its principal mission is to abstract the development work into interdependent layers providing the best practices to documentation and organization of software projects.

The Magento e-commerce solution is written with the PHP Zend framework, which is one of the most powerful PHP frameworks. For more information, access http://framework.zend.com/.

Magento is a configuration-based MVC System. For example, when you develop a module (we will check this in the next chapters), besides creating new files and classes to your module, you need to also create a config.xml file. This file contains all the configuration data for Magento module. These practices abstract some important information that you can easily edit to set the module as you need.

Magento MVC architecture

In this book, we will cover only the very basic Magento software architecture concepts, but it's highly recommended that you to study more software design patterns, especially in our case MVC software architecture needs to be understood well to best experience the field of software development.

Summary

You've now seen what Magento can do; you have installed Magento too. You started to understand the basic concepts of Magento, and certainly, you'll get more experience in developing your own Magento solutions by working in the projects of this book.

In the next chapter, we'll work with some Magento Sell System features.

Left arrow icon Right arrow icon

Key benefits

  • Create unique solutions for Magento 2 by developing and implementing solutions, themes, and extensions
  • Be proficient in the main functionalities, resources, and system structure of Magento 2
  • Get to grips with this practical and hands-on guide to raise your web development skills to the next level

Description

Magento is the e-commerce software and platform trusted by the world's leading brands. Used by thousands of merchants for their transactions worth billions, it provides the flexibility to customize the content and functionality of your website. By strengthening your fundamentals in Magento development, you can develop the best solutions and take advantage of the growing market. This fast-paced tutorial will provide you with skills you need to successfully create themes, extensions, and solutions to Magento 2 projects. This book begins by setting up Magento 2 before gradually moving onto setting the basic options of the Sell System. You will take advantage of Search Engine Optimization aspects, create design and customize theme layout, develop new extensions, and adjust the Magento System to achieve great performance. By sequentially working through the steps in each chapter, you will quickly explore all the features of Magento 2 to create a great solution. With ample examples and a practical approach, this book will ensure your success with this astonishing e-commerce management system.

Who is this book for?

If you are a PHP developer who wants to improve your skills in e-commerce development by creating themes and extensions for Magento 2, then this book is for you.

What you will learn

  • Install and set up the Magento Ecosystem
  • Choose the best options for Magento's Sell System features
  • Work with Search Engine Optimization in Magento
  • Create and customize themes for Magento
  • Develop extensions for new Magento functionalities
  • Package extensions to publish in the Magento Connect network
  • Create Magento solutions for mobile devices
  • Carry out performance adjustments to speed up your Magento system
Estimated delivery fee Deliver to Egypt

Standard delivery 10 - 13 business days

$12.95

Premium delivery 3 - 6 business days

$34.95
(Includes tracking information)

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Feb 25, 2016
Length: 178 pages
Edition : 1st
Language : English
ISBN-13 : 9781785289897
Vendor :
Magento
Languages :
Concepts :
Tools :

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Estimated delivery fee Deliver to Egypt

Standard delivery 10 - 13 business days

$12.95

Premium delivery 3 - 6 business days

$34.95
(Includes tracking information)

Product Details

Publication date : Feb 25, 2016
Length: 178 pages
Edition : 1st
Language : English
ISBN-13 : 9781785289897
Vendor :
Magento
Languages :
Concepts :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total $ 123.97
Magento 2 Development Essentials
$32.99
Magento 2 Developer's Guide
$41.99
Magento 2 Cookbook
$48.99
Total $ 123.97 Stars icon
Banner background image

Table of Contents

10 Chapters
1. Magento Fundamentals Chevron down icon Chevron up icon
2. Magento 2.0 Features Chevron down icon Chevron up icon
3. Working with Search Engine Optimization Chevron down icon Chevron up icon
4. Magento 2.0 Theme Development – the Developers' Holy Grail Chevron down icon Chevron up icon
5. Creating a Responsive Magento 2.0 Theme Chevron down icon Chevron up icon
6. Write Magento 2.0 Extensions – a Great Place to Go Chevron down icon Chevron up icon
7. Go Mobile with Magento 2.0! Chevron down icon Chevron up icon
8. Speeding up Your Magento 2.0 Chevron down icon Chevron up icon
9. Improving Your Magento Skills Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
(4 Ratings)
5 star 50%
4 star 0%
3 star 50%
2 star 0%
1 star 0%
rohin Oct 03, 2017
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Loved the book
Amazon Verified review Amazon
ROE Jul 02, 2017
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Arrived on time and as expected
Amazon Verified review Amazon
Dave May 24, 2016
Full star icon Full star icon Full star icon Empty star icon Empty star icon 3
material is ok and good for magento 2 newbies. packt books all have one common: Many mistakes. So some people who don't have good foundations are easy to get lost and give up because of their mistakes.
Amazon Verified review Amazon
AmazonBuyer Sep 16, 2018
Full star icon Full star icon Full star icon Empty star icon Empty star icon 3
Lacking details.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is the delivery time and cost of print book? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela
What is custom duty/charge? Chevron down icon Chevron up icon

Customs duty are charges levied on goods when they cross international borders. It is a tax that is imposed on imported goods. These duties are charged by special authorities and bodies created by local governments and are meant to protect local industries, economies, and businesses.

Do I have to pay customs charges for the print book order? Chevron down icon Chevron up icon

The orders shipped to the countries that are listed under EU27 will not bear custom charges. They are paid by Packt as part of the order.

List of EU27 countries: www.gov.uk/eu-eea:

A custom duty or localized taxes may be applicable on the shipment and would be charged by the recipient country outside of the EU27 which should be paid by the customer and these duties are not included in the shipping charges been charged on the order.

How do I know my custom duty charges? Chevron down icon Chevron up icon

The amount of duty payable varies greatly depending on the imported goods, the country of origin and several other factors like the total invoice amount or dimensions like weight, and other such criteria applicable in your country.

For example:

  • If you live in Mexico, and the declared value of your ordered items is over $ 50, for you to receive a package, you will have to pay additional import tax of 19% which will be $ 9.50 to the courier service.
  • Whereas if you live in Turkey, and the declared value of your ordered items is over € 22, for you to receive a package, you will have to pay additional import tax of 18% which will be € 3.96 to the courier service.
How can I cancel my order? Chevron down icon Chevron up icon

Cancellation Policy for Published Printed Books:

You can cancel any order within 1 hour of placing the order. Simply contact customercare@packt.com with your order details or payment transaction id. If your order has already started the shipment process, we will do our best to stop it. However, if it is already on the way to you then when you receive it, you can contact us at customercare@packt.com using the returns and refund process.

Please understand that Packt Publishing cannot provide refunds or cancel any order except for the cases described in our Return Policy (i.e. Packt Publishing agrees to replace your printed book because it arrives damaged or material defect in book), Packt Publishing will not accept returns.

What is your returns and refunds policy? Chevron down icon Chevron up icon

Return Policy:

We want you to be happy with your purchase from Packtpub.com. We will not hassle you with returning print books to us. If the print book you receive from us is incorrect, damaged, doesn't work or is unacceptably late, please contact Customer Relations Team on customercare@packt.com with the order number and issue details as explained below:

  1. If you ordered (eBook, Video or Print Book) incorrectly or accidentally, please contact Customer Relations Team on customercare@packt.com within one hour of placing the order and we will replace/refund you the item cost.
  2. Sadly, if your eBook or Video file is faulty or a fault occurs during the eBook or Video being made available to you, i.e. during download then you should contact Customer Relations Team within 14 days of purchase on customercare@packt.com who will be able to resolve this issue for you.
  3. You will have a choice of replacement or refund of the problem items.(damaged, defective or incorrect)
  4. Once Customer Care Team confirms that you will be refunded, you should receive the refund within 10 to 12 working days.
  5. If you are only requesting a refund of one book from a multiple order, then we will refund you the appropriate single item.
  6. Where the items were shipped under a free shipping offer, there will be no shipping costs to refund.

On the off chance your printed book arrives damaged, with book material defect, contact our Customer Relation Team on customercare@packt.com within 14 days of receipt of the book with appropriate evidence of damage and we will work with you to secure a replacement copy, if necessary. Please note that each printed book you order from us is individually made by Packt's professional book-printing partner which is on a print-on-demand basis.

What tax is charged? Chevron down icon Chevron up icon

Currently, no tax is charged on the purchase of any print book (subject to change based on the laws and regulations). A localized VAT fee is charged only to our European and UK customers on eBooks, Video and subscriptions that they buy. GST is charged to Indian customers for eBooks and video purchases.

What payment methods can I use? Chevron down icon Chevron up icon

You can pay with the following card types:

  1. Visa Debit
  2. Visa Credit
  3. MasterCard
  4. PayPal
What is the delivery time and cost of print books? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela