All Projects → ho-nl → magento2-Ho_Import

ho-nl / magento2-Ho_Import

Licence: other
No description or website provided.

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to magento2-Ho Import

module-notorama
Say no to Fotorama in Magento 2(.3) with Notorama.
Stars: ✭ 37 (-5.13%)
Mutual labels:  magento2
Worldpay-Magento2-CG
Worldpay Magento 2 Plugin for Worldpay Corporate Gateway
Stars: ✭ 15 (-61.54%)
Mutual labels:  magento2
Magento2 SomethingDigital UpgradeHelper
No description or website provided.
Stars: ✭ 16 (-58.97%)
Mutual labels:  magento2
magento2-react-checkout
Highly Customizable Checkout for Magento 2, Built with React.
Stars: ✭ 165 (+323.08%)
Mutual labels:  magento2
magento2-gulpfile
Simple Gulpfile for Magento2
Stars: ✭ 16 (-58.97%)
Mutual labels:  magento2
Magento-2-Module-Skeleton
This Module provides a basic Skeleton for further Magento 2 Modules.
Stars: ✭ 30 (-23.08%)
Mutual labels:  magento2
magento2
For any issues or questions please get in touch with us via [email protected]
Stars: ✭ 15 (-61.54%)
Mutual labels:  magento2
k8s-webhook-cert-manager
Generate certificate suitable for use with any Kubernetes Mutating Webhook.
Stars: ✭ 59 (+51.28%)
Mutual labels:  fsi
module-dsu
No description or website provided.
Stars: ✭ 18 (-53.85%)
Mutual labels:  magento2
m2.Price
Magento2. Rounding Price to Prettier Value for Multi-Currency Stores.
Stars: ✭ 60 (+53.85%)
Mutual labels:  magento2
module-dsu-client
No description or website provided.
Stars: ✭ 17 (-56.41%)
Mutual labels:  magento2
magento2-db-log-cleaner
Magento2 Cron Log Cleaning
Stars: ✭ 23 (-41.03%)
Mutual labels:  magento2
m2.TrackingLink
Magento2. Extension add Tracking Url in Shipment Email.
Stars: ✭ 35 (-10.26%)
Mutual labels:  magento2
magento-2-reports
Magento 2 Reports extension Free from Mageplaza helps stores quickly access to advanced reports on Dashboard. As your shop grows, so is the amount of numbers you have to deal with everyday. Eventually, it would reach a point where you find yourself in dire need of a tool that can take care of the figures for you.
Stars: ✭ 39 (+0%)
Mutual labels:  magento2
module-notifications
Notify the Magento 2 admin user about disabled caches or new customer reviews.
Stars: ✭ 20 (-48.72%)
Mutual labels:  magento2
magento2-installer-bash-script
Simplistic Magento 2 Installer Bash Script
Stars: ✭ 38 (-2.56%)
Mutual labels:  magento2
storefront
An Angular 2 storefront app for Magento 2 (unmaintained)
Stars: ✭ 35 (-10.26%)
Mutual labels:  magento2
OrderAttachment
Magento 2 Order Attachment by MagePrakash allows customers to attachments proof such as Images, PDFs or any type of Files/Docs while placing the orders.
Stars: ✭ 18 (-53.85%)
Mutual labels:  magento2
Slider-M2
Slider extension for Magento 2.x
Stars: ✭ 17 (-56.41%)
Mutual labels:  magento2
magento-2-sticky-cart
Magento 2 Sticky add to cart displayed as a sticky scroll bar summary of the product information, helps customers can quickly add products without going back to the top of the page.
Stars: ✭ 14 (-64.1%)
Mutual labels:  magento2

Magento 2 Importing library

Import library to create an array-interface for importing products/categories. Ho_Import is build on top of Magento's internal Import/Export modules.

