Quote:
Originally Posted by minfinger
My apologies. Mine are grouped.
|
ok, here's a down and dirty way to hide individual attributes based on hard-coded name values
if you need to hide a whole group, title and all, that would be different
in attribute.tpl shown above, add an inline style on the <li tag
Code:
{if:getAttributeGroup()}
<li><div class="head-h3">{getTitle()}</div>
<ul>
{end:}
<li FOREACH="getAttrList(),a" style="display:{a.hidden}">
<div><strong>{a.name}</strong></div>
<span class="{a.class}">{a.value:nl2br}</span>
</li>
{if:getAttributeGroup()}
</ul>
</li>
{end:}
then put the following code block in a new file
classes\XLite\Module\XC\CustomSkin\View\Product\De tails\Customer\Attributes.php
the code shown hides two of the attributes shown in my screenshots above
adjust the blue text values and number of if statements to match the name and number of attributes you want to hide
the two red statements are what I added to the original Attributes class
Code:
<?php
namespace XLite\Module\XC\CustomSkin\View\Product\Details\Customer;
function isHidden($a)
{
if($a=="Number of Designs")return("none");
if($a=="Number of Categories")return("none");
return "block";
}
abstract class Attributes extends \XLite\View\Product\Details\Customer\Attributes implements \XLite\Base\IDecorator
{
public function getAttrList()
{
if (!isset($this->attributes)) {
$this->attributes = array();
foreach ($this->getAttributesList() as $a) {
$value = $a->getAttributeValue($this->getProduct(), true);
$hidden = isHidden($a->getName());
if (is_array($value)) {
$value = implode($a::DELIMITER, $value);
}
if (
$value
&& (
$a::TYPE_CHECKBOX != $a->getType()
|| static::t('No') != $value
)
) {
$this->attributes[] = array(
'name' => $a->getName(),
'value' => htmlspecialchars($value),
'class' => $this->getFieldClass($a, $value),
'hidden' => $hidden
);
}
}
}
return $this->attributes;
}
}