Jump to content

Hide product from best seller module


sanl

Recommended Posts

Hey,

 

Im trying to hide 1 product from best seller module cuz this product is disable but still in most popular products array and customers can see it in site. But if u click that url u get error - no more this product.

 

I would like to hide it how to do it?

 

Is my solution good?

 

protected function getBestSellers($params)
{
if (Configuration::get('PS_CATALOG_MODE'))
return false;
if (!($result = ProductSale::getBestSalesLight((int)$params['cookie']->id_lang, 0, 5)))
return (Configuration::get('PS_BLOCK_BESTSELLERS_DISPLAY') ? array() : false);

$badurl ="mybadurl";

$goodurl ="goodurl";
$bestsellers = array();
$link->getProductLink($product['id_product']). - how to use it to check my url?

str_replace("badurl","goodurl",$arr,$i));

$currency = new Currency($params['cookie']->id_currency);
$usetax = (Product::getTaxCalculationMethod((int)$this->context->customer->id) != PS_TAX_EXC);
foreach ($result as &$row)
$row['price'] = Tools::displayPrice(Product::getPriceStatic((int)$row['id_product'], $usetax), $currency);
return $result;
}
}

Edited by mantasl (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...