In many cases, the brands on the ecshop category page are displayed in the form of names. The following ecshop development center technology tells you how ecshop achieves product list page attribute filtering area brand filtering and displays it in the form of Logo
1. Modify the category. php file (about 220 rows)
Find
1 |
$sql = "SELECT b.brand_id, b.brand_name, COUNT(*) AS goods_num " . |
Replace
1 |
$sql = "SELECT b.brand_id,b.brand_logo, b.brand_name, COUNT(*) AS goods_num " . |
2. In (about 232 rows)
Find
1 |
$brands [ $temp_key ][ ‘brand_name‘ ] = $val [ ‘brand_name‘ ]; |
Add
1 |
$brands [ $temp_key ][ ‘brand_logo‘ ] = $val [ ‘brand_logo‘ ]; |
3. In (approximately 242 rows or 246 rows)
Find
1 |
$brands [0][ ‘brand_name‘ ] = $_LANG [ ‘all_attribute‘ ]; |
Add
1 |
$brands [0][ ‘brand_logo‘ ]= ‘‘ ; |
4. Modify the category. DWT file search
1 |
<span>{ $brand .brand_name}</span> |
Replace:
12 |
<span>{ if $brand .brand_logo}"/data/brandlogo/{$brand.brand_logo}" width= "40px" height= "40px" > { else }{ $brand .brand_name}{/ if }</span> |
5. Continue to find
1 |
<a href= "{$brand.url}" >{ $brand .brand_name}</a> |
Replace
1234 |
<div class = "akl" style="margin-left:2px;min-height:0px; margin-top:5px; width:178px; height:60px; border:1px dotted #009900; display: -moz-inline-stack;display: inline-block; vertical-align:bottom;text-align:center;zoom:1;*display:inline;"> <a href= "{$brand.url}" style= "" >{ if $brand .brand_logo}"data/brandlogo/{$brand.brand_logo}" width= "172" height= "60" > { else }{ $brand .brand_name}{/ if }</a></div> |
Note: the size of the brand logo has been defined in step 1, with width = 5th Height = 60. You can adjust the size of your logo based on your own situation.
6. Add a CSS style and open style.css to put the following code at the bottom of it.
1234 |
div.akl:hover{filter:alpha(opacity= 50 ); -moz-opacity: 0.5 ; opacity: 0.5 ; } |
Ecshop achieves product list page attribute filtering area brand filtering in the form of Logo display