public function getFormatedOptionValue($optionValue) { $helper = Mage::helper('flycart'); if ($helper->isActivated()) { if (!$helper->isOtherVersion(1, 5) && Mage::getStoreConfig('flycart/qtyupdate/cart_page') && (Mage::helper('flycart')->isCartPage() || Mage::helper('flycart')->isChangedAttributeCart() || Mage::helper('flycart')->isChangedQtyCart())) { $optionInfo = array(); if (is_array($optionValue)) { if (isset($optionValue['option_id'])) { $optionInfo = $optionValue; if (isset($optionInfo['value'])) { $optionValue = $optionInfo['value']; } } elseif (isset($optionValue['value'])) { $optionValue = $optionValue['value']; } } if (isset($optionInfo['custom_view']) && $optionInfo['custom_view']) { $_default = array('value' => $optionValue); if (isset($optionInfo['option_type'])) { try { $group = Mage::getModel('catalog/product_option')->groupFactory($optionInfo['option_type']); return array('value' => $group->getCustomizedView($optionInfo)); } catch (Exception $e) { return $_default; } } return $_default; } $result = array(); if (is_array($optionValue)) { $_truncatedValue = implode("\n", $optionValue); $_truncatedValue = nl2br($_truncatedValue); return array('value' => $_truncatedValue); } else { $_truncatedValue = nl2br($optionValue); } $result = array('value' => $_truncatedValue); return $result; } else { return parent::getFormatedOptionValue($optionValue); } } else { return parent::getFormatedOptionValue($optionValue); } }
public function getFormatedOptionValue($optionValue) { $helper = Mage::helper('adodis_ajaxcart'); if ($helper->isAjaxCartEnable()) { if (!$helper->getIsAnymoreVersion(1, 5) && Mage::getStoreConfig('adodis_ajaxcart/qty_settings/cart_page') && (Mage::helper('adodis_ajaxcart')->getIsCartPage() || Mage::helper('adodis_ajaxcart')->getChangeAttributeCart() || Mage::helper('adodis_ajaxcart')->getChangeQtyCart())) { $optionInfo = array(); // define input data format if (is_array($optionValue)) { if (isset($optionValue['option_id'])) { $optionInfo = $optionValue; if (isset($optionInfo['value'])) { $optionValue = $optionInfo['value']; } } elseif (isset($optionValue['value'])) { $optionValue = $optionValue['value']; } } // render customized option view if (isset($optionInfo['custom_view']) && $optionInfo['custom_view']) { $_default = array('value' => $optionValue); if (isset($optionInfo['option_type'])) { try { $group = Mage::getModel('catalog/product_option')->groupFactory($optionInfo['option_type']); return array('value' => $group->getCustomizedView($optionInfo)); } catch (Exception $e) { return $_default; } } return $_default; } // truncate standard view $result = array(); if (is_array($optionValue)) { $_truncatedValue = implode("\n", $optionValue); $_truncatedValue = nl2br($_truncatedValue); return array('value' => $_truncatedValue); } else { $_truncatedValue = nl2br($optionValue); } $result = array('value' => $_truncatedValue); return $result; } else { return parent::getFormatedOptionValue($optionValue); } } else { return parent::getFormatedOptionValue($optionValue); } }