Quantcast
Channel: Magento 2 – DCKAP
Viewing all 135 articles
Browse latest View live

Solution for Inactive Admin Links in Magento 2 (Windows)

$
0
0

Magento has released the beta version for Magento 2. Magento developers are keenly following these releases and are trying to analyze Magento 2 Upgrades. One of the common issues noted by developers are the broken links in Magento 2 when installed in Windows.

The beta version (Magento ver. 0.74.0-beta13) is working fine when installed in Linux. When the beta version is installed in Windows, the links and CSS are disabled.  The images in the admin panel and front end are not loaded (i.e.) there are inactive admin links in windows.

This has been a common issue faced by many Windows developers (under Xampp) for Magento 2 (Magento ver. 0.74.0-beta13).

Before Fix – Links Are Inactive

Magento2

After installing Magento 2 in Windows under Xampp, if your admin and front end link’s are not working, please follow the below steps to fix the same…

  1. Remove everything, except .htaccess file from pub/static folder
  2. Open up app/etc/di.xml find the path “Magento\Framework\App\View\Asset\MaterializationStrategy\Symlink” and replace to “Magento\Framework\App\View\Asset\MaterializationStrategy\Copy”

Note: Remove entire files and folder under pub/static except .htaccess file.

After Fix – Links Are Active

Magento2fixed

Now if you refresh the admin panel, the images in the admin panel and the front end will load and be active and functional.

This solution for “Magento 2 broken admin links” is a contribution to the Magento Open Source Community.

Demo Store

DCKAP has created a Magento 2 demo store. Developers and Merchants are encouraged to login and play around to get a first hand ‘look and feel’ of Magento 2.

Login Details

Store URLhttp://magento2demo.dckap.com/
Admin URLhttp://magento2demo.dckap.com/m2admin/
Username-demo
Password-demo1234

PLANNING FOR A MAGENTO UPGRADE ?
Magento upgrades can be trickier than you expect. Leave it to the experts and we will take care of it.

This post Solution for Inactive Admin Links in Magento 2 (Windows) appeared first on


Magento 2 Merchant Beta Release Webinar – Summary

$
0
0

“eBay Enterprise actually has a few little gems. And one of those little gems is Magento” – that’s from the Karen’s blog. A statement that echoes the sentiments of Magento merchants and developers.  The Magento community is closely watching the development of Magento 2.  Even as innovative and configurable eCommerce platforms are gnawing at the heels of Magento ,  Magento 2 will be the make or break product for the ecosystem.

Magento 2 developer Beta has been available from Dec 2014 and since then there has been a mixture of response from the development teams – challenges in installation, excitement about the new features and improvements in performance.

Magento 2 Merchant Beta Release Webinar presented by

on July 16th 2015, provided more information and updates on

  • The new features  and functionalities
  • Performance and Scalability
  • Magento Connect
  • Migration
  • Training
  • Support for Magento 1.x
  • Useful Links

Magento 2 Merchant Beta Release Webinar – Summary

Features and Functionalities
  • New and enhanced functionalities like streamlined checkout and new payment gateways.
  • The EE module has merchant features like
    • Import/export functionality
    • Color swatches  and size swatches
    • Basic product visualization
    • Visual merchandising
    • Transactional emails and more

Recommended Best Practices

  • New and improved UX for
    • Keyword search
    • Expanding filters
    • Custom views
    • Drag and drop column reordering
    • Configurable columns etc
Performance and Scalability
  • Holistic approach to improve shopper experience.
  • Enhanced performance and scalability on both Magento Community and Enterprise.
  • Improved product import/export – 100K products in 25 min.
Improvements on server-side architecture include
  • Varnish 4 support.
  • Compatibility with HHVM.
  • Layout performance improvement.
Improvements on client-server architecture include
  • Static content caching in browser.
  • Reduced JS code.
  • Effective image compression.
Scalability – Catalog
  • 200K page views/hour (without Varnish).
  • 10M page views/hour (with Varnish).
  • Support of extra large catalog – 1.5M simple products, 5K categories, 150K configurables.
Scalability – Checkout
  • 50K orders/hours (CE Version)
  • 90K+ orders/hour (EE Version)
  • Support of 300+ concurrency with zero errors level
Scalabity -  Backend

Scalability - Backend

 (Results derived using standard test configuration and a XL Magento merchant profile)

Magento Connect

The new connect comes with a dashboard that provides sales analytics, customer analytics, page views including sales by country and average rating. The new connect will help the developers to upload, sell, track and monetize their extensions. It has

  • Improved Search.
  • Improved Content Modules (Featured Extensions, Top Sellers etc).
  • Revised Categories and Pages.
  • Integrated Billing and Payments (Subscription payment not supported as of now).

Merchants will find the new connect more user friendly and will enable them to find, purchase, download and install extensions in a faster and easier manner.

The extensions need to adhere to the new stringent rules to ensure the quality of the extensions.

New Connect - Quality

The video of the New Connect can be viewed in https://vimeo.com/125955416

Migration

Migration tool will be available to enable seamless migration from Magento 1.x to Magento 2.

Migration Components

Migration - Data Migration Tool

Developers can download  Magento 2 migration whitepaper from the link below.

http://enterprise.magento.com/content/magento-2-migration-whitepaper

Training

The webinar stressed the importance on the state of preparedness of the developer community and to achieve this training holds the key. To encourage developers to familiarize themselves with Magento 2, Magento U offers a deep discount for learning the ‘Fundamentals of Magento 2 development’.

More details about the course is available below…

http://magento.com/training/catalog/fundamentals-of-magento-2-development#.VaiHFPmqqko

Q&A Session

There was a Q&A session at the end of the webinar where queries on certification , Magento connect etc were raised.

The 1.x certification will be valid even after Magento 2 is released (that’s a big relief for current 1.x Magento certified developers , designers and solution specialists  :) ) . The Magento 2 certification will be available only after Magento 2 is implemented in several clients and becomes stable, which should take an year or two.

Also, Magento will support EE 1.13 and EE 1.14 for 3 years from General Availability.

With lots of excitement and bated breath, the Magento community is waiting for the block buster product – Magento 2.

Useful Links
Demo Store – Feel Free to Login and Play Around

DCKAP has created a Magento 2 demo store. Developers and Merchants are encouraged to login and play around to get a first hand ‘look and feel’ of Magento 2.

Login Details

Store URLhttp://magento2demo.dckap.com/
Admin URLhttp://magento2demo.dckap.com/m2admin/
Username-demo
Password-demo1234

References:

PLANNING FOR A MAGENTO UPGRADE ?
Magento upgrades can be trickier than you expect. Leave it to the experts and we will take care of it.

This post Magento 2 Merchant Beta Release Webinar – Summary appeared first on

Magento 2 Theme Structure

$
0
0

In the recent webinar (16, July) presented by the Magento team , it was mentioned that there are major changes in themes and when upgrading from Magento 1.x to Magento 2, it will involve quite some effort from the developer end.

This blog is about themes and focuses on the differences between Magento 1.x and Magento 2 theme structure.

The two significant changes we can see in Magento 2 in terms of theme are

• Removal of skin directory from the root
• Introduction of a new directory ‘view’ in the module folder structure which actually completes the MVC structure in more structured way.

Module Specific Layouts and Templates :

By introducing ‘view’ element in the module folder structure, Magento 2 has separated the module specific theme and theme outside the module.

Have a look at ‘view’ directory for catalog module.

App/Code/Magento/Catalog/View

Img 1

 

 

