User Tools

Site Tools


udropship:customization

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
udropship:customization [2010/06/23 16:27]
unirgy
udropship:customization [2010/06/24 23:38] (current)
unirgy
Line 1: Line 1:
 +====== uDropShip Customizations ======
  
 +===== Adding a vendor field =====
 +
 +See example of initial vendor fields configuration in:
 +''​app/​code/​community/​Unirgy/​Dropship/​etc/​config.xml''​
 +
 +Create a new config file or use your custom module'​s config.xml
 +
 +For a standalone customization,​ can use ''​app/​etc/​modules/​z_custom_fields.xml'':​
 +
 +<file xml z_custom_fields.xml>​
 +<?xml version="​1.0"?>​
 +<​config>​
 +    <​global>​
 +        <​udropship>​
 +            <​vendor>​
 +<!-- If you want to create a new field group, use fieldset (optional): -->
 +                <​fieldsets>​
 +                    <​my_fieldset>​
 +                        <​legend>​My Fieldset</​legend>​
 +                        <​position>​100</​position>​
 +                    </​my_fieldset> ​
 +                </​fieldsets> ​           ​
 + 
 +                <​fields>​
 +<!-- Text field, named '​my_text_field'​ -->
 +                    <​my_text_field>​
 +<!-- text label for the field, will be shown to admin and vendor -->
 +                        <​label>​New Order Carbon Copy Emails</​label>​
 +<!-- Fieldset to show the field in, see udropship config.xml for default ones -->
 +                        <​fieldset>​my_fieldset</​fieldset>​
 +<!-- Position within the fieldset --> ​
 +                        <​position>​5</​position>​
 +<!-- Default value for the field --> ​
 +                        <​default><​![CDATA[Default text]]></​default> ​
 +<!-- <​note>​ is optional, use for comments on the field for admin and vendor -->
 +                        <​note>​Comma separated</​note>​
 +                    </​my_text_field>​
 +                   
 +<!-- Dropdown field -->
 +                    <​my_country_field>​
 +                        <​label>​3rd Party Country</​label>​
 +                        <​fieldset>​my_fieldset</​fieldset>​
 +                        <​type>​select</​type>​
 +                        <​source_model>​adminhtml/​system_config_source_country</​source_model>​
 +                        <​position>​5</​position>​
 +                    </​my_country_field>​
 +                   
 +                    <​my_dropdown_field>​
 +                        <​label>​My Yes/No Dropdown Field</​label>​
 +                        <​type>​select</​type>​
 +                        <​fieldset>​my_fieldset</​fieldset>​
 +<!-- Source for the '​switch'​ within the class file --> ​
 +                        <​source>​yesno</​source>​
 +                        <​position>​3</​position>​
 +<!-- Default value for the field --> ​
 +                        <​default>​0</​default>​
 +                    </​my_dropdown_field>  ​
 +                </​fields> ​
 +            </​vendor>​
 +        </​udropship>​
 +    </​global> ​
 +</​config>​
 +</​file>​
 +
 +  * Field Notes:
 +    * Fields will be taken automatically from vendor object and serialized into db vendor metafield. ​
 +    * If you want to save them in a separate field table, create field with this name in udropship_vendor.
 +    * It is prudent to use a prefix for field names to avoid conflict with existing fields ​
 +  * Possible field types: ​
 +    * text (default)
 +    * password
 +    * textarea
 +    * select
 +    * multiselect
 +    * image
 +    * date
 +    * datetime
 +  * If no <​source_model>​ is specified, app/​code/​community/​Unirgy/​Dropship/​Model/​Source.php class will be used.
 +    * You can create your own combined dropdown source classes by extending this class and overriding ''​toOptionHash()''​ method.
udropship/customization.txt · Last modified: 2010/06/24 23:38 by unirgy