Using the new Import Module



Similar documents
IMPORT / EXPORT PRODUCTS

CounterPoint SQL and Magento ecommerce Interface

EcomDev_PHPUnit Manual

1. Introduction. 2. Installing

IMPORT/EXPORT CUSTOMER REVIEWS. User Guide. User Guide Page 1

INVENTORY MANAGEMENT

Top Import / Export Magento Extension For Your ecommerce Site Management M-Connect Media. Prepared By: M-Connect Media

Copyright 2013 X.commerce, Inc. All rights reserved

SFC Featured Categories, Magento Extension Documentation

Automated Testing with Magento. Meet-Magento DE

IMPORT/EXPORT COUPON/SHOPPING CART RULES. User Guide. User Guide Page 1

ERP guide and questions

[Jet-Magento Integration]

OSF INTEGRATOR for INGRAM MICRO Integration Guide

SysPatrol - Server Security Monitor

Magento Customization With Extensions. Ashley Schroder aschroder.com

JOINUS AG. PowerPay Checkout. Magento Module User Manual. Support:

Magento Extension User Guide

SECURED PDF DOWNLOADABLE PRODUCTS BY TANGKOKO

Response Channel Manager. For Web Store Integration. CoLinear Systems Inc. v10

Magento Integration Manual (Version /24/2014)

Marketplace Plug-in User Guide

ProxiBlue Dynamic Category Products

Magento Customer Segments Under the Hood

[Jet-Magento Integration]

SEO Toolkit Magento Extension User Guide Official extension page: SEO Toolkit

Order Manager Toolkit

OpenCart AliExpress Retail Plugin User Guide

DHL Discounted Shipping by InXpress

Click-n-Print User Guide

graphxevolution, Inc. Shopping Cart Features SEARCH ENGINE OPTIMIZATION IMAGE MANAGEMENT

PASS4TEST 専 門 IT 認 証 試 験 問 題 集 提 供 者

File Management Utility User Guide

Integral Party Plan Software. Implementation Options 2015

TABLE OF CONTENTS. 1) Introduction 2. 2) Installation 3. 3) Backend functionality 4. 4) Frontend functionality 9

Top 7 Data Magento Extension For Your ecommerce Site Management

InstantSearch+ for Magento Extension

Google Trusted Stores Setup in Magento

USER GUIDE Slink for Magento

FileMaker Server 13. Custom Web Publishing with PHP

Module 9 Ad Hoc Queries

Read the Docs Template Documentation

Indico User Guide. Release Indico Team

FileMaker Server 13. Custom Web Publishing with XML

Symfony vs. Integrating products when to use a framework

FileMaker Server 15. Custom Web Publishing Guide

You can choose to install the plugin through Magento Connect or by directly using the archive files.

OpenCart AliExpress Affiliate Plugin User Guide

CloudStack Metering Working with the Usage Data. Tariq Iqbal Senior

Using SQL Reporting Services with Amicus

Paazl Magento Extension Manual for using and configuring Paazl in the Magento Admin

ASULPUNTO Magento unicenta opos integration extension Version 1.0.0

Analyzing Network Servers. Disk Space Utilization Analysis. DiskBoss - Data Management Solution

How To Use Optimum Control EDI Import. EDI Invoice Import. EDI Supplier Setup General Set up

SQL2report User Manual

Development and Management

Bazaarvoice for Magento Extension Implementation Guide v6.3.4

Version 4.0 MageB2B Pricesystem ReadMe AIRBYTES GmbH

Digital Asset Management A DAM System for TYPO3

Magento Handbook. Client Name

Magento Dhru Fusion Integration Extension. IMEI Profile Configuration

Magento Quotation Module User and Installer Documentation Version 2.2

Order Management for Magento September 11, Fred Lizza, CEO Mike Nardini, VP Partners

Shipbeat Magento Module. Installation and user guide

mylittleadmin for MS SQL Server 2005 from a Webhosting Perspective Anthony Wilko President, Infuseweb LLC

FileMaker Server 14. Custom Web Publishing Guide

Magento Certified Developer Exam Exam: M70-101

Executive Dashboard. User Guide

DiskPulse DISK CHANGE MONITOR

5.2.3 Thank you message Bounce settings Step 6: Subscribers 6.1. Creating subscriber lists 6.2. Add subscribers Manual add 6.2.

Bureau for Visual Affairs. content management system. Keep your website up-to-date and relevant with ease

Data Sheet: Work Examiner Professional and Standard

PDG Shopping Cart 4.0. Quick Start Guide

Special Promotions. Magento Extension User Guide. Official extension page: Special Promotions. User Guide: Special Promotions

Criteo Tags & Feed Extension for Magento

SEO Meta Templates. Magento Extension. User Guide. SEO Meta Templates

Web Access Features CADENCE WEB ACCESS

Installation Guide MAGENTO PAYMENT PLUGIN. release 1.0.1

QUESTION: 1 What is purpose of the File Based Search in Symantec Clearwell ediscovery Platform 7.x?