The ‘view’ element has adminhtml and frontend directories.

Every module in Magento 2 can have its own adminhtml and frontend directory which is not available in Magento 1.x.

Frontend dir structure…

Img 2

 

 

Inside frontend directory apart from the layout and templates, we have a new directory web.

Unlike Magento 1.x , we don’t have to create a directory inside skin directory.Instead we can place all the module specific JS, CSS and images inside this web directory.

Module Specific Layouts :

Img 3

 

 

 

 

 

 

All the layout files should go in frontend/layout directory.

Another change brought to the Magento 2 is to divide handles into separate files. So now we have to create a xml file for each handle and the name of that file should be the handle name as we can see in the above image.

Module Specific Templates :

Module specific template (i.e: phtml files) should be placed inside the template directory in view.

Main Theme or Theme Outside the Module :

Location of the themes in magento 2 is same as magento 1.x, that is “app/design/frontend//”.

Magento theme directory typically would contain files as described the image below.

Img 4

 

 

 

 

 

 

 

 

 

 

 

 

Unlike Magento1.x we can see lots of directories here. Now let’s check what these directories hold…

etc Directory :

This directory has a file view.xml which contains image configuration for all storefront product images and thumbnails.

i18n DIrectory :

This directory contains the csv files for locales.

media Directory :

This directory contains the images for that theme.

web Directory :

This directory contains all the css and js files for that theme.

Apart from these directories all other directories inside the theme are to extend or override the default module specific theme.

Magento_catalog directory

Img 5

 

 

 

 

This directory has layout/catalog_product_view.xml file which is extended from the default layout of the catalog module.

Magento/Catalog/view/layout/frontend/layout/catalog_product_view.xml

Img 6

 

 

 

 

 

 

 

 

Similarly we can override any default template of the module from main theme by placing the template inside theme/_/template/.

It is good to see the way Magento 2 is shaping up. It has a long list of innovative features/functionalities  and a substantially improved admin and front end systems. With its improved front end architecture, the developers need to scale up and take advantage of the technology that Magento 2 is offering.

PLANNING FOR A MAGENTO UPGRADE ?
Magento upgrades can be trickier than you expect. Leave it to the experts and we will take care of it.

This post Magento 2 Theme Structure appeared first on

New Technologies in Magento 2

$
0
0

Magento2 is touted as a milestone release that will change the face of B2C and B2B ecommerce industry. There is a palpable excitement and fervor among the Magento community as they eagerly await the release. Magento 2 is also widely discussed and dissected by merchants and developers in the blogs, webinars and social media.

Is the buzz real or is it a hyperbole? The Magento2 Merchant beta has been out in the open and is available in GitHub in the following URL…

https://github.com/magento/magento2

Magento also hosted a webinar on Magento 2 Merchant Beta recently. The recording can be viewed in the URL below.

https://goo.gl/agsb3m

The initial feedbacks are encouraging and Magento 2 lives up to the promise of ‘a cutting edge, feature-rich eCommerce solution that gets results’.

As the Magento community waits for the release, let us have a peek into the technologies that has gone into the making of this ground breaking solution.

Key technology changes in Magento2
  • PHP 5.6.x or 5.5.x
  • Apache 2.2 or 2.4
  • MySQL 5.6.x
  • Composer
  • HTML5
  • CSS3
  • RequireJS
  • jQuery
  • Less
  • PSR Compliance
  • Full page caching
  • Magento Testing Framework (MTF)
  • Coding Standards (PSR – 0 , PSR – 1 , PSR – 2 )

Let us dig a little deeper to see the advantages of each technology listed above:

PHP 5.6.x or 5.5.x
  • PHP 5.4 is no longer supported.
  • This highest version of PHP is used to improve the performance and security of the application.
  • Zend Framework2’s is slower when compared to the Zend Framework1 and symphony. So, Zend Framework1 is used.

The below diagram benchmarks the performance of various PHP frameworks…

New Tech in M2

 

Composer

Main Functionality of composer is as follows:

  • PHP Dependency Manager
  • Handles dependencies per project
  • Package Management (Install , Uninstall and Update)
  • Classes auto loading

Composer in magento2

  • Declaring project dependencies in composer.json
  • Installing dependencies using php composer.phar install
  • Autoloading dependencies by require ‘vendor/autoload.php’.

Required PHP Extensions are declared in composer as follows

HTML5 and CSS3

HTML5

  • HTML5 offers a great shopping experience for customers on a variety of devices. Developers can use the powerful APIs and other new features available. 
  • Magento 2 Themes are built with high-responsive look using HTML5. 

CSS3

  • Improves page load speed. 
  • Supports new visual effects like multiple backgrounds, reflections and shadows. 
  • Magento 2 uses LESS, a CSS pre-processor, to address several frontend development requirements. 
  • Using LESS helps developers to customize themes faster and easier. 
  • LESS preprocessor & CSS URL resolver helps to enhance performance, speed up page load, and make the system SEO friendly.
RequireJS
  • The Javascript library used in Magento 2 is jQuery, prototype.js is not used anymore. In Prototype, objects created are represented as functions named ‘klass’, which hides internal methods and data from debugging developer tools. 

In contrast, jQuery libraries typically express objects using just simple javascript hashes.

  • Magento 2 supports RequireJS.

With the latest build however, RequireJS is responsible for loading jQuery UI. This means, we cannot call .autocomplete nor .dialog before we are certain that the UI library has been fully loaded.

RequireJS wraps the jQuery document.ready callback in a require() callback signaling a dependency on the jQuery UI library

Page caching
  • Magento 2 supports Full Page Caching in CE
  • Other Cache Applications:
    • File-system/Redis

Enabled via app/etc/di.xml or app/etc/env.php (NO local.xml)

    • Varnish

Enabled via Stores → Configuration → System → Full Page Cache

Magento Testing Framework (MTF)
  • Facilitates the improvement of Magento Core products.
  • MTF helps in avoiding duplication of test cases automated across the application utilizing data driven approach.
  • With the new and improved Magento Testing Framework, developers will be able to automate functional testing of the developed features/functionalities enabling frequent releases and higher product quality.
Coding Standards
  • PSR-0 (Autoloading standard)
  • PSR-1 (Basic Coding standard)
    • PHP Tags , Character Encodings , namespaces
  • PSR-2 (Coding Style Guide)
    • Declaration , Control statements , closures

The eco system is readying itself by downloading, installing and playing around with the beta code. How the technology changes will affect the themes, plugins, modules and other softwares in the Magento marketplace is yet to be seen. When all is done and over, the community hopes that Magento 2 will live up to its promises and help merchants to grow their business.

PLANNING FOR A MAGENTO UPGRADE ?
Magento upgrades can be trickier than you expect. Leave it to the experts and we will take care of it.
References

https://alankent.wordpress.com/2014/12/20/about-magento-2-0-developer-documentation/

https://alankent.wordpress.com/2014/12/06/which-framework-would-you-put-under-magento-2/

http://systemsarchitect.net/performance-benchmark-of-popular-php-frameworks/

http://www.php-fig.org/psr

http://www.quora.com/How-good-is-Magento-2-0-Is-it-fast

https://github.com/magento/mtf

http://magenticians.com/magento-2-backend-launcher-composer-compatibility-code-update

http://www.hellothemes.com/blog/magento-2-say-good-bye-to-prototype/

http://magento.stackexchange.com/questions/33981/magento-2-and-zend-framework-2

http://www.slideshare.net/MeetMagentoIt/sergii-shymko-magento-2-composer-for-extensions-distribution

