Hey,
This tutorial shows images if I use sub-categories, but it shows no any image if adds are placed in parent-categories.
"Allow users to select a parent category as a category when inserting or editing a listing " is on.
I want to use only main (parent) categories and no subcategories. Then this tutorial doesnt work. Trying to change, nothing helps. Maybe somebody had a same problem or could say what to change in those codes?
functions.php
function osc_item_parent_category_id() {
if ( !View::newInstance()->_exists('item_category') ) {
View::newInstance()->_exportVariableToView('item_category', Category::newInstance()->findByPrimaryKey( osc_item_category_id() ) );
}
$category = View::newInstance()->_get('item_category') ;
return (int) osc_field($category, "fk_i_parent_id", "") ;
}
main.php and searchlist.php
<img src="<?php echo osc_current_web_theme_url('images/') . osc_item_parent_category_id() .'.png' ?>" alt="No image available" />