Hi,
I’m wondering why the HOT and SALE label display the same background icon (both times red).
If I look into the CSS, style.css, there is not explicit definition for Sale-label. I’ve also tried to change the CSS to sales-label to sale-label but this is also not working..
<span class="Sale-label label">Sale</span>
Code:
.products-grid .product-image .label { position: absolute; width: 42px; height: 40px; line-height: 55px; background: url(../images/icon_hot.png) no-repeat right top; top:0; right: 0; color: #fff text-align: center; text-transform: uppercase; font-weight: bold; font-size: 12px; font-size:'Passion One',cursive; letter-spacing:-1px; } .products-grid .product-image .sales-label { background-image: url(../images/icon_sale.png); color:#000; }
The icons exists
http://playground.oneinsixbillion.de…/icon_sale.png
http://playground.oneinsixbillion.de…s/icon_hot.png
Any ideas?
Thanks
Daniel
8 answers
Hi Daniel,
Can you let me know in which page I can see the icons display wrongly as mentioned ?
Hi Sherlock,
you can see it here http://playground.oneinsixbillion.de/index.php/home
Please scroll down to the Featured products.
Another strange behaviour in this context is that on this page
http://playground.oneinsixbillion.de…/type/featured
The first 4 products get the HOT label. But they are not all flaged as HOT.
Thanks for your help
Daniel
okay Daniel, I think those Hot and Sale Labels have the same background, if you want you can change the icons accordingly for example you can replace the sale icon by replacing this icon image skin/frontend/default/jm_siotis/images/icon_sale.png
Thanks for your response Sherlock.
As mentioned in my first post both icons are there and different
http://playground.oneinsixbillion.de…s/icon_hot.png
http://playground.oneinsixbillion.de…/icon_sale.png
But the CSS for hot and sale is the same. So always the icon_hot.png is loaded.
How can I fix this CSS issue?
Okay daniell, you can open the file of skin/frontend/default/jm_siotis/css/styles.css you look for this css rule
HTML Code:
.products-grid .product-image .sales-label { background-image: url("../images/icon_sale.png"); color: [URL=http://www.joomlart.com/forums/usertag.php?do=list&action=hash&hash=000000]#000000[/URL] }
change it to
HTML Code:
.products-grid .product-image .Sales-label { background-image: url("../images/icon_sale.png"); color: [URL=http://www.joomlart.com/forums/usertag.php?do=list&action=hash&hash=000000]#000000[/URL] }
the problem here are the S capital in .Sales-label
Hi Sherlock,
thanks for the hint. That was the root cause.
It had to be ".Sale-label" not ".Sales-label".
Regards
Daniel
Hi Sherlock,
another question in this context
If you go to this page
http://playground.oneinsixbillion.de…/type/featured
The first four products are displayed with the "HOT" label. But not all of them have the label hot configured.
The same problem here
http://playground.oneinsixbillion.de…-t-shirts.html
The Deadhead Shirts are on sale, but also the Free Your Soul shirt is displayed with the Sale label.
Any idea what’s going wrong?
Thanks
Daniel
Okay Daniel, I just fixed this issue for you those file get modifies are app/design/frontend/default/jm_siotis/template/joomlart/jmproducts/viewall.phtml and app/design/frontend/default/jm_siotis/template/catalog/product/list.phtml , i opened those file and change this block of code
PHP Code:
<?php
$_rowCount = ceil($_collectionSize/$_columnCount);
if ($i%$_columnCount==0) : $j++; endif;
if ($i++%$_columnCount==0):
$width = 100;
if ($_columnCount) $width = 100/$_columnCount;
$width = "style=\"width:{$width}%;\"";
$return = false;
$product = Mage::getModel('catalog/product')->load($_product->getId());
$attribute = $product->getResource()->getAttribute('label');
if(is_object($attribute)){
$_options= $attribute->getSource()->getAllOptions(true, true);
foreach($_options as $option){
if ($option['value'] == $product->getData("label")){
$class = $option['label'];
}
}
$attdefaultvalue = $attribute->getDefaultValue();
$attributeValue = Mage::getModel('catalog/product')->load($_product->getId())->getlabel();
$attributeValueName = Mage::getModel('catalog/product')->load($_product->getId())->getAttributeText('label');
if(strlen($attributeValue) && ($attdefaultvalue !== $attributeValue)) {
$labeltype = $class;
$labelname = $attributeValueName;
}
else {
$labeltype = "";
}
}
?>
To
PHP Code:
<?php
$product = Mage::getModel('catalog/product')->load($_product->getId());
$attribute = $product->getResource()->getAttribute('label');
if(is_object($attribute)){
$_options= $attribute->getSource()->getAllOptions(true, true);
foreach($_options as $option){
if ($option['value'] == $product->getData("label")){
$class = $option['label'];
}
}
$attdefaultvalue = $attribute->getDefaultValue();
$attributeValue = Mage::getModel('catalog/product')->load($_product->getId())->getlabel();
$attributeValueName = Mage::getModel('catalog/product')->load($_product->getId())->getAttributeText('label');
if(strlen($attributeValue) && ($attdefaultvalue !== $attributeValue)) {
$labeltype = $class;
$labelname = $attributeValueName;
}
else {
$labeltype = "";
}
}
$_rowCount = ceil($_collectionSize/$_columnCount);
if ($i%$_columnCount==0) : $j++; endif;
if ($i++%$_columnCount==0):
$width = 100;
if ($_columnCount) $width = 100/$_columnCount;
$width = "style=\"width:{$width}%;\"";
$return = false;
?>