http://blog.magestore.com/11-outstanding-features-of-magento-2-part-1/

http://magenticians.com/magento-2-uses-zend-1-not-that-bad

This post New Technologies in Magento 2 appeared first on

Magento 2 Plugins

$
0
0

We have been actively blogging on the new features and functionalities in Magento 2. In that series, this blog is about Magento 2 plugins.Here we discuss the plugin structure and how to create a plugin.

To understand plugins, it is important to have knowledge on Magento 2 theme structure. Please refer to the blog below to know more about Magento 2 theme structure.
http://www.dckap.com/blog/magento-2-theme-structure

Magento 2 Plugin
  • Plugin is a class which changes the behavior of an original method in Magento code.
  • Magento 2 introduces interception concept which avoid conflicts between extensions, which changes the behavior of the same class or method.
  • Plugin uses before, after, or around an original method. 
Listeners in Plugin
  • beforemethodname() -> to change the arguments of an original method or add some behavior before an original method is called, use the before-listener method. The before prefix should be added to the name of an original method. 
  • aftermethodname() -> to change the values returned by an original method or add some behavior after an original method is called, use the after-listener method. The after prefix should be added to the name of an original method. 
  • aroundmethodname() -> to change both the arguments and returned values of an original method or add some behavior before and after an original method is called, use the around-listener method. The around prefix should be added to the name of an original method. 
Declaring a Plugin

A plugin can be declared in di.xml file. The declaration syntax for plugin is

type name -> a class, interface, or virtual type, which is observed by a plugin.
plugin name -> an arbitrary plugin name
plugin type -> the name of a plugin’s class or virtual type
plugin sortOrder -> order, in which the plugins calling the same method are to be executed.
plugin disabled ->to disable a plugin, the value of the element should be set to ‘true.’

Sample Plugin from module Catalog -> di.xml

“clean(\Magento\Log\Model\Log $object)” in type Magento\Log\Model\Resource\Log  is overwritten by the method “afterClean(\Magento\Log\Model\Resource\Log $subject, $logResourceModel)” found in Plugin file “Magento\Catalog\Model\Plugin\Log”.

Magento\Log\Model\Resource\Log.php file

Magento\Catalog\Model\Plugin\Log.php file

Creating a Plugin

Please refer the below blog for creating a module.
http://www.dckap.com/blog/magento-2-module-development
After creating a module, please follow the below steps for creating a plugin.

Step 1: Create the Block file app/code/Dckap/Welcome/Block/Welcome.php

Step 2: In /app/code/Dckap/Welcome/view/frontend/templates/ create a template file welcome.phtml

Step 3: Create the file di.xml inside app/code/Dckap/Welcome/etc/

Add the below lines in di.xml

Step 4: Create a model file Welcome1.php inside the path app/code/Dckap/Welcome/Model

Magento 2 plugins 1

Please take a look on ‘Hello World’ text displayed in the front end of the module.

Step 5:  Create a Plugin folder inside Model folder of the module.

File Welcome2.php needs to be created inside that Plugin folder.


The  beforeDckModelWelcome method in the  Welcome2.php file appends ‘Welcome to ‘ text with ‘Hello World‘ text of  DckModelWelcome method present inside  Welcome1.php file.

Magento 2 plugins 2

Limitations

Plugin does not apply to following Scenario

  •           Classes created without dependency injection
  •           Final methods
  •           Final classes

As Magento 2 is coming, it’s a good idea to become familiar with its various new features and functionalities instead of waiting until the last hour.

Hopefully this blog is a good motivation and/or introduction to get started with Magento 2 plugin development.

PLANNING FOR A MAGENTO UPGRADE ?
Magento upgrades can be trickier than you expect. Leave it to the experts and we will take care of it.

This post Magento 2 Plugins appeared first on

Request Flow in Magento 2

$
0
0

There is a lot of buzz around Magento 2 and about its new features that promises to improve user experience and performance.

One of the key changes made is in the request flow (i.e.) the path taken by the system from the time an user clicks a page to the time it is served as a page in the front end.

In Magento 1, both the front end and back end configuration files will be loaded for each request. But in Magento 2, only the related configuration files of that area will be loaded.

E.g. in Magento 1.x, if you click “Registration” Page in the front end, it loads the entire configuration files including the front end and the back end. But in Magento 2, it will load only the configuration file related to the front end.

This greatly improves the performance (i.e.) request-response time of the website thus enhancing the user experience.

In this blog, we will discuss the request flow in Magento 2.

Step 1 :

Request hits index.php in root folder of Magento 2.

Step 1a

 

 

 

 

 

 

 

Step 2 :

index.php calls static create() method of bootstrap class to create objectmanagerfactory and bootstrap objects.

Step 2a

Step 2b

 

Step 3:

index.php calls createApplication() method of bootstrap object which in turn will initiate ObjectManager using objectManagerFactory. Then, application instance gets created using objectManager and returned to index.php.

Step 3a

 

 

 

 

 

 

 

Step 3b

 

 

Step 3c

 

 

 

 

 

 

 

Step 3d

 

Step 4:

index.php calls run() method of bootstrap object to run the application, which in turn will call launch() method of application object.

Step 4a

 

Step 4b

 

Step 4c

 

 

 

 

 

 

 

Step 5

HTTP Application instance does initial routing. It takes first part of the URL to find out which area should be loaded (admin/frontend).

When the area is defined, configuration for that area is loaded (unlike Magento 1 where all configuration was loaded).

Then application object calls Magento\Framework\App\FrontControllerInterface::dispatch of requested area.

Step 5a

 

Step 5b

 

 

 

 

 

 

 

Step 6:

Front Controller does routing same as in Magento 1. All routers are iterated to match request. The router that matches the request returns instance of ActionController. When FrontController gets instance of action controller it calls dispatch method on it. This process is more efficient because only routers of one area are used (admin router is not used in frontend).

Step 6a

 

Step 7:

Action controller performs its task and returns instance of some implementation of ResultInterface.

Step 7a

 

 

 

 

 

 

Step 7b

 

 

 

 

 

Step 8:

FrontController just returns ResultInterface to Application Instance that renders the response.

Step 8a

 

There is much more to Magento 2 than request flow. If you want dig deep, please find below a few useful links.

Reference

http://magento.stackexchange.com/questions/72923/request-flow-of-magento-2

Magento 2 Useful Links
Magento 2 Demo Store – Feel Free to Login and Play Around

DCKAP has created a Magento 2 demo store. Developers and Merchants are encouraged to login and play around to get a first hand ‘look and feel’ of Magento 2.

Login Details

Store URL – http://magento2demo.dckap.com/
Admin URL – http://magento2demo.dckap.com/m2admin/
Username-demo
Password-demo1234

PLANNING FOR A MAGENTO UPGRADE ?
Magento upgrades can be trickier than you expect. Leave it to the experts and we will take care of it.

This post Request Flow in Magento 2 appeared first on

Chennai Magento Meetup – Learn, Share and Network

$
0
0

 If you are a Magento developer or enthusiast who is keenly following the buzz around Magento, then Chennai Magento Meet up is the place to be in - Register Here

DCKAP an Associate Partner of Magento and Gold Sponsor of Magento Live Australia 2015 has been organizing Magento meetup at regular intervals – first Magento meet up was in Chennai on 27th September, 2014 followed by the second meetup on 28th March, 2015.

The previous meets have been a great success and we would like to thank everyone who participated, supported and made it happen.

