Monday 7 November 2016

Magento2 Directory Structure

I have gone through the directories of Magento2 and i and i found that directory structure changed . It is important to understand differences between Magento1.x and Magento2. In tis blog we will discuss about Magento2 Directory and Files structures.

Root Folder Structure

First let’s compare root folder structure of Magento 1.x and Magento 2. There are major changes applied at root level. Very first thing you will identify is that some new folders are introduced and some of them are removed.
  • media and errors folder are moved to pub folder
  • skin and js folder are moved to pub/static folder. Now it is easy to maintain static content via CDN.
  • js, css, images are again divided into pub/static/adminhtml and pub/static/frontend for backend and frontend area respectively.
  • dev folder contains various tools for developers such as migration tools and tests. shell is moved to dev folder
  • downloader, includes and pkginfo folder are no more with magento 2.
  • setup directory is for installation process
  • get.php, cron.php and index.php files are moved to pub folder.

There are 2 index.php files one in Magento root folder and another in pub folder. You can configure your server to run your application through any of this index.php file. Using pub/index.php is a good option as it will stop access of application files and it is good for security.

eav.php

Database connection settings, backend name, session save settings and cache settings are declared in app/etc/env.php
config.php
config.php has list of active and inactive modules
Theme Folder Structure
Magento 2 comes with very drastic changes on the frontend. Significant changes has been apply on theme structure for performance improvements.
As like earlier version magento 1.x base package ‘app/design/frontend/base/’ will no more exists. Each core module in Magento 2 has new folder introduced which is called ‘view’. This ‘view’ folder contains all module specific files like email template, js, layout xmls, phtml for frontend and backend.
Themes are grouped by ‘vendor’ which we known as ‘package’ in magento 1.x. Theme structure in Magento 2 is like ‘app/design/frontend/vendor_name/theme_name’.

Core Module
Magento core components are exists in your_magento_web_root/vendor/magento directory.
Module Folder Structure
In Magento 2 app/etc/modules folder is removed and module’s declaration is moved to app/code/Vendor_name/Module_name/etc/module.xml file. Each module has its own registration.php file in its root. This file is for Magento to identify it as a module.
app/code/core, /local, /community folders are removed and module structure becomes like
[root]/app/code/[Namespace]/[Module]
  • Namespace is a name of a module’s vendor
  • Module is a name assigned to a module by its vendor
Next to Controller, Model, Helper, Block, etc Magento 2 has introduced new folders which are:
  • Api
  • i18n – contains module specific translation
  • view – contains module specific layout xmls, phtml


Click Here If you want to join Magento Training in Delhi

Thursday 3 November 2016

Magento Theme installation Guide

Steps for magento theme installation Guide


You can install mageto themes two types.
  

Note : Before installing any theme or extension please disable cache from your magento admin panel.

To install a theme from Magento Connect you need to follow certain steps which are explained below (Advance users may skip few steps):
1. Select the theme by browsing the huge Magento theme archive. OR, If you know the direct URL of your favourite theme just open it’s Magento connect URL
2. Now, you will see a button right under the theme image called “Get Extension Key”. You need to click “Get Extension Key” and agree to extension license agreement.
Url for free theme : https://www.magentocommerce.com/magento-connect/hellowired-free-theme-1.html
Login to your magento account.

3. After you select agree checkbox and click “Get Extension Key” you will see the Magento extension key right there itself (displayed in the box). You need to paste this extension key in your store’s Magento connect tab. Keep it safe.
4. Copy this Magento extension key. E.g. It will look like “magento-community/Magik_Autocomplete”
5. In order to install this theme into your Magento store you need to login to your store admin panel and go to System->Magento Connect->Magento Connect Manager. Magento connect manager will ask you to login again. You need to use your store admin login credentials to get past the login screen.

