sanl Posted June 12, 2014 Share Posted June 12, 2014 (edited) 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 June 12, 2014 by mantasl (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now