This meetup will focus on both technical and business aspects of Magento. We will be holding tech talks, panel discussions, demos, and networking events.

It will be a great platform to share our/your experiences in Magento 1.x/Magento 2 and ways for businesses to leverage the power of Magento.

Come…Join us in the third Chennai Magento Meetup…enjoy the company of other Magento professionals.

Chennai Magento Meetup – Learn, Share, and Network.
Spread the word. Bring your Magento friends.

Let’s talk Magento!

When is it happening?

Sep 12 2015, 10 AM to 1PM (IST)

Where is the Venue?

DCKAP Technologies
L76A, L Block, 21st Street,
Anna Nagar, Near Chinthamani,
Chennai, Tamil Nadu 600102

 Registrations are open!!!  Click here to attend the event.

If you wish to share your expertise as a speaker, drop an email to magento@dckap.com

Come and be a part of the vibrant Magento community in Chennai!!!

This post Chennai Magento Meetup – Learn, Share and Network appeared first on

Magento 2 – Installing Composer

$
0
0
What is a composer?

Composer is a tool for dependency management in PHP. It allows you to declare the libraries your project depends on and it will manage (install/update) them for you.

Dependency management

To quote verbatim from getcomposer.org – Composer is not a package manager in the same sense as Yum or Apt are. Yes, it deals with “packages” or libraries, but it manages them on a per-project basis, installing them in a directory (e.g. vendor) inside your project. By default it will never install anything globally. Thus, it is a dependency manager.

Why Composer?

PEAR was built using the assumption, that PHP library components would be installed system-wide. As it turns out, this isn’t the best solution. In practice, different projects require different versions of the same libraries. If you upgrade system wide libraries, all dependent projects have to be upgraded, too.

So, composer fixes this issue. It installs required libraries separately for each project.

Suppose:

1. You have a project that depends on a number of libraries.

2. Some of those libraries depend on other libraries.

Composer:

3. Enables you to declare the libraries you depend on.

4. Finds out which versions of which packages can and need to be installed, and installs them (meaning it downloads them into your project).

Composer Repository

The Packagist website shows which packages can be installed through Composer. There is also a repository of Magento specific packages available on the Firegento website.

Packagist is used as a default repository for Composer, but you can add Firegento’s repository by editing your Composer configuration file. First, however, you’ll need to install Composer itself.

Magento 2 – Installing Composer 

First Composer basic Commands

a) All existing package

          composer show

 b) One particular package

          composer show vendor/package

 c) Update few packages and not all

          composer update vendor/package vendor/package2

 d) Update commands

          php composer.phar update  – Linux

          php composer update  - Windows

 e) Command removes packages

          php composer.phar remove vendor/package vendor/package2

 Basic Constraints

 1. Exact

          Example: 1.0.2

 2. Range

           Valid operators are >, >=, <, <=, !=.

Examples:

  • >=1.0
  • >=1.0 <2.0
  • >=1.0 <1.1 || >=1.2

 3. Range (Hyphen)

          1.0 – 2.0

 4. Wildcard *

          1.0.* is the equivalent of >=1.0 <1.1

 Version compatibility

-dev

  • -stable
  • -alpha
  • -beta
 Lock file  (To find the error log in the composer.lock file)

 composer.lock

 How to handle composer

 We need to use Tab key for configuring the composer.json file

Second

Third

 

This is just an introduction to Magento 2 – Installing Composer, there is a lot more to it – know more please go through the below documentations –

PLANNING FOR A MAGENTO UPGRADE ?
Magento upgrades can be trickier than you expect. Leave it to the experts and we will take care of it.

References:

http://magebase.com/magento-tutorials/composer-with-magento/

This post Magento 2 – Installing Composer appeared first on


Magento 2 – Dependency Injection

$
0
0

Dependency Injection is one of the most talked feature of Magento 2.  There have been major code changes in Magento 2 to implement in Dependency Injection. To understand the Magento 2 Dependency Injection, we first have to understand the Dependency Injection in general.

Dependency Injection in General :

A dependency is an object that can be used and an injection is the passing of a dependency to a dependent object that would use it. See the method below.

Screen1

There is nothing wrong with this method. It should return the desired value without any issues. When it comes to reusing this method, there are challenges. This method depends on DBConnection and hence it will force to use DBConnection  for every client call to getSkuById().

Lets consider that you want to use a new test database TestDBConnection. In that case, you have to do code modification in this method.

So to overcome this hard coded problem, you can inject the dependencies into the method through the parameters.

Screen2

Now this method is no longer dependent on the DBConnnection object. Now the clients using getSkuById() can initiate and pass the object to getSkuById() method as parameters.

However the dependency problem has not yet been resolved fully. We have just pushed the dependency to one level up and now each client using getSkuById() has became dependent. See an example of the client using getSkuById(). Here, view class is now dependent on DBConnection.

Screen 3

There are two solutions to overcome this problem.

  • One  is to continue the dependency injection all the way up through the layers.
  • Second is to use automatic dependency injection. With Automatic DI, an object does not need to locate an object or value in which it depends.

There are three types of Dependency Injection: Constructor Injection, Setter Injection and Interface Injection. Magento 2 uses Constructor Injection. See the explanation of DI types in Wiki.

Dependency Injection in Magento 2:           

Points to note about Magento 2 Dependency Injection.

  • Dependency Injection is an alternative to Mage class used in Magento 1.
  • Magento 2 uses Automatic Dependency Injection.
  • Magento 2 uses Constructor Dependency Injection.
  • Using Constructor for DI is a must.

The above given example will look like this in Magento 2.

Screen4

Here you see how Dependency is being injected to the constructor.

Screen5

In view class, we are calling getSkuById() but no where we are passing the database object to the constructor. This is being done by the Object Manager behind the scene. When we invoke the create() method of Object Manager, it creates the object for Product class, gets the value for the constructor parameter from instance configuration (one of the di.xml)  files and passes it to the constructor.

