Tag Archives: eCommerce

How to install Magento2: Create a development environment for Magento 2

By Miguel Balparda – Magento Developer at Santex

This post it’s meant to give an idea of how to create a development environment for Magento Beta 2 dev.

This post will NOT attempt to explain the requirements to use Magento 2, it is only a guide to install Magento2 dev Beta and begin to understand the new directory structure and modules. Remember that this version is not ready for production.

The time required for a complete installation is between 1 and 2 hours depending on the internet connection available.

The minimum requirements were updated between versions 1 and 2 and you may find that a server where 1 runs might not be suitable for Magento 2 without modifying versions of the server software (MySQL, Apache, PHP).

We will use a virtual machine to preinstall all the necessary components to ensure compatibility with Magento 2 without modifying the components of the real or host machine.

93% of this guide will happen in the console without making differences between operating systems.

First step is to clone the VM with

git clone https://github.com/rgranadino/mage2_vagrant.git

Then we enter the directory with

cd mage2_vagrant

to run

git submodule update --init

Magento2, Magento2 sample data and the required libs like composer are listed as submodules in the .gitmodules file.

Once we have all the dependencies installed within the same directory we run

vagrant up

to initialize and provision the VM. We deduct vagrant is installed. If not then enter https://www.vagrantup.com/.

The process is long and without user intervention. This VM is provisioned with puppet. You may find puppet manifest at Manifests/mage.pp. Once complete we must add to the hosts file of the real machine the line

192.168.56.10 mage2.dev

to tell our PC to resolve the domain mage2.dev to the IP of the virtual machine.

Once the whole process is finished we can proceed to the installation of Magento2 entering http: //mage2.dev/ or from the VM.

Personally I chose the installation via command line using

reinstall -s

from the virtual machine to install Magento with Sample data included.

In case of choosing the installation via web you need access the VM with

vagrant ssh

and run

cd /vagrant/data/magento2

composer install

to install the required packages via composer.

To read more about the installation and find all the necessary information and material visit Damian Culotta’s official website (Spanish) or visit http://magenticians.com/installing-magento-2-composer (English).

After the installation, your freshly installed Magento2 will be available at http: //mage2.dev/ and the admin will be at http://mage2.dev/admin

Dashboard access
User: admin
Password: p4ssw0rd

Some images

homepage-m2.png

category-m2.png

category-m2.png

pp-m2.png

Admin Dashboard

admin_m2.png

If you use the web interface to install, these are the accesses to the database:

Host: 127.0.0.1
User: root
Pass: mage2
DB name: mage2

About the Author – Miguel Balparda has been developing Magento for almost five years. During this time, he has witnessed the exponential growth the platform has undergone; today it is one of the largest and most popular online stores in the world. There is a great deal of documentation and resources available for both merchants and developers. It is best to start by scanning the official Magento website, where you can find resources to get in touch with the application, as well as free extensions to learn the structure of modules. Miguel can be contacted at communication@santexgroup.com

How to programmatically get data inside a layout XML file in Magento

A while ago, I found myself trying to answer a question in Magento StackOverflow. It was a simple question: Can I get store config value in layout xml file?

http://magento.stackexchange.com/questions/23697/can-i-get-store-config-value-in-layout-xml-file/23702#23702

After some research, I realized that is possible to call a helper in a Magento tag inside an XML file the following way:

<action method="addLink" translate="label title" module="catalog" ifconfig="catalog/seo/site_map">
<label>Site Map</label>
<url helper="catalog/map/getCategoryUrl" />
<title>Site Map</title>
</action>

The relevant part is

<url helper="catalog/map/getCategoryUrl" /> 

where catalog/map is the helper and getCategoryUrl is the action we are calling.

This has a lot of important applications. With this approach, anyone can get dynamic values from any Magento resource like a Model in a layout XML file and interact with blocks, change titles or create conditionals.

Mangento

Miguel Balparda has been developing Magento for almost four years. During this time, he has witnessed the exponential growth the platform has undergone; today it is one of the largest and most popular online stores in the world. There is a great deal of documentation and resources available for both merchants and developers. It is best to start by scanning the official Magento website, where you can find resources to get in touch with the application, as well as free extensions to learn the structure of modules. Miguel can be contacted at communications@santexgroup.com

 

Translate CMS/Block pages in Magento with the inline translator

By Miguel Balparda

Even though Magento has a native inline translator, it doesn’t work for CMS pages and static blocks. For different languages, Magento has the option to create one CMS page or static block for each different language and assign it to the correct store view.

This issue came up when developing a new Magento clothing eCommerce Platform, specifically when we needed to make the site available in multiple languages.

Continue reading