Dependent Custom Options (gallery) 1.1.4   May 21 2013


This addition makes product custom options dependent. So you can set different size for different gender.
Or display the file upload field if a customer wants to upload a sample.
This extension has "Option Templates" and dataflow .csv Import / Export features.
So that even if it takes long to create dependent options you will be able to create a template and then apply it to many products at once.
Also you can upload images and add HTML note or description to an option.



Index:




Installation with Connect Manager

1) Disable magento compilation in Magento admin panel -> System -> Tools -> Compilation

2) Go to System -> Magento Connect -> Magento Connect Manager (screenshot)
3) Uncheck the "Put store on the maintenance mode" checkbox.
4) Choose file "package_for_magento_connect_manager_installation.tgz" and click the Upload button.

Screenshot




Manual Installation

1) Disable magento compilation in Magento admin panel -> System -> Tools -> Compilation

2) Upload 142 new files:

app/code/local/Pektsekye/OptionExtended/Block/Optiontemplate.php
app/code/local/Pektsekye/OptionExtended/Block/Adminhtml/Catalog/Product/Edit/Js.php
app/code/local/Pektsekye/OptionExtended/Block/Adminhtml/Catalog/Product/Edit/Tab/Options.php
app/code/local/Pektsekye/OptionExtended/Block/Adminhtml/Catalog/Product/Edit/Tab/Options/Option.php
app/code/local/Pektsekye/OptionExtended/Block/Adminhtml/Catalog/Product/Edit/Tab/Options/Template.php
app/code/local/Pektsekye/OptionExtended/Block/Optiontemplate/Edit.php
app/code/local/Pektsekye/OptionExtended/Block/Optiontemplate/Grid.php
app/code/local/Pektsekye/OptionExtended/Block/Optiontemplate/Option.php
app/code/local/Pektsekye/OptionExtended/Block/Optiontemplate/Value.php
app/code/local/Pektsekye/OptionExtended/Block/Optiontemplate/Edit/Form.php
app/code/local/Pektsekye/OptionExtended/Block/Optiontemplate/Edit/Tabs.php
app/code/local/Pektsekye/OptionExtended/Block/Optiontemplate/Edit/Tab/General.php
app/code/local/Pektsekye/OptionExtended/Block/Optiontemplate/Edit/Tab/Options.php
app/code/local/Pektsekye/OptionExtended/Block/Optiontemplate/Edit/Tab/Products.php
app/code/local/Pektsekye/OptionExtended/Block/Optiontemplate/Edit/Tab/Products/Grid.php
app/code/local/Pektsekye/OptionExtended/Block/Optiontemplate/Grid/Renderer/Action.php
app/code/local/Pektsekye/OptionExtended/Block/Optiontemplate/Grid/Renderer/Text.php
app/code/local/Pektsekye/OptionExtended/Block/Optiontemplate/Option/Edit.php
app/code/local/Pektsekye/OptionExtended/Block/Optiontemplate/Option/Grid.php
app/code/local/Pektsekye/OptionExtended/Block/Optiontemplate/Option/Import.php
app/code/local/Pektsekye/OptionExtended/Block/Optiontemplate/Option/Edit/Form.php
app/code/local/Pektsekye/OptionExtended/Block/Optiontemplate/Option/Edit/Tabs.php
app/code/local/Pektsekye/OptionExtended/Block/Optiontemplate/Option/Edit/Tab/General.php
app/code/local/Pektsekye/OptionExtended/Block/Optiontemplate/Option/Edit/Tab/Values.php
app/code/local/Pektsekye/OptionExtended/Block/Optiontemplate/Option/Grid/Renderer/Action.php
app/code/local/Pektsekye/OptionExtended/Block/Optiontemplate/Option/Grid/Renderer/Options.php
app/code/local/Pektsekye/OptionExtended/Block/Optiontemplate/Option/Import/Form.php
app/code/local/Pektsekye/OptionExtended/Block/Optiontemplate/Option/Import/Grid.php
app/code/local/Pektsekye/OptionExtended/Block/Optiontemplate/Value/Edit.php
app/code/local/Pektsekye/OptionExtended/Block/Optiontemplate/Value/Grid.php
app/code/local/Pektsekye/OptionExtended/Block/Optiontemplate/Value/Edit/Form.php
app/code/local/Pektsekye/OptionExtended/Block/Optiontemplate/Value/Grid/Renderer/Image.php
app/code/local/Pektsekye/OptionExtended/Block/Optiontemplate/Value/Helper/Form/Image.php
app/code/local/Pektsekye/OptionExtended/Block/Optiontemplate/Value/Helper/Form/Text.php
app/code/local/Pektsekye/OptionExtended/Block/Optiontemplate/Value/Helper/Form/Image/Content.php
app/code/local/Pektsekye/OptionExtended/Block/Optiontemplate/Value/Helper/Form/Text/Content.php
app/code/local/Pektsekye/OptionExtended/Block/Product/View/Js.php
app/code/local/Pektsekye/OptionExtended/controllers/IndexController.php
app/code/local/Pektsekye/OptionExtended/controllers/OptionController.php
app/code/local/Pektsekye/OptionExtended/controllers/OptiontemplateController.php
app/code/local/Pektsekye/OptionExtended/controllers/Optiontemplate/OptionController.php
app/code/local/Pektsekye/OptionExtended/controllers/Optiontemplate/ValueController.php
app/code/local/Pektsekye/OptionExtended/etc/config.xml
app/code/local/Pektsekye/OptionExtended/etc/system.xml
app/code/local/Pektsekye/OptionExtended/Helper/Data.php
app/code/local/Pektsekye/OptionExtended/Model/Import.php
app/code/local/Pektsekye/OptionExtended/Model/Observer.php
app/code/local/Pektsekye/OptionExtended/Model/Option.php
app/code/local/Pektsekye/OptionExtended/Model/Quote.php
app/code/local/Pektsekye/OptionExtended/Model/Template.php
app/code/local/Pektsekye/OptionExtended/Model/Value.php
app/code/local/Pektsekye/OptionExtended/Model/Convert/Adapter/Options.php
app/code/local/Pektsekye/OptionExtended/Model/Convert/Adapter/Products.php
app/code/local/Pektsekye/OptionExtended/Model/Convert/Adapter/Templates.php
app/code/local/Pektsekye/OptionExtended/Model/Convert/Adapter/Values.php
app/code/local/Pektsekye/OptionExtended/Model/Convert/Adapter/Options/Translate.php
app/code/local/Pektsekye/OptionExtended/Model/Convert/Adapter/Template/Options.php
app/code/local/Pektsekye/OptionExtended/Model/Convert/Adapter/Template/Values.php
app/code/local/Pektsekye/OptionExtended/Model/Convert/Adapter/Template/Options/Translate.php
app/code/local/Pektsekye/OptionExtended/Model/Convert/Adapter/Template/Values/Translate.php
app/code/local/Pektsekye/OptionExtended/Model/Convert/Adapter/Values/Translate.php
app/code/local/Pektsekye/OptionExtended/Model/Convert/Parser/Options.php
app/code/local/Pektsekye/OptionExtended/Model/Convert/Parser/Products.php
app/code/local/Pektsekye/OptionExtended/Model/Convert/Parser/Templates.php
app/code/local/Pektsekye/OptionExtended/Model/Convert/Parser/Values.php
app/code/local/Pektsekye/OptionExtended/Model/Convert/Parser/Options/Translate.php
app/code/local/Pektsekye/OptionExtended/Model/Convert/Parser/Template/Options.php
app/code/local/Pektsekye/OptionExtended/Model/Convert/Parser/Template/Values.php
app/code/local/Pektsekye/OptionExtended/Model/Convert/Parser/Template/Options/Translate.php
app/code/local/Pektsekye/OptionExtended/Model/Convert/Parser/Template/Values/Translate.php
app/code/local/Pektsekye/OptionExtended/Model/Convert/Parser/Values/Translate.php
app/code/local/Pektsekye/OptionExtended/Model/Mysql4/Import.php
app/code/local/Pektsekye/OptionExtended/Model/Mysql4/Option.php
app/code/local/Pektsekye/OptionExtended/Model/Mysql4/Template.php
app/code/local/Pektsekye/OptionExtended/Model/Mysql4/Value.php
app/code/local/Pektsekye/OptionExtended/Model/Mysql4/Import/Collection.php
app/code/local/Pektsekye/OptionExtended/Model/Mysql4/Option/Collection.php
app/code/local/Pektsekye/OptionExtended/Model/Mysql4/Template/Collection.php
app/code/local/Pektsekye/OptionExtended/Model/Mysql4/Template/Option.php
app/code/local/Pektsekye/OptionExtended/Model/Mysql4/Template/Value.php
app/code/local/Pektsekye/OptionExtended/Model/Mysql4/Template/Option/Collection.php
app/code/local/Pektsekye/OptionExtended/Model/Mysql4/Template/Value/Collection.php
app/code/local/Pektsekye/OptionExtended/Model/Mysql4/Value/Collection.php
app/code/local/Pektsekye/OptionExtended/Model/Product/Option/Type/Select.php
app/code/local/Pektsekye/OptionExtended/Model/Resource/Eav/Mysql4/Product/Option.php
app/code/local/Pektsekye/OptionExtended/Model/Template/Option.php
app/code/local/Pektsekye/OptionExtended/Model/Template/Value.php
app/code/local/Pektsekye/OptionExtended/sql/optionextended_setup/mysql4-install-1.0.0.php
app/code/local/Pektsekye/OptionExtended/sql/optionextended_setup/mysql4-upgrade-1.0.0-1.0.1.php
app/code/local/Pektsekye/OptionExtended/sql/optionextended_setup/mysql4-upgrade-1.0.1-1.0.2.php
app/design/adminhtml/default/default/layout/optionextended.xml
app/design/adminhtml/default/default/template/optionextended/catalog/product/composite/configure/js.phtml
app/design/adminhtml/default/default/template/optionextended/catalog/product/edit/js.phtml
app/design/adminhtml/default/default/template/optionextended/catalog/product/edit/options.phtml
app/design/adminhtml/default/default/template/optionextended/catalog/product/edit/options/option.phtml
app/design/adminhtml/default/default/template/optionextended/catalog/product/edit/options/template.phtml
app/design/adminhtml/default/default/template/optionextended/optiontemplate/edit/tab/options.phtml
app/design/adminhtml/default/default/template/optionextended/optiontemplate/edit/tab/products.phtml
app/design/adminhtml/default/default/template/optionextended/optiontemplate/helper/image.phtml
app/design/adminhtml/default/default/template/optionextended/optiontemplate/helper/text.phtml
app/design/adminhtml/default/default/template/optionextended/optiontemplate/option/edit/tab/values.phtml
app/design/frontend/base/default/layout/optionextended.xml
app/design/frontend/base/default/template/optionextended/product/view/js.phtml
app/etc/modules/Pektsekye_OptionExtended.xml
app/locale/en_US/Pektsekye_OptionExtended.csv
skin/adminhtml/default/default/pektsekye/optionextended/accordion.js
skin/adminhtml/default/default/pektsekye/optionextended/collapse-on.gif
skin/adminhtml/default/default/pektsekye/optionextended/collapse.gif
skin/adminhtml/default/default/pektsekye/optionextended/delete_image.gif
skin/adminhtml/default/default/pektsekye/optionextended/dependency.js
skin/adminhtml/default/default/pektsekye/optionextended/duplicate.js
skin/adminhtml/default/default/pektsekye/optionextended/dynamic.js
skin/adminhtml/default/default/pektsekye/optionextended/expand-on.gif
skin/adminhtml/default/default/pektsekye/optionextended/expand.gif
skin/adminhtml/default/default/pektsekye/optionextended/expand.js
skin/adminhtml/default/default/pektsekye/optionextended/ids.js
skin/adminhtml/default/default/pektsekye/optionextended/main.css
skin/adminhtml/default/default/pektsekye/optionextended/main.js
skin/adminhtml/default/default/pektsekye/optionextended/optiontemplate_edit.js
skin/adminhtml/default/default/pektsekye/optionextended/optiontemplate_option.css
skin/adminhtml/default/default/pektsekye/optionextended/optiontemplate_option.js
skin/adminhtml/default/default/pektsekye/optionextended/optiontemplate_option_edit.css
skin/adminhtml/default/default/pektsekye/optionextended/optiontemplate_value.css
skin/adminhtml/default/default/pektsekye/optionextended/optiontemplate_value.js
skin/adminhtml/default/default/pektsekye/optionextended/optiontemplate_value_edit.css
skin/adminhtml/default/default/pektsekye/optionextended/order_create/info_icon.gif
skin/adminhtml/default/default/pektsekye/optionextended/order_create/optionextended.css
skin/adminhtml/default/default/pektsekye/optionextended/order_create/optionextended_main.js
skin/adminhtml/default/default/pektsekye/optionextended/order_create/optionextended_images.js
skin/adminhtml/default/default/pektsekye/optionextended/order_create/optionextended_dependent.js
skin/adminhtml/default/default/pektsekye/optionextended/order_create/small_image.jpg
skin/adminhtml/default/default/pektsekye/optionextended/override.js
skin/adminhtml/default/default/pektsekye/optionextended/parent.js
skin/adminhtml/default/default/pektsekye/optionextended/product_edit_optiontemplate.js
skin/adminhtml/default/default/pektsekye/optionextended/sd.js
skin/adminhtml/default/default/pektsekye/optionextended/uploader.js
skin/adminhtml/default/default/pektsekye/optionextended/util.js
skin/frontend/base/default/pektsekye/info_icon.gif
skin/frontend/base/default/pektsekye/optionextended.css
skin/frontend/base/default/pektsekye/optionextended_dependent.js
skin/frontend/base/default/pektsekye/optionextended_images.js
skin/frontend/base/default/pektsekye/optionextended_main.js


3) Refresh the Magento cache in
Magento admin panel -> System -> Cache Management



Set the main product image tag id

If the "Main Image" and "Picker & Main" option layouts do not swap product image.
Check the main product image HTML tag id. It must be "image":

<img id="image" src="http://... h/t/htc-touch-diamond.jpg" alt="HTC Touch Diamond" title="HTC Touch Diamond" />

If the id is not "image" you should set it twice in the file:
app/design/frontend/YOUR_INTERFACE/YOUR_THEME/template/catalog/product/view/media.phtml


The first time for the main product image.
The second time for the "No Image" case.

Check a sample media.phtml file with id="image" on lines 40 and 62


If the image tag already has an id different from id="image" and you cannot change it.
In the extension template file:
app/design/frontend/YOUR_INTERFACE/default/template/optionextended/product/view/js.phtml

find and adjust this line:
mainImageId : 'image', // Id of the Product main image tag <img id="image"


NOTE: Image Zoom and other extensions that affect main product image can override the media.phtml file.
Try to look for it under the template directory of the zoom extension:
app/design/frontend/YOUR_INTERFACE/default/template/ZOOM_EXTENSION_DIRECTRY ../../.. media.phtml

Back to the index


An example of how to set dependency

1) Go to Magento admin panel -> Catalog -> Edit Product
2) Find a product with type Simple Product and without custom options then click the "Edit" link.
3) Add the custom option to it: Title - "Gender", Input Type - "Drop-down", Sort Order - "1".
4) Add rows to it: "Mens", "Womens".
5) Add the second custom option: Title - "Size", Input Type - "Drop-down", Sort Order - "2".
6) Add four rows with titles: "3", "4", "8", "9".
7) Scroll the page back to the "Gender" option.
8) Find the "Children" field of the "Mens" row.
9) Enter two row ids of the "Size" option separated with commas: 5,6.
10) Find the "Children" field of the "Womens" row.
11) Enter another two row ids of the "Size" option: 3,4.
12) Check everything with the screenshot.
13) Click the "Save And Continue Edit " button.
14) Navigate to your product in the Front end.
15) Check when select gender "Mens" the size option must appear with two values 8 and 9. (screenshot)