Instance Configurations can be specified at three levels:

  • app/etc/di/*.xml
  • {moduleDir}/etc/di.xml
  • {moduleDir}/etc/{areaCode}/di.xml

Inside di.xml :Attributes in di.xml

Screen6

type name : This is the name of the class to which the parameter has to be passed. In our example, this the Product Class.

argument name : This should be the name of the parameter or argument used in constructor. In our case. it is db.

xsi:type : This should be the type of the argument to be passed to the constructor. In our case, it is an object.

So when we invoke the create method of ObjectManager, object manager reads this di.xml file component and passes the Object of the DBConnection class to the constructor of the Product class.

There are other components of di.xml and that calls for a separate blog. In the next part of the blog, I will dig deeper and discuss factories, proxies and object manager in dependency injection.

PLANNING FOR A MAGENTO UPGRADE ?
Magento upgrades can be trickier than you expect. Leave it to the experts and we will take care of it.

This post Magento 2 – Dependency Injection appeared first on

MAGENTO CERTIFIED DEVELOPERS – A CRITICAL FACTOR IN PROJECT SUCCESS

$
0
0

Magento is one of the most popular platforms for eCommerce business. With its features, modules, extensions, scalability and customization options, Magento provides the perfect foundation for building featured and robust eCommerce stores.

When choosing Magento as your eCommerce platform, it is very important to choose the right Magento solution company which includes Magento certified developers. Magento certified developers have the right business and technical staff to offer you the best solution.

Magento Certified Development team

A Magento certified development team includes:

  • Magento Certified Solution Specialist
  • Magento certified Front End Developer
  • Magento Certified Developer Plus
  • Magento Certified Developer

Developing a successful Magento site requires its own set of coding standards and development process. Magento certifications emphasize a comprehensive understanding of the code frameworks and pave the way to explore the standards thoroughly.

It is in your best interests to have Magento certified developers work in your eStore. This will ensure effective and efficient coding with clean standards.

Features alone do not make a website. Scalability, security, performance, and upgrades to higher versions have to be considered. For e.g. making needless changes in the core will make future upgrades difficult.

When a particular feature or functionality is needed for the eCommerce store, Magento certified developers have the knowledge and expertise to analyze if the functionality is available in native Magento or if an extension is available for the same. They avoid making changes to the core as it makes future upgrades difficult.

The cost of Magento certified developers might be marginally higher compared to non certified developers or freelancers. This delta cost is justifiable considering the expertise they bring in, consistency of their work and assured return on the investment.  Project costs spiral because of lack of expertise and rework. This is largely avoided when a Magento certified development team is involved.

Listed below are some of the significant benefits of working with a Magento certified team:

  • Correct Magento Framework and coding standards are practiced leading to clean code quality.
  • The team understands the Magento architecture and application flows that are required for the business scenario.
  • They will be aware of latest Magento updates and features that need to be implemented.
  • Add new features/customizations with less core overriding and also without affecting site performance.
  • Provide assurance with zero critical errors/bugs at the project completion stage.
  • Scalable web store with minimal maintenance.
  • A certified professional team will be able to complete the project under budget, on or before allowed time and with the highest quality.

To know if a development agency has Magento certified developers in its rolls, you can enter the name of the development agency in the below URL…

https://www.magentocommerce.com/certification/directory

This enables you to choose the right Magento development agency.

The quality of the people you work with decides your business success. Finding the right resource with the right skill is the most challenging task in today’s market place. If that falls into place, half the work is complete. The rest is execution.

Working with Magento certified developers make the execution smooth and seamless.

PLANNING TO BUILD AN ECOMMERCE BUSINESS?
Drop us a line at info@dckap.com , we will be happy to assist you.
 Reference

http://magento.stackexchange.com/questions/1204/magento-certification-is-it-worth-it

https://www.linkedin.com/pulse/20140626084043-241739805-magento-certification-approved-excellence-your-business-needs

http://www.quora.com/What-is-the-benefit-of-earning-a-Magento-certification

http://magento.com/training/catalog/certification

 

This post MAGENTO CERTIFIED DEVELOPERS – A CRITICAL FACTOR IN PROJECT SUCCESS appeared first on

Magento 2 Request Routing

$
0
0

Routing is a fundamental part of all MVC frameworks. In order to understand how Magento2 request routing works, it is essential to get familiar with execution flow that leads to certain request getting (or not getting) dispatched.

Routing is the process of determining the current request and validating the request in the router list. After installing front controller and matching a router in the database, Magento should be able to match the URL to a module controller and action name.

Magento 2  Request Routing
  • Route determination starts the search for the current route
  • Routing process handled by Front Controller and determined in the system
  • lib/internal/Magento/Framework/App/FrontController.php
  • The “Dispatch” function is built for the routing process in the front controller
Request Process Flow

router

Routing Algorithm

Explanation:
    • Front controller, iterates over available routers to find the current request using match-logic. The request route should be dispatched a maximum of 100 iterations or else its throw an exception. 
    • RouterList needs to be involved in the routing process. This object is injected from Magento/Framework/App/RouterList. 
    • Once the current request matches the router list, set the dispatch action as true and also get the response from the “setNoCacheHeader”. 
    • If the current request does not match the router list, it should throw an exception and the router needs to be forwarded  to  “noroute” action, i.e. redirected to 404 page.  
Structure of Router List:
  • Magento 2 is a dependency injection system. Each and every module is allowed to do RouterList. 
  • For Example: Magento_Store module supplies the Base and DefaultRouter

  • Routers are listed based on the sort order item, preferably in ascending order. The Base router always comes before the DefaultRouter.
  • In default Magento 2 installation, the DefaultRouter has the lowest priority. It will be the last to be validated for matches in the Front Controller. The DefaultRouter is always redirected to 404 page.
  • Once the Base router is processed, it will split into Module, Controller and Action, following which, action will be dispatched and performed with the current request.

Request routing in Magento 2 is a vast topic to dive-in and explore. Hope this blog serves as an introduction to Request Routing.

Useful Links
Demo Store – Feel Free to Login and Play Around

DCKAP has created a Magento 2 demo store. Developers and Merchants are encouraged to login and play around to get a first hand ‘look and feel’ of Magento 2.
Login Details

Store URL – http://magento2demo.dckap.com/
Admin URL – http://magento2demo.dckap.com/m2admin/
Username-demo
Password-demo1234

PLANNING FOR A MAGENTO UPGRADE ?
Magento upgrades can be trickier than you expect. Leave it to the experts and we will take care of it.
References:

http://magento.stackexchange.com/questions/72923/request-flow-of-magento-2
http://inchoo.net/magento/custom-router-in-magento/
http://www.techytalk.info/routing-in-magento-tracing-single-http-request/

This post Magento 2 Request Routing appeared first on

Recap of Magento Live Australia 2015

$
0
0

Working at DCKAP means several things. One of them is that you are part of the Magento community. The second thing is getting the opportunity to travel and meet with people who are passionate about Magento.

We had the wonderful opportunity to experience Magento Live Australia 2015 on Nov 18th and 19th in the beautiful and vibrant city of Sydney.

 

First Day

Nov 18th was a historical day in the annals of Magento. Magento 2, the new digital commerce platform was launched.

We were proud to be there during the launch. Magento 2 empowers brands, retailers, and businesses across B2C and B2B industries. With the new digital commerce platform, we hope Magento will consolidate its leadership position in the open source eCommerce space.

 

Magento also has Retail Commerce and Order Management in its product lineup. Retail Commerce allows managing orders and inventory distribution centers, stores, drop ship partners, and more.

Order Management is a Magento Point-of-Service that allows store associates to pick orders, print receipts and labels, and facilitate orders for in-store pickup.These products when combined with Magento 2 make for a powerful combination.

Merchants who had  gone live on Magento 2 were announced to an enthralled audience.

The first major Breakout session of the conference was the presentation on ‘Post Launch Success: Building the Right Team and Processes’  by Karthik Chidambaram, Founder & CEO, DCKAP and Bart Jensen, VP of Client Services & Consulting, DCKAP.

Through case studies, Karthik and Bart shared their experience and successes on team building, communication and processes that lead to excellence in delivery.  The presentation was well received by the fully packed audience.

There were other interesting sessions throughout the day.

The first day ended with a celebration and networking party in Café Del Mar (Cockle Bay Wharf).

Second Day

The second day of the conference started with Pitchfest.  The participants were given 90 seconds to present an elevator pitch about the company’s product/technology.

The first company to pitch their product (Productimize) was DCKAP.  Anees, the presenter, put forth the purpose, usability, benefits and the uniqueness of Productimize to an eager audience in an impactful way.

The second day saw many more engaging sessions for the solution providers, technology partners and merchants.

Magento 2 trained solution partners were also announced.

IMG_7501

Mark Lavelle, CEO,  thanked all for making MagentoLive Australia 2015 a grand success.The day ended with a session by Paul, VP of Product Development. He took the audience through the triumphs and challenges in Magento 2 development and how it will change the rules of the game in eCommerce space.

Networking

The best part of the conference, like any other Magento conference, was the opportunity to network. It was a great to connect with merchants, Magento experts and other solution/technology vendors. Without a doubt, MLAU 2015 provided a great platform to interact with the community.

Network Photo-Reduced

Takeaways

The participants were excited about the launch of Magento 2. There were discussions about migrating existing customers to the latest platform, training programs for Magento 2, the ‘extension’ eco system, the new Magento connect, the next major release, and more.

Magento 2, Retail Management and Order Management made the Magento community look forward to exciting days ahead.

PLANNING FOR A MAGENTO UPGRADE ?
Magento upgrades can be trickier than you expect. Leave it to the experts and we will take care of it.

This post Recap of Magento Live Australia 2015 appeared first on

Chennai Magento Meetup – Get connected to the Magento Experts

$
0
0

Welcome to the most exciting Magento meet up in this part of the world – Chennai Magento Meet Up. Register Here

Whether you’re a beginner in Magento or a Magento expert and want to share your experiences, you are most welcome to join us.

DCKAP, a Magento 2 Trained Silver Solutions Partner has organized 3 Chennai Magento Meetups in the past and we are proud to announce the 4th Chennai Magento Meet Up on 9th Jan 2016. We would like to thank everyone who participated and supported the previous meet ups.

Magento is recognized as the leading eCommerce platform by the 2015 Internet Retailer Top 1000, B2B 300 and Hot 100 lists. Magento Commerce works hand in hand with retailers, brands and branded manufacturers across B2C and B2B industries to successfully integrate digital and physical shopping experiences.

The meet up will be full of good ideas, interesting discussions, and great presentations! It will be fun, chatting about e-commerce, Magento 2, development practices, performance optimization, and life as a Magento geek in general.

Let’s network, share our experiences and create synergy.

Spread the word. Bring your Magento friends.

Let’s talk Magento!

When is it happening?

9th January 2016, 10 AM to 1PM (IST)

Where is the Venue?

DCKAP
L76A, L Block, 21st Street,
Anna Nagar East, Near Chinthamani,
Chennai, Tamil Nadu 600102

Registrations are open!!!  Click here to attend the event.

If you wish to share your expertise and knowledge as a speaker, drop an email to
magento@dckap.com

Come and be a part of the vibrant Magento community in Chennai!!!
Blog Posts on past Chennai Magento Meetups:

http://www.dckap.com/blog/chronicles-chennai-magento-meetup/

http://www.dckap.com/blog/magento-meetup-chennai/

http://www.dckap.com/blog/magento-meetup-in-chennai-2/

This post Chennai Magento Meetup – Get connected to the Magento Experts appeared first on

Implementing SOAP & REST API in Magento 2

$
0
0

Magento web API framework is used to communicate third party services with the Magento System. In Magento 2, the web API allows exposure of the module API (service contact) through the WEB API. It extends the  functionality from Magento 1 API.

Each repository and API are available through web API. It follows strict definition for all the classes, parameters and return values.

We have to declare a URL in webapi.xml and need to specify the required interfaces (available services) and methods for the APIs.

Implementing SOAP & REST API in Magento 2

We have two types of protocols to make a repository available through web API

  • SOAP API (Simple Object Access Protocol)
  • REST API (Representational State Transfer) 

It is easier to implement REST API because it is less strict than SOAP API. The implementation is taken from the di.xml file, which calls the method.

The diagram below shows the process in detail.

D1

 Example webapi.xml 

1D1a

Router contains the URL and a method (GET, POST, and DELETE).

Service defines the interface class and the method for handling.

Resources defines the list of users (ACL Resource) for accessing the web API.

Three types of resources are available in Magento 2 for the web API

  1. Self - available for customer data
  2. Anonymous – available for all
  3. Magento ACL  - Admin user (this requires permissions)
Web API Authentication 

There are three types of Authentication

  1. OAuth
  2. Token Based
  3. Session Based 

For Token based authentication, we need to create an Admin user with specific permission.

Integration of Web API

To create an integration, click System > Integration > Add New Integration. Be sure to restrict the resources that the integration can access.

Below are the screen shots of the procedure for new Integration and Activation.

D1a

D2a

D3a

D4a

SOAP WSDL URL

WSDL is generated automatically for both system and custom services.

WSDL Structure

http://You Magento Host / soap?wsdl&services=  [Defined List of services]

Example:

D5a

 REST Authentication

This supports token based authentication.

URL for accessing through REST

http://{Your Magento Repo}/rest/V1/ConsumerRepo?{Arguments}

Example:

curl  -X GET “http://127.0.0.1/m2/rest/V1/ConsumerRepo” –H  “Authentication : Bearer_Token-“

One of the many goals of Magento 2 is  to improve on the web APIs. For more information on Magento 2 web API , please go through the documentation below…

http://devdocs.magento.com/guides/v2.0/get-started/bk-get-started-api.html

PLANNING FOR A MAGENTO 2 MIGRATION ?
Magento 2 migration can be trickier than you expect. We are a Magento 2 Trained Solution Partner. We will help you move seamlessly to the new platform.

This post Implementing SOAP & REST API in Magento 2 appeared first on

How to Remove Header and Footer in Magento 2?

$
0
0

Magento application implements the Model-view-controller architecture pattern; meaning, the Magento software is architected into layers, including the view layer.

Magento layouts are very important for theme development. Layouts are xml files located in your theme/layout folder. Layout files are responsible for setting positions of various elements on the page and determining which phtml is loaded on which page and placed where.

The basic elements of Magento layout are Header, Footer, and the Main Content. Since main content differs for every page whereas the common elements like header, footer and some default static resources (css, js, fonts) are the same and are loaded for each page.

In some places, we do not need headers or static blocks. For example, we do not need the default elements in the pages returned by AJAX requests, emails, HTML snippets etc.

Image1

In this blog we will discuss about how to remove header footer in Magento 2? There are different ways to do this. We will discuss further detail implementation of each type and its pros and cons.

Remove Static Resources (JS, CSS, Fonts) & Elements

To remove the static resources and elements, you can use the below code in your layout file.

The disadvantage of this method is that since we are unaware of some of the default elements and static resources, we will not be able to remove all the elements. 

Changing Layout Type

The type of page layout to be used for a certain page is defined in the layout file, in the layout attribute of the root <page> node.

To load an empty page without headers or other elements, set the layout type to empty. (layout=”empty”).

Image2

The disadvantage of this type is that though it displays an empty page, it loads all the css and js and default page elements except header and footer. 

Generic Layouts

Magento has 3 layout types – Page layout file, Page Configuration file and Generic Layout.

Generic layout defines the contents and detailed structure inside the <body> section of the HTML page markup. These files are used for pages returned by AJAX requests, emails, HTML snippets and so on.

This layout type will load only the defined contents. The disadvantage is that it will also load some default static resources.

Load Template From Controller

The below code will help to remove the default elements and the static resources.

The best way to load our content without Magento default elements and static resources is to instantiate our block from controller file instead of defining it in layout file.

Controller file to instantiate our block.

 

The above file instantiates our block, through that we can call our template in controller.

By this way we can load our content in an empty Magento page without any header, footer or static resources. This type will be used while loading content through Ajax request, email or html snippets.

PLANNING FOR A MAGENTO 2 MIGRATION ?
Magento 2 migration can be trickier than you expect. We are a Magento 2 Trained Solution Partner. We will help you move seamlessly to the new platform.

This post How to Remove Header and Footer in Magento 2? appeared first on


Popular B2B Extensions For Your Magento 2 Store

$
0
0

Globally, by 2020 the B2B ecommerce market will be twice as large as the B2C market — $6.7 trillion vs. $3.2 trillion — according to research provider Frost & Sullivan.

More and more B2B buyers want their experience to be similar to the B2C ecommerce purchase experience. B2B is a very diverse marketplace and extensions add value to the eCommerce platforms that server the B2B market.

Magento Marketplace

More and more B2B implementations are happening in Magento. Extensions are playing a vital role in filing the gaps and making the customer experience seamless and similar to B2C.

Magento recently launched a new marketplace for Magento 2 modules. In future, we will be able to upload the M1 extensions as well in the new marketplace.

Sample Request for B2B

In B2B business, it’s very difficult to increase the revenue. It is in the nature of buyers to have concerns and queries about the quality of the products they are planning to purchase. This is truer if the purchase is in bulk quantities. To clear the doubts in the minds of the customer, samples of the product can be provided. This enables the customer to check the quality of the product and also helps to increase his confidence level. Providing samples could be a great motivation for the customer to make the purchase from the store.

A partial list of features

  •  To request the samples from a simple form in Magento product detail page.
  •  Notification to admin once a customer requests a sample.
  •  Updating the customer account once the admin processes the request.
  •  Notification to the customer via email whenever the request status is updated.
  •  Detailed statistical report for the admin about the order conversion.

Screenshot of Sample Request Page from DCKAP extension Sample Request for B2B

magento 2 extension - request sample

Also available for Magento1.x

Call to Order / Call Back

In a B2B business, administrators may not wish to display the price for some of the products. They may display the phone numbers of the sales team instead, encouraging customers to call for product enquiries.

A partial list of features

  •  To show the call to order and call back options in product list and detail pages.
  •  Options for admin to manage the call to order options from the back end.
  •  Flags to enable/disable the call to order options for each product.
  •  Configuration to set the call to order option when the product price is 0.
  •  To place call back options in product list and view pages.
  •  When the call back option is enabled, customers will be able to input their information in the form and it will be notified to the administrator.
  •  The users can enter their preferred time to get the call from the administrator.
  •  Admin can track the call back information based on the communication with a particular customer.

Screenshot of Call Back Information page of DCKAP extension Call to Order/Call Back

Magento 2 extension - calback

Quick Order

In B2B business, once the customers have identified their favorite vendors or suppliers, they usually place orders for specific items regularly and in bulk. The customers would prefer a much more user friendly way to navigate/search those specific items to add to the cart. Customers would prefer to place the orders quickly and get on with their other tasks. Quick Order extension should enable the customer to do this.

A partial list of features

  •  Feature to enter the SKU/Name, search those items and display suggested items based on search terms.
  •  Enter part number with quantity and add the items to cart if the customers know the SKU/Part No.
  •  Feature to add multiple items in comma separated format.
  •  Admin can change the separator for SKU and quantity from the backend settings.
  •  Admin can also change the number of characters needed for product auto suggestion

Screenshot of Add to Cart page of DCKAP extension Quick Order

magento 2 extension - quickorder-items

B2B is a huge market and in US B2B eCommerce is twice as large as B2C eCommerce. So there is a great need for extensions that cater to the B2B marketplace. B2B buyers are looking for a self-service automated approach to purchasing.

DCKAP recently launched a few must have B2B modules for Magento2. It is available in both DCKAP Store and Magento Marketplace.

The above list of extensions is only a partial list. Keep visiting our store. We have few more interesting B2B extensions lined up for release.

YOUR RELIABLE PARTNER FOR MAGENTO EXTENSIONS
  • Free Support
  • 30 Day Money Back Guarantee

Reference

http://www.practicalecommerce.com/articles/85970-B2B-Ecommerce-Growing-Becoming-More-Like-B2C

This post Popular B2B Extensions For Your Magento 2 Store appeared first on

How To Create a Tab in Customer Admin Edit in Magento 2 ?

$
0
0

Merchants may want to view some additional information like comments , reward points etc of a particular customer in the back end.  In order to show this, we need to create a tab in the customer admin.

In this blog, we shall see, how to create a new tab in the customer admin and to load custom PHTML into it. Let us say, the tab’s name is “Customer Credit”.

Before creating the customer tab, we need to create a new module. We already have a blog on “How to create a new module in Magento 2?” . Please refer the same for more details.

Step 1:

To create a new tab in the admin customer edit, create a xml in the following path

/app/code/Vendorname/modulename/view/adminhtml/layout/customer_index_edit.xml

 

Step 2:

Create a block file in the below path to load the contents when the tab is clicked

/app/code/Vendorname/Modulename/Block/Adminhtml/Edit/Tab/Credit.php

 

I have the block name as “Credit”. The block implements from  TabInterface. The most important function in this class is : getTabUrl()  and isAjaxLoaded() :

getTabUrl()  contain the  code  return $this->getUrl(credit/*/credit, [‘_current’ => true]); equal go to action and execute the complete path of your controller in Magento 2.

 

