Advertisement

Tuesday, 27 January 2015

How to list items only from specific country in osclass main page listing.

Here i have given you a way to list the items only from specific country in osclass. Normally the osclass script will list all items from all country in the main page listing, But in some cases user need to list only from one country. Given below code is used to list only from one country from the database in the osclass script.

Replace in main.php(inside your current theme folder):

Replace this code: 

     <?php if( osc_count_latest_items() == 0) { ?>

With this code     :

      <?php if( osc_count_latest_items(null, array('sCountry' => 'XX')) == 0) { ?>

Change "XX" to your country code.(its fk_c_country_code field in the table oc_t_item_location in the osclass database).