*

pitbull

  • ***
  • 98 posts
I want to hide sold items of been displayed in latest listings at the main page and at the search results. What is the code to do that ?

Thanks

*

MB Themes

@pibull
In file:
oc-content/themes/veronika/functions.php

Find this code:
Code: [Select]
  $randSearch->dao->from( DB_TABLE_PREFIX.'t_item use index (PRIMARY)' );

  // where
  $whe  = DB_TABLE_PREFIX.'t_item.b_active = 1 AND ';
  $whe .= DB_TABLE_PREFIX.'t_item.b_enabled = 1 AND ';


And replace it with:
Code: [Select]
  $randSearch->dao->from( DB_TABLE_PREFIX.'t_item use index (PRIMARY), ' . DB_TABLE_PREFIX.'t_item_veronika' );

  // where
  $whe  = DB_TABLE_PREFIX.'t_item.b_active = 1 AND ';
  $whe .= DB_TABLE_PREFIX.'t_item.pk_i_id = ' . DB_TABLE_PREFIX.'t_item_veronika.fk_i_item_id AND ';
  $whe .= DB_TABLE_PREFIX.'t_item_veronika.i_sold <> 1 AND ';
  $whe .= DB_TABLE_PREFIX.'t_item.b_enabled = 1 AND ';

I have not tested code, it's on you.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

pitbull

  • ***
  • 98 posts
thanks @ frosticek

I'll test it asap

*

pitbull

  • ***
  • 98 posts
Unfortunately didnt work :( Now it hides all the items from Latest Ads section at the main page. We maybe could to apply a unique class to the sold items so i can use then CSS and hide all the items that using this class? I don't know, just a thought..

*

MB Themes

Css will not work.
Try to remove from code "use index (primary)"
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots