Custom Option Images 1.5 May 30 2013


This is "Custom Option Images" addition for apparel stores.
It adds ability to add (upload) images for custom product options.
So if you have an apparel store you can add custom option Color and upload small images for each color option.
Then if a customer selects Color option he will see the small image above the options dropdown (or check boxes, radio buttons, multiple select)




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 17 new files :

app/code/local/Pektsekye/OptionImages/Helper/Data.php
app/code/local/Pektsekye/OptionImages/Block/Adminhtml/Catalog/Product/Edit/Js.php
app/code/local/Pektsekye/OptionImages/Block/Product/View/Js.php
app/code/local/Pektsekye/OptionImages/Model/Resource/Eav/Mysql4/Product/Option/Value.php
app/code/local/Pektsekye/OptionImages/Model/OptionImages.php
app/code/local/Pektsekye/OptionImages/Model/Observer.php
app/code/local/Pektsekye/OptionImages/Model/Mysql4/OptionImages.php
app/code/local/Pektsekye/OptionImages/sql/optionimages_setup/mysql4-install-0.1.0.php
app/code/local/Pektsekye/OptionImages/etc/system.xml
app/code/local/Pektsekye/OptionImages/etc/config.xml
app/etc/modules/Pektsekye_OptionImages.xml
app/design/adminhtml/default/default/template/optionimages/catalog/product/edit/js.phtml
app/design/adminhtml/default/default/layout/optionimages.xml
app/design/frontend/base/default/template/optionimages/product/view/js.phtml
app/design/frontend/base/default/layout/optionimages.xml
app/locale/en_US/Pektsekye_OptionImages.csv
skin/adminhtml/default/default/optionimages.css
skin/adminhtml/default/default/optionimages_delete_image.gif





To disable popup

Go to:
   Magento admin panel -> System -> Configuration -> Catalog -> Custom Option Images



To change the image size / style

In the file:
    app/ design/ frontend/ YOUR_INTERFACE/ default/ template/ optionimages/ product/ view/ js.phtml

adjust this line:
    var opImageTemplate = '<img src="{{url}}" id="option_image_{{id}}" width="100" style="display:none;" alt="" ' + opImagePopup + ' />';



NOTE: Don't forget to refresh the magento cache after any of the layout changes.
Magento admin panel -> System -> Cache Management -> Cache Control



To export options

1) Go to Magento admin panel -> System -> Import/Export -> Advanced Profiles (screenshot)
2) Click the "Add New Profile" button.
3) Fill in the fields:
Profile name - "optionimages-export"
Actions XML -

<action type="optionimages/convert_parser_options" method="unparse">
</action>
<action type="dataflow/convert_mapper_column" method="map">
</action>
<action type="dataflow/convert_parser_csv" method="unparse">
<var name="delimiter"><![CDATA[,]]></var>
<var name="enclose"><![CDATA["]]></var>
<var name="fieldnames">true</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[option_images.csv]]></var>
</action>

4) Click the "Save and Continue Editing" button.
5) Select "Run Profile" in the right menu and click the "Run Profile In Popup" button.
6) Find the generated option_images.csv file in var/export




To import options


1) Prepare options data with the Excel program:
Required fields are four:
"product_sku", "option_title", "type" and "value_title" (when type is "drop_down", "radio", "checkbox" or "multiple").
Valid option types are:
"field", "area", "file", "drop_down", "radio", "checkbox", "multiple", "date", "date_time", "time"
Valid price types are:
"fixed", "percent"


Check a sample import file.

2) Save it as "import_options.csv" file and upload it to var/import directory
3) Go to Magento admin panel -> System -> Import/Export -> Advanced Profiles
4) Click the "Add New Profile" button.
5) Fill in the fields:
Profile name - "optionimages-import"
Actions XML -

<action type="dataflow/convert_adapter_io" method="load">
<var name="type">file</var>
<var name="path">var/import/</var>
<var name="filename"><![CDATA[option_images.csv]]></var>
<var name="format"><![CDATA[csv]]></var>
</action>
<action type="dataflow/convert_parser_csv" method="parse">
<var name="delimiter"><![CDATA[,]]></var>
<var name="enclose"><![CDATA["]]></var>
<var name="fieldnames">true</var>
<var name="store"><![CDATA[0]]></var>
<var name="adapter">optionimages/convert_adapter_options</var>
<var name="method">parse</var>
</action>

6) Click the "Save and Continue Editing" button.
7) Select "Run Profile" in the right menu and click the "Run Profile In Popup" button.