Back to the index


How to use "select children" Ss selector

The Ss selector hides options that already has a parent.
The selector doesn't allow to select parent option as child.
For example if Option 1 has Option 2 as child and Option 2 has Option 3 as child you will not be able to select Option 1 as child for the Option 3.
So if all the options already have a parent or there is just one option the Ss selector doesn't appear.

Screenshot of the Ss selector.

NOTE: Ss selector is just to save your time. If you need more complex dependency or you need to copy the same ids for new rows you can enter the children ids directly into the Children field.

Back to the index


Option Templates

You can manage option templates in:
Magento admin panel -> Catalog -> Option Templates Screenshot

You can apply a template to a product on the "Edit template" page Screenshot
Or on the options tab of the "Edit product" page Screenshot

Back to the index


Mark options as Selected by Default

You can mark options to be already selected when the product page loads.
The dependent options will be hidden / displayed accordingly to the dependency.

NOTE: An option cannot be selected by default if the parent option is not selected by default.

Back to the index


To export options

In the Magento admin panel -> System -> Import/Export -> Advanced Profiles (screenshot)
Create and run two profiles:

1) export_options

<action type="optionextended/convert_parser_options" method="unparse">
<var name="delimiter"><![CDATA[,]]></var>
<var name="enclose"><![CDATA["]]></var>
</action>
<action type="dataflow/convert_adapter_io" method="save">
<var name="type">file</var>
<var name="path">var/export</var>
<var name="filename"><![CDATA[product_options.csv]]></var>
</action>


2) export_option_values

<action type="optionextended/convert_parser_values" method="unparse">
<var name="delimiter"><![CDATA[,]]></var>
<var name="enclose"><![CDATA["]]></var>
</action>
<action type="dataflow/convert_adapter_io" method="save">
<var name="type">file</var>
<var name="path">var/export</var>
<var name="filename"><![CDATA[product_option_values.csv]]></var>
</action>


3) export_options_translate ( optional )

<action type="optionextended/convert_parser_options_translate" method="unparse">
<var name="delimiter"><![CDATA[,]]></var>
<var name="enclose"><![CDATA["]]></var>
</action>
<action type="dataflow/convert_adapter_io" method="save">
<var name="type">file</var>
<var name="path">var/export</var>
<var name="filename"><![CDATA[product_options_translate.csv]]></var>
</action>


4) export_option_values_translate ( optional )

<action type="optionextended/convert_parser_values_translate" method="unparse">
<var name="delimiter"><![CDATA[,]]></var>
<var name="enclose"><![CDATA["]]></var>
</action>
<action type="dataflow/convert_adapter_io" method="save">
<var name="type">file</var>
<var name="path">var/export</var>
<var name="filename"><![CDATA[product_option_values_translate.csv]]></var>
</action>

Find the generated .csv files in the var/export directory.

Back to the index


To import options


FIRST STEP Prepare two import files with the Excel program:

1) product_options.csv

Required fields are five:
"product_sku", "code", "title", "type" and "row_id" when type is "field", "area", "file", "date", "date_time", "time".
Valid option types are:
"field", "area", "file", "drop_down", "radio", "checkbox", "multiple", "date", "date_time", "time"
Valid price types are:
"fixed", "percent"
Valid layouts are:
"above","below","before","swap","picker","pickerswap","grid","list"

Sample product_options.csv file.


2) product_option_values.csv

Required fields are three:
"option_code", "row_id", "title".
Valid price types are:
"fixed", "percent"

Sample product_option_values.csv file.


3) product_options_translate.csv ( optional )

Required fields are two:
"option_code", "store"

Sample product_options_translate.csv file.


4) product_option_values_translate.csv ( optional )

Required fields are three:
"option_code", "row_id", "store"

Sample product_option_values_translate.csv file.



The "code" field is a unique option code. Ex.: opt-166-82

The "row_id" field is a unique number of the option value within one product .
It means that one product cannot have repeated ids but two different products can have the same row ids.
In the product_options.csv file this field is required only when option type is "field", "area", "file", "date", "date_time", "time".
For other option types ("drop_down", "radio", "checkbox", "multiple") row_id of the option value is used.

The "children" field contains comma separated row ids of the other option values of the same product.
It must contain only existent row ids the product.
Or it can be empty.

The "image" field contains the name of the image uploaded to the media/import directory.
Or it can contain the path to the existent Magento image in the media/catalog/product directory.

The "store" field contains the code of the store (for example: default, german, french)
To find out the store code go to Magento admin panel -> System -> Manage Stores (screenshot)
Then click on the store link to edit it.

NOTE: The store code is not the same as the store name. For example the store name is "English" and its code is "default" (screenshot)



SECOND STEP Upload files into var/import directory.

Go to Magento admin panel -> System -> Import/Export -> Advanced Profiles (screenshot)
Create and run two profiles one after one:

1) import_options

<action type="dataflow/convert_adapter_io" method="load">
<var name="type">file</var>
<var name="path">var/import/</var>
<var name="filename"><![CDATA[product_options.csv]]></var>
<var name="format"><![CDATA[csv]]></var>
</action>
<action type="optionextended/convert_adapter_options" method="parse">
<var name="delimiter"><![CDATA[,]]></var>
<var name="enclose"><![CDATA["]]></var>
</action>

2) import_option_values

<action type="dataflow/convert_adapter_io" method="load">
<var name="type">file</var>
<var name="path">var/import/</var>
<var name="filename"><![CDATA[product_option_values.csv]]></var>
<var name="format"><![CDATA[csv]]></var>
</action>
<action type="optionextended/convert_adapter_values" method="parse">
<var name="delimiter"><![CDATA[,]]></var>
<var name="enclose"><![CDATA["]]></var>
</action>

3) import_options_translate ( optional )

<action type="dataflow/convert_adapter_io" method="load">
<var name="type">file</var>
<var name="path">var/import/</var>
<var name="filename"><![CDATA[product_options_translate.csv]]></var>
<var name="format"><![CDATA[csv]]></var>
</action>
<action type="optionextended/convert_adapter_options_translate" method="parse">
<var name="delimiter"><![CDATA[,]]></var>
<var name="enclose"><![CDATA["]]></var>
</action>

4) import_option_values_translate ( optional )

<action type="dataflow/convert_adapter_io" method="load">
<var name="type">file</var>
<var name="path">var/import/</var>
<var name="filename"><![CDATA[product_option_values_translate.csv]]></var>
<var name="format"><![CDATA[csv]]></var>
</action>
<action type="optionextended/convert_adapter_values_translate" method="parse">
<var name="delimiter"><![CDATA[,]]></var>
<var name="enclose"><![CDATA["]]></var>
</action>


NOTE: Options and option values are tied together with "option_code" field.
Option values and option value titles to translate are tied together with "option_code" and "row_id" fields.
When you run option import profile all the options with option values of all the stores (german, french...) of the same product are deleted.
So that before starting the import process you need to have all the import .csv files to not loose data.

Back to the index


To export templates

In the Magento admin panel -> System -> Import/Export -> Advanced Profiles (screenshot)
Create and run four profiles:

1) export_templates

<action type="optionextended/convert_parser_templates" method="unparse">
<var name="delimiter"><![CDATA[,]]></var>
<var name="enclose"><![CDATA["]]></var>
</action>
<action type="dataflow/convert_adapter_io" method="save">
<var name="type">file</var>
<var name="path">var/export</var>
<var name="filename"><![CDATA[templates.csv]]></var>
</action>


2) export_template_products

<action type="optionextended/convert_parser_products" method="unparse">
<var name="delimiter"><![CDATA[,]]></var>
<var name="enclose"><![CDATA["]]></var>
</action>
<action type="dataflow/convert_adapter_io" method="save">
<var name="type">file</var>
<var name="path">var/export</var>
<var name="filename"><![CDATA[template_products.csv]]></var>
</action>


3) export_template_options

<action type="optionextended/convert_parser_template_options" method="unparse">
<var name="delimiter"><![CDATA[,]]></var>
<var name="enclose"><![CDATA["]]></var>
</action>
<action type="dataflow/convert_adapter_io" method="save">
<var name="type">file</var>
<var name="path">var/export</var>
<var name="filename"><![CDATA[template_options.csv]]></var>
</action>


4) export_template_values

<action type="optionextended/convert_parser_template_values" method="unparse">
<var name="delimiter"><![CDATA[,]]></var>
<var name="enclose"><![CDATA["]]></var>
</action>
<action type="dataflow/convert_adapter_io" method="save">
<var name="type">file</var>
<var name="path">var/export</var>
<var name="filename"><![CDATA[template_values.csv]]></var>
</action>

5) export_template_options_translate ( optional )

<action type="optionextended/convert_parser_template_options_translate" method="unparse">
<var name="delimiter"><![CDATA[,]]></var>
<var name="enclose"><![CDATA["]]></var>
</action>
<action type="dataflow/convert_adapter_io" method="save">
<var name="type">file</var>
<var name="path">var/export</var>
<var name="filename"><![CDATA[template_options_translate.csv]]></var>
</action>


6) export_template_values_translate ( optional )

<action type="optionextended/convert_parser_template_values_translate" method="unparse">
<var name="delimiter"><![CDATA[,]]></var>
<var name="enclose"><![CDATA["]]></var>
</action>
<action type="dataflow/convert_adapter_io" method="save">
<var name="type">file</var>
<var name="path">var/export</var>
<var name="filename"><![CDATA[template_values_translate.csv]]></var>
</action>

Find the generated .csv files in the var/export directory.

Back to the index


To import templates


FIRST STEP Prepare four import files with the Excel program:

1) templates.csv

Required fields are two:
"code", "title"
Sample templates.csv file.


2) template_products.csv

Required fields are two:
"product_sku", "template_code".

Sample template_products.csv file.


3) template_options.csv

Required fields are five:
"template_code", "code", "title", "type" and "row_id" when type is "field", "area", "file", "date", "date_time", "time".
Valid option types are:
"field", "area", "file", "drop_down", "radio", "checkbox", "multiple", "date", "date_time", "time"
Valid price types are:
"fixed", "percent"
Valid layouts are:
"above","below","before","swap","picker","pickerswap","grid","list"

Sample template_options.csv file.


4) template_values.csv

Required fields are three:
"option_code", "row_id", "title".
Valid price types are:
"fixed", "percent"

Sample template_values.csv file.


5) template_options_translate.csv ( optional )

Required fields are two:
"option_code", "store"

Sample template_options_translate.csv file.


6) template_values_translate.csv ( optional )

Required fields are three:
"option_code", "row_id", "store"

Sample template_values_translate.csv file.



The "code" field is a unique option code. Ex.: opt-166-82

The "row_id" field is a unique number of the option value within one product .
It means that one product cannot have repeated ids but two different products can have the same row ids.
In the template_options.csv file this field is required only when option type is "field", "area", "file", "date", "date_time", "time".
For other option types ("drop_down", "radio", "checkbox", "multiple") row_id of the option value is used.

The "children" field contains comma separated row ids of the other option values of the same product.
It must contain only existent row ids of the product.
Or it can be empty.

The "image" field contains the name of the image uploaded to the media/import directory.
Or it can contain the path to the existent Magento image in the media/catalog/product directory.

The "store" field contains the code of the store (for example: default, german, french)
To find out the store code go to Magento admin panel -> System -> Manage Stores (screenshot)
Then click on the store link to edit it.

NOTE: The store code is not the same as the store name. For example the store name is "English" and its code is "default" (screenshot)



SECOND STEP Upload files into var/import directory.

Go to Magento admin panel -> System -> Import/Export -> Advanced Profiles (screenshot)
Create and run two profiles one after one:

1) import_templates

<action type="dataflow/convert_adapter_io" method="load">
<var name="type">file</var>
<var name="path">var/import/</var>
<var name="filename"><![CDATA[templates.csv]]></var>
<var name="format"><![CDATA[csv]]></var>
</action>
<action type="optionextended/convert_adapter_templates" method="parse">
<var name="delimiter"><![CDATA[,]]></var>
<var name="enclose"><![CDATA["]]></var>
</action>

2) import_template_products

<action type="dataflow/convert_adapter_io" method="load">
<var name="type">file</var>
<var name="path">var/import/</var>
<var name="filename"><![CDATA[template_products.csv]]></var>
<var name="format"><![CDATA[csv]]></var>
</action>
<action type="optionextended/convert_adapter_products" method="parse">
<var name="delimiter"><![CDATA[,]]></var>
<var name="enclose"><![CDATA["]]></var>
</action>

3) import_template_options

<action type="dataflow/convert_adapter_io" method="load">
<var name="type">file</var>
<var name="path">var/import/</var>
<var name="filename"><![CDATA[template_options.csv]]></var>
<var name="format"><![CDATA[csv]]></var>
</action>
<action type="optionextended/convert_adapter_template_options" method="parse">
<var name="delimiter"><![CDATA[,]]></var>
<var name="enclose"><![CDATA["]]></var>
</action>

4) import_template_values

<action type="dataflow/convert_adapter_io" method="load">
<var name="type">file</var>
<var name="path">var/import/</var>
<var name="filename"><![CDATA[template_values.csv]]></var>
<var name="format"><![CDATA[csv]]></var>
</action>
<action type="optionextended/convert_adapter_template_values" method="parse">
<var name="delimiter"><![CDATA[,]]></var>
<var name="enclose"><![CDATA["]]></var>
</action>

5) import_template_options_translate ( optional )

<action type="dataflow/convert_adapter_io" method="load">
<var name="type">file</var>
<var name="path">var/import/</var>
<var name="filename"><![CDATA[template_options_translate.csv]]></var>
<var name="format"><![CDATA[csv]]></var>
</action>
<action type="optionextended/convert_adapter_template_options_translate" method="parse">
<var name="delimiter"><![CDATA[,]]></var>
<var name="enclose"><![CDATA["]]></var>
</action>

6) import_template_values_translate ( optional )

<action type="dataflow/convert_adapter_io" method="load">
<var name="type">file</var>
<var name="path">var/import/</var>
<var name="filename"><![CDATA[template_values_translate.csv]]></var>
<var name="format"><![CDATA[csv]]></var>
</action>
<action type="optionextended/convert_adapter_template_values_translate" method="parse">
<var name="delimiter"><![CDATA[,]]></var>
<var name="enclose"><![CDATA["]]></var>
</action>


NOTE: Templates and template options are tied together with "template_code" field.
Options and option values are tied together with "option_code" field.
Option values and option value titles to translate are tied together with "option_code" and "row_id" fields.
When you run template import profile all the options with option values of all the stores (german, french...) of the same template are deleted.
So that before starting the import process you need to have all the import .csv files to not loose data.

Back to the index


Disable images in cart

Go to Magento admin panel -> System -> Configuration -> Checkout -> Shopping Cart
(screenshot)

Back to the index


Disable features of the "Edit product" page

Go to Magento admin panel -> System -> Configuration -> Admin -> Custom Option Features
(screenshot)

Back to the index


Adjust front-end styles

Find and edit this file:
skin/frontend/base/default/pektsekye/optionextended.css

To change the thumbnail size or background color find and edit the function - makeThumbnail in the file:
app/code/local/Pektsekye/OptionExtended/Block/Product/View/Js.php
Then adjust the thumbnail size in the CSS file.

Back to the index


Troubleshooting


Back to the index