Monday, 8 February 2016

How to determine current Category in Opencart

<?php
if(isset($this->request->get['path'])) {
    $path = $this->request->get['path'];
    $category = explode('_', $path);
    $category_id = $category[count($category) - 1];
}
 echo $category_id;
?>
Note : If You are using SEO URL simply echo $path

No comments:

Post a Comment