/magento-bulk

Bulk Import/Export helper scripts and CLI utilities for Magento Commerce

Primary LanguagePHP

Magento Bulk

Bulk operations for Magento.

Configuration

Copy config.php.sample to config.php and edit it.

Product Attribute Management

List All Attributes

./attr-list.php

List All User-defined Attributes

./attr-list.php -u

On a blank Magento installation this will list only 3 attributes: color, cost, and manufacturer.

Create Normal Data Attribute

./attr-add.php --code length --label 'Panjang (cm)' --type data --datatype decimal --normal
./attr-add.php --code shop_id --label 'Shop ID' --type data --datatype varchar --normal
./attr-add.php --code local_sku --label 'Local SKU' --type data --datatype varchar --normal
./attr-add.php --code local_price --label 'Local Price' --type data --datatype currency --normal

Note: --normal switch is optional (it’s the default).

Create Configurable Data Attribute

./attr-add.php --code branding --label 'Branding' --type data --datatype varchar --configurable

Create Normal Select Attribute

./attr-add.php --code material --label Bahan --type select --normal --opts Katun,Sutra,Rayon,Spandex

Note: --normal switch is optional (it’s the default).

Create Configurable Select Attribute

./attr-add.php --code item_color --label Warna --type select --configurable --opts Biru,Hijau,Merah,Putih,Hitam,Kuning,Ungu,Abu-abu
./attr-add.php --code item_size --label Ukuran --type select --configurable --opts SS,S,M,L,XL,XXL

Delete Attribute

./attr-del.php item_color

Multiple arguments are supported to delete several attributes at once.

./attr-del.php item_color item_size material length local_sku local_price

Import Attributes from XML

./attr-import.php ~/git/bippo-models/commerce/berbatik-attr-01.xml 

Product Attribute Set Management

List All Attribute Sets

./attrset-list.php

Create Attribute Set

./attrset-add.php --name 'Women Clothing' --attrs item_color,item_size

Delete Attribute Set

./attrset-del.php 'Women Clothing'

Multiple arguments are supported to delete several attribute sets at once.

Website, Store, Store View Management

List Websites, Stores, Store Views

./web-list.php 
Loading Magento... OK.
List websites
ID CODE       NAME
 0 admin      Admin                         
 1 base       Main Website                  
   1 Main Website Store   1:default:Default Store View 3:fb:Facebook 2:m:Mobile
 2 tuneeca    Tuneeca                       
   2 Tuneeca Store        4:tuneecadefault:Tuneeca Default 5:tuneecafb:Tuneeca Facebook 6:tuneecam:Tuneeca Mobile

Category Management

List Categories

./cat-list.php 
Loading Magento... OK.
List categories
 1 --                      Root Catalog
 2 A-                      . Default Category
 3 AC tas                  . . Tas

Add Category

./cat-add.php --urlkey tas --name Tas --desc 'Tas yang trendy.'
./cat-add.php --parent tas --urlkey handbag --name Handbag --desc 'Mudah dijinjing dan praktis.'

Note: A category depends on the available attributes for sorting. (i.e. available_sort_by, which
by default contains position,name,price but can add other custom attributes like item_color, item_size).

Delete Category (by URL Key)

./cat-del.php tas

Delete All User Categories (WARNING! DANGEROUS)

This will delete all categories with level 2 and below (i.e. user-created categories).

./cat-clear.php 

Product Management

List All Products with Stock Info

./product-list.php

Create Simple Product

For all websites, omit the --webs parameter:

./product-add-simple.php --sku zibalabel_t6 --name 'Tas Batik TX5' --price 125400 --qty 123 --cats tas,handbag

Specific website(s) only:

./product-add-simple.php --sku zibalabel_t62 --name 'Tas Batik TX5' --price 125400 --qty 123 --cats tas,handbag --webs tuneeca

Create Configurable Product with item_color and item_size configurable attributes

For all websites, omit the --webs parameter:

./product-add-conf.php --sku zibalabel_t01 --name 'Tas Batik 01' --price 19500 --variants Merah/S:5,Merah/M:7,Merah/L:9,Hijau/S:12,Hijau/M:8,Hijau/L:2 --set 'Women Clothing' --summary 'Tas batik yang keren' --desc 'Cocok untuk dibawa ke mana saja' --cats tas,handbag

Specific website(s) only:

./product-add-conf.php --sku zibalabel_t01 --name 'Tas Batik 01' --price 19500 --variants Merah/S:5,Merah/M:7,Merah/L:9,Hijau/S:12,Hijau/M:8,Hijau/L:2 --set 'Women Clothing' --summary 'Tas batik yang keren' --desc 'Cocok untuk dibawa ke mana saja' --cats tas,handbag --webs tuneeca

Stock quantity is also specified per variant.

Delete Product

./product-del.php zibalabel_t4
./product-delid.php 123

Delete All Products (WARNING! DANGEROUS)

./product-clear.php

To delete 832 simple products on i7-2630QM, takes about ~ real 3m38.357s.

Import Products from XML

./product-import.php ~/git/bippo-models/commerce/berbatik-product-01.xml

Import Products with Images from XML

./product-import-img2.php ~/git/bippo-models/commerce/berbatik-product-02.xml

Importing 832 simple products on i7-2630QM takes about 30 minutes.