Add This code on vqmod/xml/ add this code using name body_class.xml
OR
You can download using this url:
http://www.opencart.com/index.php?route=extension/extension/info&token=91fd1e66cc0c0db4eeaa808b972993aa&extension_id=15738
Using This Module Add unique ID & Class for Your Web Pages using this class and id to generate unique design.
Easily Create style any individual page with this code!
Features:
– Body ID
– Body Class
– Single VQMod File
This code compitible opencart v1.4.7 to lattest Version 1.5.6.1.
<modification> <id>Body Class</id> <version>1.0.2</version> <vqmver>2.4.1</vqmver> <author>rvpatel</author> <file name="catalog/view/theme/*/template/common/header.tpl"> <operation error="abort" info="Add Column to Search"> <search position="replace"><![CDATA[<body]]></search> <add><![CDATA[<body<?php if(isset($this->request->get['route'])){ $class = explode('/',$this->request->get['route']); $id = $class[1]; $class = implode(' ',array_splice($class,1)); if(isset($this->request->get['information_id'])){ $this->load->model('catalog/information'); $information_id = '_'.$this->request->get['information_id']; $class .= str_replace('/','-',$information_id); }else if(isset($this->request->get['product_id'])){ $product_id = '_'.$this->request->get['product_id']; $class .= ' '.str_replace('/','-',$id.$product_id); } else{ $class .= ' '.str_replace('/','-',$this->request->get['route']); } if(isset($this->request->get['path'])){ $this->load->model('catalog/category'); $cats = explode('_',$this->request->get['path']); $cats = !is_array($cats)? array($cats) : $cats; foreach($cats as $cat){ $model = $this->model_catalog_category->getCategory($cat); $class .= ' '.str_replace(' ','-',preg_replace('/[^a-z0-9\s]/','',strtolower($model['name']))); } } }else{ $class = 'home common-home'; $id = 'home'; } echo ' id="'.$id.'" class="'.$class.'" '; ?>]]></add> </operation> </file> </modification>