You need to paste the theme extension key copied from the Magentocommerce.com’s Magento connect here.
Magento connect checks for the extension key validity and downloads the theme on your system. Depending upon your internet connection speed (bandwidth) and theme size it will take time to install. These extension keys are specifically created with a unique combination so that there is no confusion over which extension to download. If you have correct extension key and there are no errors in theme or your internet bandwidth you will not see any error messages. In case there are any error messages try downloading and installing again. If you do not succed at all then you can contact the theme owner or ask questions in the theme documentation tab.
6. Soon after you see “Theme successfully installed” message go to System->Configuration->Design->Themes and provide the theme name in Default field (which will change your default theme to this new theme) and click “Save Config” button at the top right corner of your screen.

7. A Magento theme revolves around different columns in your theme layout. In case your store home page doesn’t load properly and shows weird design then go to CMS->Manage Pages. You will notice that there are two different layouts for the home page (may be more depending upon how many themes you have tried in the past). Based on your new theme layout disable all the other home page layouts. You can easily disable/enable the layouts by clicking “Enabled” or “Disabled” links provided in the status field.

 By Magento Connect Manager


Login to your magento admin panel
    
 1.Go to system ->Magento Connect->Magento Connect Manager


 2. Click On Magento Connect Manager ( Get Login Window again)



 3. Login to your admin panel username and password


4. After Login you get dashboard  Like this



Click Here If you want to join Magento Training in Delhi

  

Thursday 6 October 2016

Custom Options in Magento Product

Custom Options are way to offer selection of product varriation it's not rely on attributes.
it have limitations that you are unable to track
inventry based on any varriation, and custom options is not used in grouped,configurable or bundle product.
 Custom Product Option is different form attributes we can use it in simple product for adding like sizes, colors etc..

Steps to adding custom options


1.
On the Admin menu, select Catalog > Manage Products.
2.
In the list, open the product record in edit mode.
3.
In the panel on the left, select Custom Options.
4.
In the upper-right corner, click the Add New Option button. Then, do the following:
a.  In the Title field, enter a name for the property.
b. Set the Input Type you want to use for data entry.
c. Set Is Required to “Yes” if the option must be selected before the product can 
   be purchased.
d. In the Sort Order field, enter a number to indicate the order of this item in the list of options. Enter the number 1 to display this option first.


5.Click the Add New Row button



a.In the Title field, enter a name for this option.
b.In the Price field, enter any markup or markdown from the base product price that applies to this option.
c.Set Price Type to one of the following:
  • Fixed
    The price of the variation differs from the price of the base product by a fixed monetary amount, such as $1.
    Percentage
    The price of the variation differs from the price of the base product by a percentage, such as 10%.
d.Enter a SKU for the option. The option SKU is a suffix to the product SKU.
e.In the Sort Order field, enter a number to indicate the order of this item in the list of options. Enter the number 1 to display this option first.
6.When complete, click the Save button.

Monday 29 December 2014

Add static block in magento

Add extra blocks in magento: 

Step 1: Create static block login your dashboard
Go to cms/Static Blocks
Step 2: Click on add new Block

Step 3: calling on frontend

Static blocks are very important part in magento for calling different blocks to change your look and feel of magento site

use this code in your template file(.phtml files)
echo $this->getLayout()->createBlock('cms/block')->setBlockId('identifire')->toHtml();
Explanation: 
1.suppose we want to add a banner in our magento store  for 
special offers on sidebar so we can use static block. 
2. If we want to add social media in my magento store in footer 
then we can use static block.
3.if we want to add links in my site then we can use static blocks 

 
 



Friday 14 November 2014

Adding Categories in magento

   Adding Categories:  

Step 1: first login to Magento Dashboard  (yourdomain .com/admin)
          Catalog->Manage Categories
         

Step 2:  Select Default root category (Because root category define your store.)
       


Step 3:  After Selecting root category(Default By magento when adding fresh)
   
           Add Subcategory


After filling all information save.


Tuesday 4 November 2014

