Custom Options

From Magmi Wiki
Jump to navigation Jump to search

Clarification for beginners

Custom options plugin is not for user-defined product attributes (which magmi will import natively using a column name that has the attribute code) but Magento Specific Product customizable options feature (like customer set engravings or cake decoration texts)

The principle is to use one column of the csv file to describe each option by a specific syntax described below.

Custom options behaviour with multiple stores

- each time you import custom options for a product, each time there are entirely rebuilt for this particular product. So the consequences are the folowing:

  • => if you want to update, for some products, just some data (description, url key...) for a store view (translating some text for example) without lines for the other store view don’t use any custom options column (in this case you can let or no the custom options plugin activated, it will have no action). A simple custom options column is sufficient in the file, in this case, to replace all preceeding custom options for the concerned products. An other possibility to not have the risk to break custom options is to disable the custom options plugin in the magmi web interface.
  • => if you want to update custom options (to translate texts for example), in fact, you have to enter all the concerned store view product lines (**sku ordered**) in the same file to be sure to not break the admin/default view or others by a specific store view.

Syntax

To import a custom option you need to add a new column to your CSV import file. The name of the column (header line of the file) determines the name and type of the option. The format is: Name:Type:Is Required:sort number (with :sort number optional) . For example, to create a required drop down option called "Size" your column header should be: Size:drop_down:1:1 (1 for required, 0 for optional and 1 at the end for the option sort number one). Here is a list of the Types, these are taken from the "Custom Options" screen in the Magento admin

  • field: Field
  • area: Area
  • file: File
  • drop_down: Drop-down
  • radio: Radio Buttons
  • checkbox: Checkbox
  • multiple: Multiple Select
  • date: Date
  • date_time: Date & Time
  • time: Time

For types with multiple values (drop_down, radio, checkbox, multiple) you can specify using a | separator. Example for Small, Medium, Large you would use

Small|Medium|Large 

as the value for the Size:drop_down:1:1 column in your csv file.

Here's paired down example of the import format:


sku,name,description,price,Size:drop_down:1
T-Shirt1,T-Shirt,A T-Shirt,5.00,Small|Medium|Large
T-Shirt2,T-Shirt2,Another T-Shirt,6.00,XS|S|M|L|XL

In addition you can specify an addition price and SKU modifier for each option value, and also an optional sort number for each value. The syntax for this is:

Value:[fixed|percent]:price_modifier:[sku_modifier]:[sort number] 

For example if you have a product which costs $5 more for a Medium and $10 more for a large you would the following as the option value.

Small|Medium:fixed:5|Large:fixed:10

Here's the first example with additional price/sku modifiers and, for the last, sort number.


sku,name,description,price,Size:drop_down:1
T-Shirt1,T-Shirt,A T-Shirt,5.00,Small:fixed:0:-SM|Medium:percent:2:-MED|Large:percent:3:-LRG
T-Shirt2,T-Shirt2,Another T-Shirt,6.00,XS:fixed:0:-XS:1|S:fixed:0:-S:2|M:fixed:1:-M:3

You have understood that you can can order the values for one option with the last digit of each value like this example:


[Size]:Small:fixed:0.5:-S:1|Medium:fixed:0.6:-M:2|Large:fixed:0.7:-L:3

=> Small 1st, Medium 2d, Large 3rd

Text field and text area

You have to specify a value for the option to be created, to create an input option with default values use: ":" as the value you just have to put something in the row so it's not ignored. Here's the format:

Title(optional):price_type:price:sku:max_characters

Example:


Header line                            Please enter your text:field:1:3
Admin/default store view product line   :fixed:0.5:Ref Text:35 

This would create an input field which prompt to customer will be "Please enter your text" with a fixed price of $0.5, a SKU modifier of "Ref Text" and a max of 35 characters.

File to upload field

For the product line the syntax is:

[alternative prompt]:fixed/percent/0:price:reference:[sort order]:ext. file allowed comma separated:[width]:[height]

width and height are used for images and each one optional individualy.

Example:


Header line                            Upload a file:file:1:1
Admin/default store view product line   :fixed:0:Ref file::jpg,png:500:300  

Multi store view compatibility

add a [new option label]: (with the square brackets & the colon) before the option values definition, except for text field and area options where square brackets are not necessary.

ie: if you had for french store (as default)

Petit|Moyen|Grand

and for english

Small|Medium|Large

the problem was that the option title would be set only using header value.

You can do:

Petit|Moyen|Grand 

(keep as default) and for english

[Size]:Small|Medium|Large

of course, it also supports more detailed version of the syntax like:


[Size]:Small:fixed:0.5:-S:1|Medium:fixed:0.6:-M:2|Large:fixed:0.7:-L:3

and that’s it , you can have a new option label for your particular store !!!

you can handle text field and text area custom options with a slightly different syntax for the option title:


Header line                             Veuillez indiquer votre texte:field:1:3
Admin/default store view product line   :fixed:0.5:Ref Text:35
English store view product line         Please enter your text:fixed:0.5:Ref Text:35

the alternative title is indicated without brackets [], this is specific to text fields and text area.

Warning:

For multistore support, be careful to have all custom options definitions of all stores and admin in the same import file, **sku ordered** (very important to avoid breaking, for example, default store view by the last one for the custom options of the concerned products).

By cons, it's allowed, in the import file, to have "holes" for some products for some custom options columns. Insert non-formatted text here



Back to Product Import Related Plugins