foreach ($results as $result) {
if($product_total == 1){
$this->redirect($this->url->link('product/product', 'path=' . $this->request->get['path'] . '&product_id=' . $result['product_id']));
}
if ($result['image']) {
adding above code to my catalog/controller/product/category.php in it give error below how to solve this please any one tell.
Fatal error: Call to undefined method ControllerProductCategory::redirect()
if($product_total == 1){
$this->redirect($this->url->link('product/product', 'path=' . $this->request->get['path'] . '&product_id=' . $result['product_id']));
}
if ($result['image']) {
adding above code to my catalog/controller/product/category.php in it give error below how to solve this please any one tell.
Fatal error: Call to undefined method ControllerProductCategory::redirect()
Sorry to bump this thread.. But, is there a fix for this in OC2.2?
Adding said fix only causes an error to display.
Any help would be greatly appreciated. (I did a search, found only this thread.. Figured better than creating a new one.. Sorry, new to this..)
Thanks!
Adding said fix only causes an error to display.
Code: Select all
Fatal error: Call to undefined method ControllerProductCategory::redirect()
Thanks!
To anyone looking this answer for Opencart 2.2, just add response before the redirect.
Code: Select all
foreach ($results as $result) {
if($product_total == 1){
$this->response->redirect($this->url->link('product/product', 'path=' . $this->request->get['path'] . '&product_id=' . $result['product_id']));
}
if ($result['image']) {
Who is online
Users browsing this forum: No registered users and 11 guests