Hi,
One possible solution is to make a clone function categories in your file funções.php
Then call this new function in the file item-edit.php, and replace the previous function.
What changes in this function is the css style that will hide the dropdown list of the main categories, and will keep the subcategories of selected category (which is hidden).
Test this method, it may work well for what you want to do.
example the theme repurpose I tested right now:
in functions.php
function item_category_selected($default_option) {
$categories = Category::newInstance()->findRootCategories() ; ?>
<?php if( count($categories) > 0 ) { ?>
<select class="category"style="display:none">
<option><?php echo $default_option ; ?></option>
<?php foreach($categories as $c) { ?>
<option value="<?php echo $c['pk_i_id'] ; ?>"><?php echo $c['s_name'] ; ?></option>
<?php } ?>
</select>
<?php } ?>
<select class="subcategory" name="catId" style="display:none"></select>
<?php
}
Now in item-edit.php call the new function with "display:none" added
<!-- category input -->
<div class="clearfix"style="margin-top:20px;">
<div id="wrappercategory">
<label><?php _e('Category', 'cocktail') ; ?></label>
<div class="input">
<?php item_category_selected( __('Select a category...', 'cocktail') ) ; ?>
</div>
<p class="text-info-category"><?php _e('Please select a main category', 'cocktail') ; ?></p>
</div>
</div>
<!-- category input end -->
Regards