I am new in OSClass. When I am searching something using search bar like "apartman", there will be result item, which contain a "apartman". It is ok. But a would like to add function to search. If I create new ads, like "car toyota", there will create a unique ID item and page looks like this "mydomain.com/index.php?page=item&id=2". The ID of this item is id 2. And I want, if I do a search with this value "2", result "car toyota", becuse this item ID is 2.
Does anyone know, how to do this?
By default it's not possible to use the search to search by ID's, but you could create a plugin
you can do this using "osc_query_item()", for example below mention code will return you details of an item that have an id=12345.
osc_query_item("id=12345");
if( osc_count_custom_items() == 0) { ?>
<p class="empty"><?php _e('No Listings', 'modern') ; ?></p>
<?php
}
else { ?>
<?php
while ( osc_has_custom_items() ) {
?>
<div style="width:100%; float:left;">
<div style="width:20%; float:left;">
<?php
if( osc_images_enabled_at_items() ) {
if( osc_count_item_resources() ) {
?>
<a href="<?php echo osc_item_url(); ?>">
<img src="<?php echo osc_resource_thumbnail_url(); ?>" width="75" height="56" title="<?php echo osc_item_title(); ?>" alt="<?php echo osc_item_title(); ?>" />
</a>
<?php } else { ?>
<img src="<?php echo osc_current_web_theme_url(); ?>/images/no_photo.gif" width="75" height="56" alt="" title=""/><?php
}
}
?>
</div>
<div style="width:80%; float:left;">
<strong><a href="<?php echo osc_item_url(); ?>"><?php echo osc_item_title(); ?></a></strong><br>
<strong><?php echo osc_item_formated_price(); ?> - <?php echo osc_item_city(); ?> ( <?php echo osc_item_region(); ?>) - <?php echo osc_format_date(osc_item_pub_date()); ?> </strong>
</div>
</div>
<?php
} ?><?php
}