<body> <h1 class="item_adding"></h1> <?php $def_cat['fk_i_category_id'] = Params::getParam('sCategory'); $country = Country::newInstance()->listAll(); if(osc_is_web_user_logged_in()) { // GET LOCATION OF LOGGED USER $cookie_loc = osc_user(); // IF THERE IS JUST 1 COUNTRY, PRE-SELECT IT TO ENABLE REGION DROPDOWN $country = $country[0]; $cookie_loc['fk_c_country_code'] = $country['pk_c_code']; } } else { // GET LOCATION FROM SEARCH if(Params::getParam('sCountry') <> '') { $cookie_loc['fk_c_country_code'] = Params::getParam('sCountry'); } else { $country = Country::newInstance()->findByName(Params::getParam('sCountry')); $cookie_loc['fk_c_country_code'] = $country['pk_c_code']; } } else { // IF THERE IS JUST 1 COUNTRY, PRE-SELECT IT TO ENABLE REGION DROPDOWN $country = $country[0]; $cookie_loc['fk_c_country_code'] = $country['pk_c_code']; } } if(Params::getParam('sRegion') <> '') { $cookie_loc['fk_i_region_id'] = Params::getParam('sRegion'); } else { $region = Region::newInstance()->findByName(Params::getParam('sRegion')); $cookie_loc['fk_i_region_id'] = $region['pk_i_id']; } } } if(Params::getParam('sCity') <> '') { $cookie_loc['fk_i_city_id'] = Params::getParam('sCity'); } else { $city = City::newInstance()->findByName(Params::getParam('sCity'), $cookie_loc['fk_i_region_id']); $cookie_loc['fk_i_city_id'] = $city['pk_i_id']; } } $region_list = Region::newInstance()->findByCountry($cookie_loc['fk_c_country_code']); } else { $region_list = RegionStats::newInstance()->listRegions("%%%%", ">="); } $city_list = City::newInstance()->findByRegion($cookie_loc['fk_i_region_id']); } ?> <?php osc_current_web_theme_path('header.php') ; ?> <ul id="error_list" class="new-item"></ul> <div class="content add_item"> <form name="item" action="<?php echo osc_base_url(true);?>" method="post" enctype="multipart/form-data"> <fieldset> <input type="hidden" name="action" value="item_add_post" /> <input type="hidden" name="page" value="item" /> <h2 class="post-out"><?php _e('Place Ad', 'zara'); ?></h2> <div id="left"> <div class="box general_info"> <!-- CATEGORY --> <?php if(osc_get_preference('drop_cat', 'zara_theme') == 1) { ?> <div class="row catshow multiple"> <div class="multi-left"> <label for="catId"><span><?php _e('Category', 'zara'); ?></span><span class="req">*</span></label> </div> <div class="multi-right"> <?php ItemForm::category_multiple_selects(null, $def_cat, __('Select a category', 'zara')); ?> </div> </div> <?php } else { ?> <div class="row catshow"> <label for="catId"><span><?php _e('Category', 'zara'); ?></span><span class="req">*</span></label> <?php ItemForm::category_select(null, $def_cat, __('Select a category', 'zara')); ?> </div> <?php } ?> <!-- PRICE --> <?php if( osc_price_enabled_at_items() ) { ?> <div class="box price"> <label for="price"><span><?php _e('Price', 'zara'); ?></span></label> <?php ItemForm::price_input_text(); ?> <?php ItemForm::currency_select(); ?> <div class="radio-price-row first"><input type="radio" id="ps1" name="PriceSelect" value="0" checked="checked"><?php _e('Enter price', 'zara'); ?></div> <div class="radio-price-row"><input type="radio" id="ps2" name="PriceSelect" value="1"><?php _e('Free', 'zara'); ?></div> <div class="radio-price-row"><input type="radio" id="ps3" name="PriceSelect" value="2"><?php _e('Check with seller', 'zara'); ?></div> </div> <?php } ?>
Mam taki kod.
W ten sposób po wybraniu kategorii dodaje mi pole Price (w przypadku kazdej kategorii)
Teraz w momencie wybrania kategori (rodzica) Vehicles i subkategorii Cars chciałbym aby dodawało mi pola dodatkowe typu marka itp.
Zrobione - Do zamknięcia.