Step 3:

Following is the routes.xml for creating a controller to make the url valid.

/app/code/Vendorname/Modulename/etc/adminhtml/routes.xml 

 Step 4:

Lets now create a controller with the class name Credit in the below path :

/app/code/Vendorname/Modulename/Controller/Adminhtml/Index/Credit.php

 

Step 5:

Create another xml to mention which phtml file has to load

/app/code/Vendorname/Modulename/view/adminhtml/layout/credit_index_credit.xml

Step 6:

Finally create the phtml file and type your text or implement your logics with block and controller.

/app/code/Vendorname/Modulename/view/adminhtml/templates/credit.phtml

This is our new tab.

Now clear your cache. System – > Cache Management – > Flush Magento Cache

After clearing you cache, your admin will look like the image below…

customer admin edit magento 2

PLANNING FOR A MAGENTO 2 MIGRATION ?
Magento 2 migration can be trickier than you expect. We are a Magento 2 Trained Solution Partner. We will help you move seamlessly to the new platform.

This post How To Create a Tab in Customer Admin Edit in Magento 2 ? appeared first on

Magento 2 Theme Does Not Show Up in Front End

$
0
0

In one of our recent projects, we installed a new Magento 2 theme. Even after the theme was installed, the theme’s content was not displayed in the front end.  At other times, the theme’s content like the home page design,the product page design may not show up in the front end.

