Post by rtrtrt » Sat Jun 27, 2015 6:05 pm

Awesome, Thanks to all Guru

Newbie

Posts

Joined
Fri Jun 19, 2015 3:59 pm

Post by bablu » Wed Oct 07, 2015 7:12 pm

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()

Newbie

Posts

Joined
Wed Oct 07, 2015 3:26 pm

Post by rudydesigns » Tue May 10, 2016 5:59 am

Sorry to bump this thread.. But, is there a fix for this in OC2.2?

Adding said fix only causes an error to display.

Code: Select all

Fatal error: Call to undefined method ControllerProductCategory::redirect()
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!

Newbie

Posts

Joined
Tue May 10, 2016 5:54 am

Post by tibelchior » Sun Jun 12, 2016 11:38 pm

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']) {

Newbie

Posts

Joined
Sun Jun 12, 2016 11:33 pm
Who is online

Users browsing this forum: No registered users and 15 guests