sshare Posted November 25, 2013 Share Posted November 25, 2013 (edited) Hi everyone, I'm trying to get the an override to work for the CategoryController, but whatever I put in the CategoryController file the category pages on my site go blank. Here's the code I'm using, what am I doing wrong? I'm running 1.5.0.17 btw. <?php class CategoryController extends CategoryControllerCore { public function initContent() { parent::initContent(); if($this->cat_products) { $id_customer = (isset($this->context->customer) ? (int)$this->context->customer->id : 0); $id_group = (isset($this->context->customer) ? $this->context->customer->id_default_group : _PS_DEFAULT_CUSTOMER_GROUP_); $id_country = (int)$id_customer ? Customer::getCurrentCountry($id_customer) : Configuration::get(‘PS_COUNTRY_DEFAULT’); $id_currency = (int)$this->context->cookie->id_currency; $id_shop = $this->context->shop->id; foreach ($this->cat_products as $key => $product) { $prices_array = array(); /* For each product, grab quantity discounts */ $quantity_discounts = SpecificPrice::getQuantityDiscounts($product['id_product'], $id_shop, $id_currency, $id_country, $id_group, null, true); /* Process quantity discounts to get the real price */ if ($quantity_discounts) { foreach ($quantity_discounts as $qkey => $discount) { if (!(float)$discount['reduction']) $price = $discount['price']; else { if ($discount['reduction_type'] == ‘percentage’) { $price = $product['price_without_reduction'] – ($product['price_without_reduction'] * $discount['reduction']); } else { $price = $product['price_without_reduction'] – $discount['reduction']; } } $prices_array[] = $price; } $this->cat_products[$key]['price'] = min($prices_array); $this->cat_products[$key]['qt_disc'] = true; } // end if quantity discounts $this->context->smarty->assign(‘products’, $this->cat_products); } } } } } Edited November 26, 2013 by sshare (see edit history) Link to comment Share on other sites More sharing options...
Rolige Posted November 25, 2013 Share Posted November 25, 2013 Delete cache/class_index.php and try again. Regards. Link to comment Share on other sites More sharing options...
sshare Posted November 26, 2013 Author Share Posted November 26, 2013 Thanks COTOKO, I tried that twice now already, but no luck, I just turned on the error reporting, and get the following error: Parse error: syntax error, unexpected T_STRING in CategoryController.php on line 36 Link to comment Share on other sites More sharing options...
bellini13 Posted November 26, 2013 Share Posted November 26, 2013 you have 1 too many closing brackets. try to delete one from line 53 in your code above 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