Public Member Functions | |
__construct () | |
getStateDefaultStatus ($state) | |
getStatusLabel ($status) | |
getStatuses () | |
getStateStatuses ($state, $addLabels=true) | |
getVisibleOnFrontStates () | |
getInvisibleOnFrontStates () | |
Protected Member Functions | |
_getStatus ($status) | |
_getState ($state) |
Definition at line 34 of file Config.php.
__construct | ( | ) |
Definition at line 38 of file Config.php.
00039 { 00040 parent::__construct(Mage::getConfig()->getNode('global/sales/order')); 00041 }
_getState | ( | $ | state | ) | [protected] |
Definition at line 48 of file Config.php.
00049 { 00050 return $this->getNode('states/'.$state); 00051 }
_getStatus | ( | $ | status | ) | [protected] |
Definition at line 43 of file Config.php.
00044 { 00045 return $this->getNode('statuses/'.$status); 00046 }
getInvisibleOnFrontStates | ( | ) |
getStateDefaultStatus | ( | $ | state | ) |
Retrieve default status for state
string | $state |
Definition at line 59 of file Config.php.
00060 { 00061 $status = false; 00062 if ($stateNode = $this->_getState($state)) { 00063 if ($stateNode->statuses) { 00064 foreach ($stateNode->statuses->children() as $statusNode) { 00065 if (!$status) { 00066 $status = $statusNode->getName(); 00067 } 00068 $attributes = $statusNode->attributes(); 00069 if (isset($attributes['default'])) { 00070 $status = $statusNode->getName(); 00071 } 00072 } 00073 } 00074 } 00075 return $status; 00076 }
getStateStatuses | ( | $ | state, | |
$ | addLabels = true | |||
) |
Retrieve statuses available for state Get all possible statuses, or for specified state, or specified states array Add labels by default. Return plain array of statuses, if no labels.
mixed | $state | |
bool | $addLabels |
Definition at line 117 of file Config.php.
00118 { 00119 $statuses = array(); 00120 if (empty($state) || !is_array($state)) { 00121 $state = array($state); 00122 } 00123 foreach ($state as $_state) { 00124 if ($stateNode = $this->_getState($_state)) { 00125 foreach ($stateNode->statuses->children() as $statusNode) { 00126 $status = $statusNode->getName(); 00127 if ($addLabels) { 00128 $statuses[$status] = $this->getStatusLabel($status); 00129 } 00130 else { 00131 $statuses[] = $status; 00132 } 00133 } 00134 } 00135 } 00136 return $statuses; 00137 }
getStatuses | ( | ) |
Retrieve all statuses
Definition at line 98 of file Config.php.
00099 { 00100 $statuses = array(); 00101 foreach ($this->getNode('statuses')->children() as $status) { 00102 $label = (string) $status->label; 00103 $statuses[$status->getName()] = Mage::helper('sales')->__($label); 00104 } 00105 return $statuses; 00106 }
getStatusLabel | ( | $ | status | ) |
Retrieve status label
string | $status |
Definition at line 84 of file Config.php.
00085 { 00086 if ($statusNode = $this->_getStatus($status)) { 00087 $status = (string) $statusNode->label; 00088 return Mage::helper('sales')->__($status); 00089 } 00090 return $status; 00091 }
getVisibleOnFrontStates | ( | ) |
Retrieve states which are visible on front end
Definition at line 144 of file Config.php.