version 3.0.2.0.
For previous versions of Opencart we found extensions or a code snippet to redirect a category or search to a single product result, should a category or search result only contain one product.
Does anyone know of a way to do this in Opencart 3.0.2.0. ?
Thanks
For previous versions of Opencart we found extensions or a code snippet to redirect a category or search to a single product result, should a category or search result only contain one product.
Does anyone know of a way to do this in Opencart 3.0.2.0. ?
Thanks
Big Decision
Website Production, Ecommerce & Digital Marketing in the UK
http://www.bigdecision.co.uk
Hi,
In these files:
Find:
Add after:
Please do not edit the core files, Use ocmod or vqmod instead.
In these files:
Code: Select all
catalog\controller\product\search.php
catalog\controller\product\category.php
Code: Select all
$results = $this->model_catalog_product->getProducts($filter_data);
Code: Select all
if (count($results) == 1) {
reset($results);
$this->response->redirect($this->url->link('product/product', 'product_id=' . key($results), true));
}
Last edited by DigitCart on Tue Oct 06, 2020 4:31 am, edited 2 times in total.
Thank you very much.
Will give this a try.
Will give this a try.
Big Decision
Website Production, Ecommerce & Digital Marketing in the UK
http://www.bigdecision.co.uk
If anyone is still looking for a solution and can't find an extension, you could pay a developer such as ourselves or post a job in the Commercial Support Forum.
UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk
Who is online
Users browsing this forum: No registered users and 86 guests