Osclass forums

Support forums => General help => 3.6.x => Topic started by: operasail on November 08, 2016, 02:15:14 am

Title: [SOLVED] showing other premium items in category listing with no premium items
Post by: operasail on November 08, 2016, 02:15:14 am
Hello,

What is the simplest way to enable showing premium items from other/all categories in a category listing that has no premium items of its own?

Thanks for any help
Title: Re: showing other premium items in category listing with no premium items
Post by: operasail on January 08, 2017, 10:17:11 pm
I am still looking into this and believe its doable using osc_query_item($params) https://doc.osclass.org/Display_only_certain_type_of_listings

so in oc-content/themes/bender/search.php I have

if(osc_count_premiums() > 0) {
 ... display premium items code
}
else
{
  osc_query_item(array("premium" => 1,"results_per_page" => 2));
   ... then display results here
}

my question now is how to use View::newInstance()->_exportVariableToView to display custom_items ?

Thanks for any help
Title: SOLVED Re: showing other premium items in category listing with no premium items
Post by: operasail on January 10, 2017, 12:13:47 am
I found the solution by using same osc_query_item code provided by calinbehtuk in this thread http://forums.osclass.org/general-help/premium-ads-from-one-category-in-homepage/msg129891/#msg129891

I simply removed this part from the code: 'category' => '117',  so I get premium items from all categories.