Advertisement:

Author Topic: [SOLVED] Fill "osc_has_items()" with all items, no matter the search filters?  (Read 274 times)

WEBmods

  • Hero Member
  • *****
  • Posts: 937
  • github.com/webmods-croatia/love-osclass/ | patrick
Hello,

Is there any helper function that I could use to fill "osc_has_items()" loop with ALL items on the site while on the search page? When using "osc_reset_items()" and "while(osc_has_items())" on the search page, it gets affected by filters and not all items are in the loop.

I hope I explained this good, I need a solution urgently and any help will be appreciated.

Thank you, regards.
« Last Edit: July 06, 2018, 03:07:44 pm by patrickFromCroatia »

WEBmods

  • Hero Member
  • *****
  • Posts: 937
  • github.com/webmods-croatia/love-osclass/ | patrick
Found a solution, didn't know it would be so simple... Just use "osc_has_custom_items()" with "osc_query_item()" helper instead.

Code: [Select]
<?php
osc_query_item
(array('results_per_page' => 999));
       
if( 
osc_count_custom_items() != 0) {
    while(
osc_has_custom_items()) {
        
// Do your stuff
    
}
}
?>

« Last Edit: July 06, 2018, 03:08:42 pm by patrickFromCroatia »