1. <body>
  2. <h1 class="item_adding"></h1>
  3.  
  4. <?php
  5. $city_list = array();
  6. $cookie_loc = array();
  7. $def_cat['fk_i_category_id'] = Params::getParam('sCategory');
  8. $country = Country::newInstance()->listAll();
  9.  
  10. if(osc_is_web_user_logged_in()) {
  11.  
  12. // GET LOCATION OF LOGGED USER
  13. $cookie_loc = osc_user();
  14.  
  15. // IF THERE IS JUST 1 COUNTRY, PRE-SELECT IT TO ENABLE REGION DROPDOWN
  16. if(count($country) == 1) {
  17. $country = $country[0];
  18. $cookie_loc['fk_c_country_code'] = $country['pk_c_code'];
  19. }
  20. } else {
  21.  
  22. // GET LOCATION FROM SEARCH
  23. if(Params::getParam('sCountry') <> '') {
  24. if(strlen(Params::getParam('sCountry')) == 2) {
  25. $cookie_loc['fk_c_country_code'] = Params::getParam('sCountry');
  26. } else {
  27. $country = Country::newInstance()->findByName(Params::getParam('sCountry'));
  28. $cookie_loc['fk_c_country_code'] = $country['pk_c_code'];
  29. }
  30. } else {
  31. // IF THERE IS JUST 1 COUNTRY, PRE-SELECT IT TO ENABLE REGION DROPDOWN
  32. if(count($country) == 1) {
  33. $country = $country[0];
  34. $cookie_loc['fk_c_country_code'] = $country['pk_c_code'];
  35. }
  36. }
  37.  
  38.  
  39.  
  40. if(Params::getParam('sRegion') <> '') {
  41. if(is_numeric(Params::getParam('sRegion'))) {
  42. $cookie_loc['fk_i_region_id'] = Params::getParam('sRegion');
  43. } else {
  44. $region = Region::newInstance()->findByName(Params::getParam('sRegion'));
  45. $cookie_loc['fk_i_region_id'] = $region['pk_i_id'];
  46. }
  47. }
  48. }
  49.  
  50.  
  51. if(Params::getParam('sCity') <> '') {
  52. if(is_numeric(Params::getParam('sCity'))) {
  53. $cookie_loc['fk_i_city_id'] = Params::getParam('sCity');
  54. } else {
  55. $city = City::newInstance()->findByName(Params::getParam('sCity'), $cookie_loc['fk_i_region_id']);
  56. $cookie_loc['fk_i_city_id'] = $city['pk_i_id'];
  57. }
  58. }
  59.  
  60. if(isset($cookie_loc['fk_c_country_code']) && $cookie_loc['fk_c_country_code'] <> '') {
  61. $region_list = Region::newInstance()->findByCountry($cookie_loc['fk_c_country_code']);
  62. } else {
  63. $region_list = RegionStats::newInstance()->listRegions("%%%%", ">=");
  64. }
  65.  
  66.  
  67.  
  68. if(isset($cookie_loc['fk_i_region_id']) && $cookie_loc['fk_i_region_id'] <> '') {
  69. $city_list = City::newInstance()->findByRegion($cookie_loc['fk_i_region_id']);
  70. }
  71. ?>
  72.  
  73.  
  74. <?php osc_current_web_theme_path('header.php') ; ?>
  75.  
  76. <ul id="error_list" class="new-item"></ul>
  77.  
  78. <div class="content add_item">
  79. <form name="item" action="<?php echo osc_base_url(true);?>" method="post" enctype="multipart/form-data">
  80. <fieldset>
  81. <input type="hidden" name="action" value="item_add_post" />
  82. <input type="hidden" name="page" value="item" />
  83.  
  84. <h2 class="post-out"><?php _e('Place Ad', 'zara'); ?></h2>
  85.  
  86. <div id="left">
  87. <div class="box general_info">
  88.  
  89. <!-- CATEGORY -->
  90. <?php if(osc_get_preference('drop_cat', 'zara_theme') == 1) { ?>
  91. <div class="row catshow multiple">
  92. <div class="multi-left">
  93. <label for="catId"><span><?php _e('Category', 'zara'); ?></span><span class="req">*</span></label>
  94. </div>
  95. <div class="multi-right">
  96. <?php ItemForm::category_multiple_selects(null, $def_cat, __('Select a category', 'zara')); ?>
  97. </div>
  98. </div>
  99. <?php } else { ?>
  100. <div class="row catshow">
  101. <label for="catId"><span><?php _e('Category', 'zara'); ?></span><span class="req">*</span></label>
  102. <?php ItemForm::category_select(null, $def_cat, __('Select a category', 'zara')); ?>
  103. </div>
  104. <?php } ?>
  105.  
  106.  
  107. <!-- PRICE -->
  108. <?php if( osc_price_enabled_at_items() ) { ?>
  109. <div class="box price">
  110. <label for="price"><span><?php _e('Price', 'zara'); ?></span></label>
  111.  
  112. <?php ItemForm::price_input_text(); ?>
  113. <?php ItemForm::currency_select(); ?>
  114.  
  115. <div class="radio-price-row first"><input type="radio" id="ps1" name="PriceSelect" value="0" checked="checked"><?php _e('Enter price', 'zara'); ?></div>
  116. <div class="radio-price-row"><input type="radio" id="ps2" name="PriceSelect" value="1"><?php _e('Free', 'zara'); ?></div>
  117. <div class="radio-price-row"><input type="radio" id="ps3" name="PriceSelect" value="2"><?php _e('Check with seller', 'zara'); ?></div>
  118.  
  119. </div>
  120. <?php } ?>
  121.  


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.