System configuration field dependency


Here is the xml.
system_config_source_productSources return two option i.e(product,catalog) so dependency set base on this option selection.

<product_source translate="label">
		            		<label>Product Source</label>
		            		<frontend_type>select</frontend_type>
		            		<source_model>basicproducts/system_config_source_productSources</source_model>		            		
		            		<sort_order>10</sort_order>
		            		<show_in_default>1</show_in_default>
							<show_in_website>1</show_in_website>
							<show_in_store>1</show_in_store>
						</product_source>
						<product_category translate="label">
		            		<label>Select Category</label>
		            		<frontend_type>multiselect</frontend_type>
		            		<source_model>basicproducts/system_config_source_listCategory</source_model>
		            		<sort_order>20</sort_order>
		            		<show_in_default>1</show_in_default>
							<show_in_website>1</show_in_website>
							<show_in_store>1</show_in_store>
							<depends><product_source>catalog</product_source></depends>
						</product_category>
						<product_ids translate="label">
							<label>IDs of Products</label>
		            		<frontend_type>text</frontend_type>
		            		<comment>Separator by comma (,). Eg: 1,2,3,4...</comment>
		            		<sort_order>30</sort_order>
		            		<show_in_default>1</show_in_default>
							<show_in_website>1</show_in_website>
							<show_in_store>1</show_in_store>
							<depends><product_source>product</product_source></depends>
						</product_ids>
		            	<product_order_by translate="label">
		            		<label>Product Order by</label>
		            		<frontend_type>select</frontend_type>
		            		<source_model>basicproducts/system_config_source_orderBy</source_model>
		            		<sort_order>40</sort_order>
		            		<show_in_default>1</show_in_default>
							<show_in_website>1</show_in_website>
							<show_in_store>1</show_in_store>
							<depends><product_source>catalog</product_source></depends>
						</product_order_by>
		            	<product_order_dir translate="label">
		            		<label>Product Order Dir</label>
		            		<frontend_type>select</frontend_type>
		            		<source_model>basicproducts/system_config_source_orderDirection</source_model>
		            		<sort_order>50</sort_order>
		            		<show_in_default>1</show_in_default>
							<show_in_website>1</show_in_website>
							<show_in_store>1</show_in_store>
							<depends><product_source>catalog</product_source></depends>
						</product_order_dir>
Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s