Follow Up . Magento Extension User Guide. Official extension page: Follow Up . User Guide: Follow Up

Product Summary of XLReporter with OPC Servers

Magento Integration Guide. Everything you need to know to integrate Unleashed inventory management with Magento ecommerce. Contents.

Camtasia Relay. Release Notes. Release 2.0. April TechSmith Corporation. All rights reserved.

Connecting Pentaho Suite applications with Microsoft SQL Server Analysis Services

LICENTIA. Nuntius. Magento Marketing Extension REVISION: SEPTEMBER 21, 2015 (V1.8.1)

User s manual. Magento extension. BCP - Better Configurable Products

SHIPSTATION / MIVA MERCHANT SETUP GUIDE

Global Amazon Integration Module v1.1. Users Guide & Setup Instructions

CMS and e-commerce Solutions. version 1.0. Please, visit us at: or contact directly by

MIS Export via the FEM transfer software

Otherwise please follow these instructions for a successful module installation.

Embedded ERP for Magento Integration and User Guidelines Version 2.3 & 1.5

Quick Start Guide. 1 Copyright 2014 Samanage

Transcription:

Using the new Import Module How to use Magentos new ImportExport module in your custom modules Imagine Conference, Feb. 2011 Author: Vinai Kopp <vinai@netzarbeiter.com>

It's me! Vinai Kopp Magento Development since March 08 Magento Developer Training Magento Consulting

Introducing the Players Overview of the the classes used during the import process

The Controller Mage_ImportExport_Adminhtml_ImportController Purpose: Entry Point Instantiates the Import Model and start Process

The Import Model Mage_ImportExport_Model_Import Purpose: Facade to the underlying import classes

The Entity Type Model Mage_ImportExport_Model_Import_Entity_Product Mage_ImportExport_Model_Import_Entity_Customer Purpose: Build and execute SQL for imports, updates and deletes

The Source Adapter Mage_ImportExport_Model_Import_Adapter_Csv Purpose: Parse and access input data into arrays as expected by the entity type model

Import Data Resource Model Mage_ImportExport_Model_Mysql4_Import_Data Purpose: Interface to the import data table

Product Type Import Models Mage_ImportExport_Model_Import_Entity_Product_Type_* Purpose: Build and execute product type specific SQL

The Import Process Temporary Table POINT OF ENTRY Adminhtml Interface IMPORT MODEL: validatesource() ENTITY TYPE ADAPTER CLI Magento CronJob DATA ARRAY SOURCE ADAPTER Document

The Import Process POINT OF ENTRY Adminhtml Interface CLI Magento CronJob Temporary Table IMPORT MODEL: importsource() ENTITY TYPE ADAPTER SQL CATALOG TABLE PRODUCT TYPE IMPORT MODEL

How can I use that? Import, Update or Delete Products and/or Customers

How can I use that? Example: Cronjob catalog updates via custom CSV files Custom CSV Fields: sku, name, description, short_description, store_id, websites, weight, price, qty, color

Why a custom CSV file format? sku _store _attribute_set _type _category _product_websites color cost created_at custom_design custom_design_from custom_design_to custom_layout_update description enable_googlecheckout gallery gift_message_available has_options image image_label is_imported manufacturer media_gallery meta_description meta_keyword meta_title minimal_price name news_from_dat news_to_date options_container page_layout price required_options short_description small_image small_image_label special_from_date special_price special_to_date status tax_class_id thumbnail thumbnail_label updated_at url_key url_path visibility weight qty min_qty use_config_min_qty is_qty_decimal backorders use_config_backorders min_sale_qty use_config_min_sale_qty max_sale_qty use_config_max_sale_qty is_in_stock notify_stock_qty use_config_notify_stock_qty manage_stock use_config_manage_stock use_config_qty_increments qty_increments use_config_enable_qty_increments enable_qty_increments _links_related_sku _links_related_position _links_crosssell_sku _links_crosssell_position _links_upsell_sku _links_upsell_position _associated_sku _associated_default_qty _associated_position _tier_price_website _tier_price_customer_group _tier_price_qty _tier_price_price _super_products_sku _super_attribute_code _super_attribute_option _super_attribute_price_corr

Cronjob Catalog Updates Step One: Build Source Adapter for custom CSV file Step Two: Create Cron Observer

Specify a Custom Source Adapter The Source Adapter Class is specified by the File Extension Mage_ImportExport_Model_Import_Adapter_. $type; sourcefile.csv.custom to use Source Adapter Mage/ImportExport/Model/Import/Adapter/Custom.php

The Source Adapter Interface Extend Mage_ImportExport_Model_Import_Adapter_Abstract Implements SeekableIterator Interface Create rewind(), next() and seek() methods using _init() to setup data

The Source Adapter Interface protected function _init() Read source and build the same data structure like the core csv adapter The source array format can best be referenced by exporting some products and looking at the first line in the resulting export file