The goal of the library is to be a swiss army knife for importing products in Magento 2. Features include:

  • Stream XML over HTTP and from disk
  • Download files from HTTP(s)/FTP
  • Map items from source file to Magento format
  • Lot's of RowModifiers
  • Fixed importer core bugs

ExampleProfile.php

Installation

composer config repositories.honl/magento2-import vcs [email protected]:ho-nl/magento2-Ho_Import.git
composer require honl/magento2-import

Goals

Performance: Since building imports is (really) hard and requires a lot of feedback loops to get your data right (change, check, change, check), it is absolutely essential that is as fast as possible. A developer can't work if he has to wait 10 minutes after each change. So only having to wait only a few seconds to be able to see what is going into Magento is essential.

Ease of use: The API should be clear that a developer is only limited by their knowledge of Magento it's self. No junior developer should have to thing about streaming files, performance and memory usage.

Extensible: It should be very easy to extend and customize a import

Maintainable: The library should have a stable API (currently not stable yet) so that we can upgrade imports that are build a year ago without having to worry that everything will break.

Getting the abstraction right

With Ho_Import for Magento 1, we created a custom DSL to map external files to a Magento compatible format. This worked, but we soon discovered that we needed a lot of basic PHP functionality in the importer. We caught ourselves implementing PHP functionality in Ho_Import compatible wrappers...

The alternative was working bare with Avs_FastSimpleImport gave no abstraction other than, 'you can fill this array'. Although this was a huge leap forward from 'create your own csv file', it didn't offer any tools to make building imports easier more robust and faster.

Now, writing a new import library for Magento 2 and having to start from scratch, it was a good moment to create a new abstraction. Assuming that people who need to build imports at least know the basics of Magento 2 programming we can create an import that doesn't rely on 'nice abstractions', but does offer the tools to get an import quickly up and running.

  1. Create a single class file to create a fully functional import. If the class is too complex, the developer can decide to spit the logic them selves.
  2. Use RowModifiers to modify data and make it easy for other developers to create new

The core concept of the new import library is based around RowModifiers.

What are RowModifiers?

A RowModifier can update items, add items, delete items, add new values, rewrite values, validate rows, etc.

Example usage of the \Ho\Import\RowModifier\ItemMapper

$items = [ ... ]; //Array of all products

/** @var \Ho\Import\RowModifier\ItemMapper $itemMapper */
$itemMapper = $this->itemMapperFactory->create([
    'mapping' => [
        'store_view_code' => \Ho\Import\RowModifier\ItemMapper::FIELD_EMPTY,
        'sku' => function ($item) {
             return $item['ItemCode'];
         }
        'name' => function ($item) {
            return $item['NameField'] . $item['ColorCode'];
        }
    ]
]);
$itemMapper->setItems($items);
$itemMapper->process($items); //The items array is modified with new values.

RowModifies all inherit from \Ho\Import\RowModifier\AbstractRowModifier

General Assumptions

  • People writing imports are programmers or at least have basic programming knowledge.
  • Magento's importer is limited and certainly doesn't Just Work(tm), we need to build abstractions on top to be able to actually focus on the import instead of all the 'stuff' that comes with an import.

Technical assumptions

  • PHP's array format is memory efficient enough that it can hold all products needing to be imported in memory. e.g. 50k products requires more memory, but is usually ran on a beefy server.

Contibutors

Here at H&O we've created many imports for clients, we have exstenbuild Ho_Import, core contributor to Avs_FastSimpleImport

that mapped source files to Magento compatible formats, but was never intended to solve problems with url rewrites, creating configurables. All that functionality

This library builds on top of Magento's internal Import/Export module

Console commands

ho:import:run profileName

Run an import script directly (not recommended on live environments, might cause deadlocks).

cron:schedule jobName

Schedule a job to run immediately.

Credits

The module is written by Paul Hachmang (twitter: @paales, email: [email protected]) and build for Reach Digital. We make Magento Webshops (website: https://www.reachdigital.nl/, email: [email protected], twitter: @ho_nl).

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].