The screenshot below highlights the above problem

magento 2 themes

There are two scenarios in which the theme may not show up in the front end.

Scenario 1

Theme record may not have been inserted in the Theme table.

  • Check the theme table to ensure if the new theme has been inserted.
  • If not,then insert the new theme in the Theme table using following SQL command.
Insert Data in Theme Table

Scenario 2

If the theme record is already available in the Theme table, then there are chances that the ‘Theme Type’ would not have been set to 0, which is Physical.

There are 3 theme types – 0–Physical, 1-Virtual and 2–Staging.

Ensure that the ‘Theme Type’ is  Physical (i.e.) 0.
In the screenshot below the ‘Theme Type’ is set as 1-Virtual

magento 2 themes

In  the screenshot below the ‘Theme Type’ has been changed to 0-Physical

magento 2 themes

 

Once you have made the above changes, you need to run the below commands in our SSH terminal.

  • php bin/magento setup:upgrade –keep-generated
  • php bin/magento setup:static-content:deploy
  • php bin/magento cache:clean
  • php bin/magento cache:flush

Hope the blog helped you to resolve the issue. Get back to us if you have any comments or feedback.

PLANNING FOR A MAGENTO 2 MIGRATION ?
Magento 2 migration can be trickier than you expect. We are a Magento 2 Trained Solution Partner. We will help you move seamlessly to the new platform.

