示例#1
0
 /**
  * Prepare multiselect attribute value
  *
  * Backward compatibility with versions < 1.13.0.0
  *
  * @param mixed $value
  * @param Varien_Object $object
  * @return mixed
  */
 protected function _prepareMultiselectValue($value, $object)
 {
     // just use the parent in case the method change in future versions
     if (method_exists(get_parent_class($this), '_prepareMultiselectValue')) {
         return parent::_prepareMultiselectValue($value, $object);
     }
     // reproduce functionality from 1.13
     $attribute = $object->getResource()->getAttribute($this->getAttribute());
     if ($attribute && $attribute->getFrontendInput() == 'multiselect') {
         $value = strlen($value) ? explode(',', $value) : array();
     }
     return $value;
 }