The Source Array Format sku _store _attribute_set _type _category _product_websites color cost created_at custom_design custom_design_from custom_design_to custom_layout_update description enable_googlecheckout gallery gift_message_available has_options image image_label is_imported manufacturer media_gallery meta_description meta_keyword meta_title minimal_price name news_from_dat news_to_date options_container page_layout price required_options short_description small_image small_image_label special_from_date special_price special_to_date status tax_class_id thumbnail thumbnail_label updated_at url_key url_path visibility weight qty min_qty use_config_min_qty is_qty_decimal backorders use_config_backorders min_sale_qty use_config_min_sale_qty max_sale_qty use_config_max_sale_qty is_in_stock notify_stock_qty use_config_notify_stock_qty manage_stock use_config_manage_stock use_config_qty_increments qty_increments use_config_enable_qty_increments enable_qty_increments _links_related_sku _links_related_position _links_crosssell_sku _links_crosssell_position _links_upsell_sku _links_upsell_position _associated_sku _associated_default_qty _associated_position _tier_price_website _tier_price_customer_group _tier_price_qty _tier_price_price _super_products_sku _super_attribute_code _super_attribute_option _super_attribute_price_corr

Product Import Source Array Configurable Products _super_products_sku _super_attribute_code _super_attribute_option _super_attribute_price_corr... 0,1,0.0000,1,1,,1,0,1,1,0.0000,1,0,,,,,,,,,,,,,,sku-Pear-Cyan,manufacturer,Pear,100.0000...,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,sku-Pear-Indigo,color,Cyan,5.0000...,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,sku-Pear-Mauve,,,...,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,sku-Pear-Pink,,,...,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,sku-Peach-Cyan,,,

Product Import Source Array Configurable Products One row for every associated simple product in addition to record for the simple product itself _super_products_sku... 0,1,0.0000,1,1,,1,0,1,1,0.0000,1,0,,,,,,,,,,,,,,sku-Pear-Cyan,manufacturer,Pear,100.0000...,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,sku-Pear-Indigo,color,Cyan,5.0000...,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,sku-Pear-Mauve,,,...,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,sku-Pear-Pink,,,...,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,sku-Peach-Cyan,,,

Product Import Source Array Configurable Products One row for every associated simple product attribute _super_attribute_code... 0,1,0.0000,1,1,,1,0,1,1,0.0000,1,0,,,,,,,,,,,,,,sku-Pear-Cyan,manufacturer,Pear,100.0000...,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,sku-Pear-Indigo,color,Cyan,5.0000...,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,sku-Pear-Mauve,,,...,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,sku-Pear-Pink,,,...,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,sku-Peach-Cyan,,,

Product Import Source Array Configurable Products One row for every attribute with a price update _super_products_price_corr... 0,1,0.0000,1,1,,1,0,1,1,0.0000,1,0,,,,,,,,,,,,,,sku-Pear-Cyan,manufacturer,Pear,100.0000...,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,sku-Pear-Indigo,color,Cyan,5.0000...,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,sku-Pear-Mauve,,,...,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,sku-Pear-Pink,,,...,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,sku-Peach-Cyan,,, _super_attribute_option

Product Import Source Array Configurable Products _super_products_sku and _super_attribute_option do not (have to) correspond... 0,1,0.0000,1,1,,1,0,1,1,0.0000,1,0,,,,,,,,,,,,,,sku-Pear-Cyan,manufacturer,Pear,100.0000...,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,sku-Pear-Indigo,color,Cyan,5.0000...,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,sku-Pear-Mauve,,,...,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,sku-Pear-Pink,,,...,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,sku-Peach-Cyan,,,

Product Import Source Array Custom Options _custom_option_store _custom_option_type _custom_option_title _custom_option_is_required _custom_option_price _custom_option_sku _custom_option_max_characters _custom_option_sort_order _custom_option_row_title _custom_option_row_price _custom_option_row_sku _custom_option_row_sort

Implementation of the Source Adapter Implement SeekableIterator Interface seek(), current(), next(), rewind(), key(), valid() All except next(), rewind() and seek() are implemented in the abstract class Mage_ImportExport_Model_Import_Adapter_Abstract The core CSV Adapter is a good implementation reference

Trigger Import Cron Observer which wrapps the Import Model calls to validatesource(), importsource() and invalidateindex()

Trigger Import Cron Observer which wrapps the Import Model calls to validatesource(), importsource() and invalidateindex()

Other possibilities Anything that gets product data into Magento in bulk operations, e.g. XML Files REST Request with product data in payload Unix domain sockets

Conclusion Mage_ImportExport fills an important gap! Usable with technical knowledge because of the complex array format Couple of smallish bugs, but it's going places :]

Links Sample Code: http://bit.ly/hacgwi PDF of the Slides: http://bit.ly/i0eii7 urapidflow: http://www.unirgy.com/products/urapidflow/

/me is happy to hear from you vinai@netzarbeiter.com :: @VinaiKopp Thank you @riconeitzel for all the time and for making this look good! Thanks to Magento!