Magento Directory Structure..

After completing installation we are able to understand directory structure..


The root directory structure


You are free to set your local Apache virtual host and host file to any domain you prefer, as long as you keep this in mind. If you're hearing about virtual host terminology for the first time, please refer to the Apache Virtual Host documentation at http://httpd.apache.org/docs/2.4/vhosts/.
Here is a quick summary of each of those files and folders:
    .htaccess: This file is a directory-level configuration file supported by several web servers, most notably the Apache web server. It controls mod_rewrite for fancy URLs and sets configuration server variables (such as memory limit) and PHP maximum execution time.

   .htaccess.sample: This is basically a .htaccess template file used for creating new stores within subfolders.

    api.php: This is primarily used for the Magento REST API, but can be used for SOAP and XML-RPC API server functionality as well.

 app: This is where you will find Magento core code files for the backend and for the frontend. This folder is basically the heart of the Magento platform. Later on, we will dive into this folder for more details, given that this is the folder that you as an extension developer will spend most of your time on.
 cron.php: This file, when triggered via URL or via console PHP, will trigger certain Magento cron jobs logic.
 cron.sh: This file is a Unix shell script version of cron.php.

 downloader: This folder is used by the Magento Connect Manager, which is the functionality you access from the Magento administration area by navigating to System | Magento Connect | Magento Connect Manager.
                       
errors: This folder is a host for a slightly separate Magento functionality, the one that jumps in with error handling when your Magento store gets an exception during code execution.
                     
   favicon.ico: This is your standard 16 x 16 px website icon.
                        get.php: This file hosts a feature that allows core media files to be stored and served from the database. With the Database File Storage system in place, Magento would redirect requests for media files to get.php.
                   
     includes: This folder is used by the Mage_Compiler extension whose functionality can be accessed via Magento administration System | Tools | Compilation. The idea behind the Magento compiler feature is that you end up with a PHP system that pulls all of its classes from one folder, thus, giving it a massive performance boost.
                        
index.php: This is a main entry point to your application, the main loader file for Magento, and the file that initializes everything. Every request for every Magento page goes through this file.
                        
index.php.sample: This file is just a backup copy of the index.php file.
                        js: This folder holds the core Magento JavaScript libraries, such as Prototype, scriptaculous.js, ExtJS, and a few others, some of which are from Magento itself.
                        lib: This folder holds the core Magento PHP libraries, such as 3DSecure, Google Checkout, phpseclib, Zend, and a few others, some of which are from Magento itself.
                        
LICENSE*: These are the Magento licence files in various formats (LICENSE_ AFL.txt, LICENSE.html, and LICENSE.txt).
                      
  mage: This is a Magento Connect command-line tool. It allows you to add/ remove channels, install and uninstall packages (extensions), and various other package-related tasks.
                     
   media: This folder contains all the media files, mostly just images from various products, categories, and CMS pages.
                       
php.ini.sample: This file is a sample php.ini file for PHP CGI/FastCGI installations. Sample files are not actually used by the Magento application.
                       
pkginfo: This folder contains text files that largely operate as debug files to inform us about changes when extensions are upgraded in any way.

 RELEASE_NOTES.txt: This file contains the release notes and changes for various Magento versions, starting from version 1.4.0.0 and later.

  shell: This folder contains several PHP-based shell tools, such as compiler, indexer, and logger.
                       
skin: This folder contains various CSS and JavaScript files specific for individual Magento themes. Files in this folder and its subfolder go hand in hand with files in app/design folder, as these two locations actually result in one fully featured Magento theme or package.
                        
var: This folder contains sessions, logs, reports, configuration cache, lock files for application processes, and possible various other files distributed among individual subfolders. During development, you can freely select all the subfolders and delete them, as Magento will recreate all of them on the next page request. From a standpoint of a Magento extension developer, you might find yourself looking into the var/log and var/report folders every now and then.