Back to PhocacartAttribute class

Method getAttributeFullValues

public static
getAttributeFullValues
(mixed $attributes)

Method getAttributeFullValues - Source code

public static function getAttributeFullValues($attributes)
{
    $fullAttributes = array();
    if (!empty($attributes)) {
        foreach ($attributes as $k => $v) {
            $fullAttributes[$k] = new stdClass();
            // Could be set a function to get info about the attribute, for now not needed
            if (!empty($v)) {
                foreach ($v as $k2 => $v2) {
                    if ((int) $k > 0 && (int) $k2 > 0) {
                        $attrib = PhocacartAttribute::getAttributeValue((int) $k2, (int) $k);
                        $fullAttributes[$k]->options[$k2] = $attrib;
                    }
                }
            }
        }
    }
    return $fullAttributes;
}