This post What To Do When Your Magento 2 Theme Does Not Show Up in Front End? appeared first on

integrating magento with shipstation

$
0
0

One of the Magento Enterprise projects that we recently implemented had the following requirement – to automate tasks associated with eCommerce fulfillment, order management, and shipping . Once automated, it will save many business hours to the client. ShipStation extension for Magento Enterprise was chosen for automating the same.

ShipStation is a web-based shipping solution that facilitates the order fulfillment process and allows to create shipping labels for all major carriers. A free extension is available on Magento Connect for communication between Magento and ShipStation.

This blog describes how to integrate ShipStation API with Magento to get rates (‘get shipping rates’) and create labels (‘create shipment labels’) for orders.

After installing the above extension, we need to create a SOAP or API User(s) in Magento and create roles with privileges that allows access to customers, orders, and products. All orders from Magento are synced to ShipStation.

 

ShipStation API

ShipStation API allows ‘read’ access to your account and ‘write’ access to specific objects like Orders, Customer, and Products.

This API can be used to automate many tasks like Managing Orders, Manage Shipments, Create Shipping Labels, Retrieving Shipping Rates … etc.

 

API Requirements

Endpoint

https://ssapi.shipstation.com/ .

Please Note: You cannot access this URL directly

Authentication

The ShipStation API uses Basic HTTP authentication. Use your ShipStation API Key as the username and API Secret as the password. You can find your API Key as the username and API Secret under Settings at https://ss.shipstation.com/#/settings/api .

The Authorization header is constructed as follows:

  • Username (API KEY) and password (API Secret) are combined into a string “username:password”
  • The resulting string is then encoded using the RFC2045-MIME variant of Base64, except not limited to 76 char/line
  • The authorization method and a space i.e. “Basic ” is then put before the encoded string.

For example, if the API KEY given is ‘ShipStation’ and the API Secret is ‘Rocks’ then the header is formed as follows:

PHP Code for Generate Authorization

  • Authorization: Basic U2hpc QxZm wZjhiFN0YXR wZjhipb24 wZjhi6Um9j wZjhia3M=

 

Server Responses

There are several responses are available, among them few status code given below.

  • 200 – OK – The request was successful (some API calls may return 201 instead).
  • 400 – Bad Request – The request could not be understood or was missing required parameters.
  • 401 – Unauthorized – Authentication failed or user does not have permissions for the requested operation.
  • 500 – Internal Server Error – ShipStation has encountered an error.

 

List of Carriers

Get all carriers which are configured in ShipStation.

Get Rates

Get all the shipping rates of carriers which are configured in Shipstation.  We need to send a couple of parameters in json format.

Create Label for Order

Creates a shipping label for a given order. The labelData field returned in the response is a base64 encoded PDF value. Simply decode and save the output as a PDF file to retrieve a printable label.

Before creating a label we need to get the orderId from Shipstation and also shipping address should be verified in the Shipstation account.

Hope the information provided was useful. Feel free to get in touch with us if you have any queries.

PLANNING FOR A MAGENTO 2 MIGRATION ?
Magento 2 migration can be trickier than you expect. We are a Magento 2 Trained Solution Partner. We will help you move seamlessly to the new platform.

Reference

http://docs.shipstation.apiary.io/#reference

 

Suresh Selvam

suresh selvamSuresh, Technical Architect, is one of the senior most employees of DCKAP. He is Magento Developer Plus certified and an all-rounder with a range of technical & management skills. In crisis (technical or otherwise) , he steps in and restores order. He is helpful and always a phone call away.

 

This post Integrating Magento With ShipStation appeared first on

Attaching a PDF File To An Email In Magento 2

$
0
0
magento2 p21

This blog provides the complete code to send a custom email from any event, configuring the email templates from the backend and attaching pdf files in email.

First, create a module. Refer the blog  – How to create a module in Magento 2?

We have created a module with the Dckap as Vendor name and CustomModule as Module name.

Here we have assumed a B2B scenario in which the customer applies for credit through an application form on the website, saves and uploads the file. On successful upload, an email with a PDF attachment is fired to the accounting team informing about the application for credit from a customer. 

Put simply, if you are planning to send an email along with a PDF file you have to follow the below steps…

Step 1:

To begin with, create an email_templates.xml file in app/code/Dckap/CustomModule/etc folder with the following content.

template id is the email template identifier. The template identifier will be provided based on the section_id_group_id_field_id which is declared in the system.xml.

email_report have is a file name in HTML format

section_id_group_id_field_id will be explained in the following sections.

Step 2:

Create a template file in the path app/code/Dckap/CustomModule/view/frontend/email/email_report.html and the content for email can be added by declaring the template variables from the action file. For instance here the Customer details have been set as a content for email.

The name and email values have been set on templateParams array which has been configured in the action file. We can translate the string “Name:” and “Email:”  embedded in a <p> tag just by opening the two curly braces {{ followed by trans,  the string that should be translated in double or single quotes and two closing curly brackets }}.

Step 3:

The created email template can be configured from the admin by creating the system.xml file. Add a file system.xml with the following code in the path app/code/Dckap/CustomModule/etc/adminhtml/. This will hold a default value for email template which will be defined in config.xml

In this blog, we are going to use the ‘Sales’ section in the back end where the email template for the credit email can be configured. The section id is going to be ‘sales_email’, under which a separate group with  group id as ‘dckap_accounting’ will be created and labeled it as ‘Dckap Accounting’.

It’s time to create a field under the group with the field id as ‘credit_email_template’.

Also, there is one more field from which the receiver email (Accounting email ) could be configured with the field id as copy_to_accounting. The email id can be validated while saving the configuration, provided that <validate>required-entry validate-email</validate> is given.

The field created will be given with the source model ‘Magento\Config\Model\Config\Source\Email\Template’ with the all available email templates. The source model is a model of data that we can use for configuration.

magento 2 p21

The screenshot shows the fields (Dckap Accounting) created in system.xml

Step 4:

Create a config.xml file in the path app/code/Dckap/CustomModule/etc/ for setting the default template value (i.e., email_report.html as default) in the admin custom field that has been created using system.xml.

The default value for the field created through the system.xml can be given by config.xml where the structure follows as above.

Step 5:

Once the code for the email template and the configuration file has been added it’s time to formulate the email send function in the helper class as follows in path app/code/Dckap/CustomModule/Helper/Emailreport.php. The following code will be able to send the pdf attachments in the email if the path of the PDF file path is defined.

The function sendEmailReport is responsible for sending the email. This function can be used from any of the actions for sending the email with the pdf file or without the pdf file.

Step 6:

If your email has the requisite for attachment of pdf file then the following file has to be built in…app/code/Dckap/CustomModule/Model/Mail/TransportBuilder.php.

Magento uses Magento\Framework\Mail\Template\TransportBuilder to send email in which adding attachment has not been supported yet. Hence we are overriding the class in our custom module.

Step 7:

Add di.xml in the file path app/code/Dckap/CustomModule/etc/di.xml to set the preference to our custom TransportBuilder class for the core TransportBuilder.

Step 8:

It’s all set now! We will be able to send an email to accounting team with the pdf file attached by the customer.

The following snippet can be added in any action from which the email has to be sent. Declare the template path in a variable as follows

Hope the article was useful. Please let us know if you have any queries or comments.

Viewing all 135 articles
Browse latest View live