Magento 2
 /   /  Magento 2

Adminhtml UI: Create your custom linked products type programmatically like (Related Crosssell Upsell products )

Magento 2,  programming, 

1 - Explanation :
The product get all linked product (related, upsell ..) on save with function getList inside Magento\Catalog\Model\ProductLink\Repository 
    public function getList(\Magento\Catalog\Api\Data\ProductInterface $product)
    {
        $output = [];
        $linkTypes = $this→getLinkTypeProvider()→getLinkTypes();

 

Read more

Ultimate Magento 2 Improved Import & Export Extension by Firebear

magento2,  extension, 

Chances are, you’ve been trying to enhance your Magento 2 website with the best extensions the Magento 2 ecosystem offers. Unfortunately, it is not the most straightforward task since there are a plethora of reliable modules and it is hard to find the best solution. The area of import/export tools is not an exception so we’ve decided to share an extension that pretends to be a leading solution. Meet the Improved Import & Export module by Firebear. Have you ever imagined a perfect tool capable of moving all the possible data to/from your e-commerce website? Guys from the Firebear studio have already tried to visualize this concept. And below we shed light on its features.

Download / Buy Firebear Improved Import & Export Magento 2 Extension

Read more

Magento 2 Kill EAV For Customers video courses Part 2

magento2,  programming, 

Magento 2 professional serie videos -kill  Eav for customer - give you the ability to play add remove show  add custom attributes  , customize events  , explore structure db and more ....
 

The Part 2 Recover:

  • First way to Show atrribute field in frontend (edit customer section)
  • Second way to Show atrribute field in frontend (edit customer section)
  • Save Attribute Value to db by plugin
  • How inject action around creation of customer (for example to vaildate phone number or send activation code before create customer , you can ignore creation of customer if the phone is not valide)
Read more

Magento 2 Kill EAV For Customers video courses Part 1

magento2,  programming, 

Magento 2 professional serie videos -kill  Eav for customer - give you the ability to play add remove show  add custom attributes  , customize events  , explore structure db and more ....

The Part 1 Recover:

  • Some notes about eav (i have used phpmyadmin to explain this point)
  • Add attribute to customer with Setup.php file (phone number by example)
  • Show attribute in admin (edit customer section) and in frontend (create customer section)
  • Save attribute value to db 
  • Other point inside the course explore and create query mysql inside terminal , we worked inside docker and with netbeans IDE .
Read more

Magento 2 Get One Search Result by Sku (Free Extension with explanation of code)

Magento 2,  programming,  extension, 
By default when you enter sku reference in quick bar search of Magento 2 , It displays all the product whose sku is having prefix of entered sku , By example if you enter 'BHSHIRT-F' for searching specific proudtc which have this reference as value , you will get  more tahn one for example ' BHSHIRT-FX1 and  BHSHIRT-FX2' .
Why ?
Now in Magento 2 we have in database catalogsearch_fulltext_scope1 and catalogsearch_fulltext_scope2 , is related to how many scope you have , let's imagine you have 2 store one for English and other for Arabic ,  the system create 2 scope . And stock the map of search inside this tables , but how ? Yeah let's go and see the structure of table ,this table have 3 columns entity_id and atrribute_id and data_index :
entity_id : id of entity or product that mapped with this infos
atrribute_id : id of attribute related to attribute set of product by default title and short description and description attribute used in map
Read more

Show Hide Fields (ex : street , city , region , country ….) in Checkout page

magento-2,  programming, 

The checkout page contain standard fields , in many cases the site owner needs to hide some fields for specific reason , the system give you the ability to hide some fields directy from xml , you can add checkout_index_index.xml (copy same structure or just what you want from this path vendor/magento/module-checkout/view/frontend/layout/checkout_index_index.xml) to you theme or your custom extension and start hiding some fields .

Read more

Magento 2 Layouts and blocks inside php

magento-2,  programming, 

Magento 2 have a good system for  organize the blocks by layouts, In Magento 2 that is more flexible . You can play by many ways .

We want show how the developers can play with all the puzzle (layout block template and structure), the framwork Magento 2 have a component called View ("vendor/magento/framework/View"), it have almost all needed class for manage the frontend view in back and font office ,
 you can inject the class Magento\Framework\View\Layout  by factory for get instance of layout class . let's imagine your contruct  in plugin by example is

Read more

Track V1 Rest url (how you can explore the path of request)

magento-2,  programming, 

Magento choose to use some interaction client as service (click) , for example when you try to place order you get url like rest//V1/guest-carts/:cartId/payment-information , ok but how you can see where is point this url ? Is a module controller action url ? Wrong is a service .

Read more

Magento 2 For developer : some ideas about Search Framwork

Magento 2,  programming, 

The search use 3 request name in magento 2 :

'quick_search_container' when you search from the small field text in the top

'advanced_search_container' when you use the advanced search page

'catalog_view_container' when you entre to category page or use filter in category page it's work by default

inside class Magento\Framework\Search\Search the function search(SearchCriteriaInterface $searchCriteria) build a request with class Magento\Framework\Search\Request\Builder; it's start by puched in object $this->requestBuilder the query name example 'quick_search_container'

Read more

Magento 2 For developer : some ideas about frontend search

magento-2,  programming, 

For customize behavior of search you need know the mechanism of how Magento 2 stock and collect infos and how used  it, Now in Magento 2 we have in database catalogsearch_fulltext_scope1 and catalogsearch_fulltext_scope2 related to how many scope you have let's imagine you have 2 store one for English and other for Arabic ,  the system create 2 scope . And stock the map of search inside this tables , bot how ? Yeah let's go and see the structure of table ,this table have 3columns entity_id and atrribute_id and data_index

Read more

Magento 2 Call media gallery (product images) in product list

Magento 2,  frontend,  programming, 

After see many frontend developers peoples search for how call gallery in product list page , we decide to write small course (tutorial) for how done this task .Ok first you need create class helper inside your module , for example Ibnab/Common/Helper/Data.php and push the code

Read more

Magento 2 More details about checkout page

magento-2,  programming, 

The checkout process in Magento 2 it's more practice and more abstracted with new generation ideas of user experience , in this course ibnab try to give you some key for customize the checkout page .

Saw the system use component for create and manage the page checkout, it's start from the layout checkout_index_index.xml in path vendor/magento/module-checkout/view/frontend/layout 

Read more

Magento 2 backend add custom grid action (target _self or _blank)

Magento 2,  backend, 

Ok the new generation of ui grid in magento 2 give you the ability to create or change grid  with xml file, this xml use extern php file for getting all part needed .
Our example here is the grid action like edit in catalog product grid or delete preview in page cms grid ,
ok we want add custom action .

Ok the xml responsible for ui grid of  product list in backend is vendor/magento/module-catalog/view/adminhtml/ui_component/product_listing.xml , and for action you will inside this file :

Read more

Free Magento 2 Easy Mega Menu

magento-2,  extension, 

Without high technical knowledge , Easy Mega Menu give you the ability to create an organized menu ,
You have a lot of products , give a best user experience to customer :


Manual installation :

    download from store

    past in your folder app/code

    enable extension in app/etc/config.php by adding 'Ibnab_MegaMenu' => 1,

    and execute the command php bin/magento setup:upgrade

   and execute the command rm -rf var/view_preprocessed/  pub/static

   and execute the command php bin/magento setup:static-content:deploy

Read more

Migrate Form ATG Commerce to Magento 2 (concept and programmation) (part1)

Magento 2,  programming,  products,  ATG, 

In the world of the big business  appear Oracle ATG Commerce , in many statistic It occupies an advanced position , yes the Magento 1   It has several elements to accommodate large-scale projects and it needs ,  But it lacks the tools by which tasks are separated, and the removal of conflict, the user experience in admin, default unit test tool , it's real and flexible system but with old mechanism  , In Ibnab we think the Magento 2 is here for taking  advanced position in this domain of big  business  and  large-scale projects .

Read more

Magento 2 Paypal Fee (charge) and life cycle

Magento 2,  programming, 

In magento 2 paypal is implemented with module Payal , in case if the customer choose payapl as method of payment M2 use Magento\Paypal\Model\Cart in place of \Magento\Payment\Model\Cart , it used for collect items and amount and validate the infos collected before sending to paypal ,

The model have more additional methods as (it extend from parent Magento\Paypal\Model\Cart) :
getAmounts()  : Get shipping, tax, subtotal and discount amounts all together
_validate( ) : Check the line items and totals according to PayPal business logic limitations
_importItemsFromSalesModel() : Import items from sales model with workarounds for PayPal

Yeah after collecting the amounts and validate  let's consider we choose Paypal express , the checkout redirect the function Paypal/Controller/Express/Start Action but inside this action it use the global Api class Model/Api/Nvp.php

Read more

Magento 2 Concept : Model Resource DB and Collection (part3)

Magento 2,  concept, 

This  course of series give you the ability for creating your own model resource and collection , ok let's imagine you want create a simple module for persist some data like brand infos for example .

1 – Create :

First we need create our table inside our database for that you need create the Setup folder ,The path complete of module is Ibnab/Brand , inside Setup folder create  file InstallSchema.php and fill with :

Read more

Magento 2 programming : implement import with (import.xml)

magento-2,  programming, 

Magento 2 import export module give you the ability to implement it behavior(standard system export import)  with simple xml and general adapter . Some point before stated :
A – For import you need create import.xml inside etc of your module
B : You can create just import without export
C : Standard place to show of your  import module is form menu system→export or system→ import .

Read more

Magento 2 Add custom EAV attribute to category or customer (support 2.1 too and higher)

magento-2,  programming, 

EAV system in Magento 2 almost similar to Magento 1 but many function and technique is changed , in this tutorials we give you 2 example of how adding custom eav attribute to category or customer .

1 – Create custom attribute for category :

Go to your model and create Setup folder , inside it create file InstallData.php and push this full code :

Read more

Magento 2 Components some js process details(mage.js,apply.js)

magento-2,  programming, 

M2 system use  for read and execute (scriptSelector = 'script[type="text/x-magento-init"]' and dataAttr = 'data-mage-init' )  many js file like vendor/magento/magento2-base/lib/web/mage/apply/main.js  and scripts.js and vendor/magento/magento2-base/lib/web/mage /mage.js
you can find vendor/magento/magento2-base/lib/web/mage 
in normal case  you can declare as virtual :

Read more

Magento 2 Useful snippets for frontend developers

magento-2,  programming, 

1 - Infos About Store

Get Current store Id :
inject \Magento\Store\Model\StoreManagerInterface $storeManage
$this->storeManager = $storeManager;

and get the id with :
$id = $this->storeManager->getStore()->getId();

get base Url :
$baseUrl = $this->storeManager->getStore()->getBaseUrl();

Read more

Magento 2 Action: the default injected objects ($request $response,$resultRedirectFactory )

magento-2,  programming, 

Magento 2 Action allow the developers using $request $response and $resultRedirectFactory  objects without injecting (DI) by hand .
By extending \Magento\Backend\App\Action for backend action case or \Magento\Framework\App\Action\Action for global case , you have $request $response and $resultRedirectFactory .

1 – Request :

the top level parent class of action is Magento\Framework\App\Action\AbstractAction ,  AbstractAction injected by di with \Magento\Framework\App\Action\Context $context .

Read more

Magento 2 UI (Video) : use jquery widgets and requirejs in practice

magento-2,  course,  tutorial, 

Magento 2 have flexible technique for manage Ui , have by default jQuery included , the teams of M2 include requirejs too on core , we call js with asynchronous method .

This tutorial give you in practice the ability of :

  • - call js with requirejs
  • - create custom js for manage ui .
  • - use jquery widgets
  • - create requrejs-config.js
  • - additional technique like work with frontend_model button_url and attribute tags ,pass params between frontend_model and .phtml
Read more

Magento 2 Some techniques about system configuration(part2)

magento-2,  course,  tutorial, 

In first tutorial we introduce the creation of system configuration , in this course  we explain how set and get the value (play with configuration).

1 – Set Value Configuration :

You can set the value of specific field  inside  stores configuration , by using the interface \ \Magento\Framework\App\Config\MutableScopeConfigInterface  , (magento2 by calling this interface with technique of preference give you as result a MutableScopeConfig class instance)
inject the class to controller or helper or block or anywhere :

Read more

Magento 2 Some techniques about system configuration (part 1)

magento-2,  course, 

in Magento2 the global architecture of  system configuration is changed but the vision is the same !
Add global configuration by website store or store view and use inside you code for enable disable or other choices .
In the first course we introduce the creation if system configuration.

Read more

Magento 2 UI knockoutjs: using container less <!-- ko template: getTemplate() -->

Magento 2,  UI, 

Magento2 manage dynamic JavaScript UIs with the Model-View-View Model (MVVM) pattern  
“knockoutjs” ,  yes observe and change data with easy and structured way (HTML data bindings). In this tutorial will be introduce "Virtual elements"  <!-- ko  --> <!-- /ko -->.
knockoutjs work with two type of element Normal node and Comment node '"Virtual elements" is an abstraction on top of the usual DOM API which understands the notion that comment nodes' ,  The point of all this is to support containerless templates (e.g., <!-- ko foreach:someCollection -->blah<!-- /ko -->)  
if you play inside .phtml files you will finding <!-- ko  --> anywhere , but in this tutorial we want analyze <!-- ko template: getTemplate() -->  .

Read more

Ibnab Magento 2 Extension : Our new extension Change Product Attribute Set (Free)

magento-2,  extension, 

Many Magento users search to change attribute set of product to other targer attribute set ,Now you can use mass function for done this operation  just with few click .
Features : 

  • mass operation
  • guard configurable product (you can define from system configuration if you want add automaticly the mised configurable attirbute to taget attribute set or ignore operation )
  • dynamic TreeMassAction (get attribute set list from db)


Our new Extension Magento 2Change Attribute Set and work perfectly (Free and  Open Source) , you can select in grid all products wanted andd apply mass action to change ….

Read more

Magento 2 UI Components : New Dynamic UI TreeMassAction Technique

magento-2,  programming, 

Wooow we like inside our  team Ibnab this new technique of magento2  MassAction and  TreeMassAction just with few lines inside XML you have as result the massaction injected , flexible and configurable technique .
Ok how use massaction ? you can find  The response inside official Magento2 doc for example this link for MassAction:
http://devdocs.magento.co m/guides/v2.0/ui-library/ui-secondary-massaction.html
And other for  TreeMassAction:
http://devdocs.magento.com/guides/v2.0/ui-library/ui-secondary-treemass.html

Official documentation explain to you what is it and how use …. but for  the static case =
you enter all actions with your hand … in inverse imagine you have collections of customers you want setting him to specific group , and as you know the customer group inside magento is dynamic,  how you can do? This is real case in magento,  go to grid of customer and click on top MassAction

Read more

Magento 2 Video : Start your theme from scratch in 10 minute

magento-2,  theme, 

Magento 2 give you the ability of starting your theme on top of existing theme or start from scratch , Magento 2 now use the technique of .less and processed it for give you the css result here you will find:

  • Create you theme on base of blank theme
  • How create your custom  home page
  • Where is magento 2 stock all  theme in db
  • Change logo
  • Change color with variable less (and small explain of how structured)
  • Use layout 

command for creating the files :

php bin/magento setup:static-content:deploy

your _theme.less for ovirride the clolor exict inside this path :
app/design/frontend/Ibnab/abIshak/web/css/source/_theme.less

Read more

Magento 2 Backend : How to create custom menu in admin and change default font icon

magento-2,  backend, 

According to the data in front of us, a Magento2 team ,thought a lot about finding solutions to reduce the coherent between the various parts of the system ,  and think about how segment the configuration files, first to not fall into the same first version problems, sometimes you find in front of you a huge file nested and difficult reading and editing, and secondly to focus all his art in his specialty .
In Backend now we have for example the menu.xml for creating you custom menu in left side of Magento 2 admin .

Read more

Magento 2 Concept : Model Resource DB and Collection (part2)

blog,  magento-2,  concept, 

In the first course of series we get quick concept of how the mechanism of Model Resource and db work , but almost is like Magento 1, in this course we introduce the collection and the new technique of service contract .

The collection is old notion of Magento , the resource use it for getting  a collection  (array of row normally based on filter) , if you go to class collection related to page Model in Magento\Cms\Model\Resource\Page\Collection you finding in the folder vendor/module-cms/Model/Resource/Page , the class extend from the parent, that exist in \Magento\Framework\Model\Resource\Db\Collection\AbstractCollection yes from the Magento 2 framework

Read more

Magento 2 Frontend : what about directives view media and store ?

magento-2,  frontend, 

In Magento 2 the directive is almost like Magento 1 in global idea but with new structure , it read from other location and use kind of processing.    

  1. {{view url=images/logo.svg}}
  2. {{media url=test/logo.svg}}
  3. {{store url="translation/ajax/index"}}
Read more

Magento 2 Concept : Model Resource DB and Collection (part1)

magento-2,  concept, 

We introduce in this series of courses the concept Model Resource  DB  and Collection in Magento2 , architecture of Magento 2 based on top of Magento 2 framework inside path lib/internal/Magento/Framework it contain all class and global skeleton used and extended from all modules in Magento 2 .

Ok in this framework inside folder lib/internal/Magento/Framework /Model you find all parents and roots class of all models and resources of modules, Although the Magento 2 Framework does not contain resource models, it does contain a library of code to help implement a resource model.

Read more

Magento 2 Extension : Our new extension delete orders (Free)

magento-2,  backend, 

Many Magento users prefer to delete the orders rather than canceled, Magento 2 by default does not allow you to delete orders, for that our team Ibnab develop a new extension Magento 2 was able to delete unwanted orders .

Our new Extension Magento 2 Delete Order is available and work perfectly , you can select in grid all unwanted orders and use mass delete from top actions ….

Read more
IBNAB is a company made of a group of professionals whose work is providing secure open source solutions. Our company strives for reaching magnificent results with each experience and provides professional open source solutions that cover every part of the business process.