Public Member Functions | |
getItem () | |
getDefaultSender () | |
getDefaultRecipient () | |
getFieldName ($name) | |
getFieldId ($id) | |
getFieldIdPrefix () | |
getMessage () | |
getSaveUrl () | |
getHtmlId () | |
canDisplayContainer () | |
canDisplayGiftmessage () | |
Protected Member Functions | |
_initMessage () | |
Protected Attributes | |
$_giftMessage = array() |
Definition at line 34 of file Default.php.
_initMessage | ( | ) | [protected] |
Initialize gift message for entity
Definition at line 131 of file Default.php.
00132 { 00133 $this->_giftMessage[$this->getItem()->getGiftMessageId()] = 00134 $this->helper('giftmessage/message')->getGiftMessage($this->getItem()->getGiftMessageId()); 00135 00136 // init default values for giftmessage form 00137 if(!$this->getMessage()->getSender()) { 00138 $this->getMessage()->setSender($this->getDefaultSender()); 00139 } 00140 if(!$this->getMessage()->getRecipient()) { 00141 $this->getMessage()->setRecipient($this->getDefaultRecipient()); 00142 } 00143 00144 return $this; 00145 }
canDisplayContainer | ( | ) |
Indicate that block can display container
Definition at line 190 of file Default.php.
00191 { 00192 return $this->getRequest()->getParam('reload')!=1; 00193 }
canDisplayGiftmessage | ( | ) |
getDefaultRecipient | ( | ) |
Retrive default value for giftmessage recipient
Definition at line 71 of file Default.php.
00072 { 00073 if(!$this->getItem()) { 00074 return ''; 00075 } 00076 00077 if($this->getItem()->getOrder()) { 00078 if ($this->getItem()->getOrder()->getShippingAddress()) { 00079 return $this->getItem()->getOrder()->getShippingAddress()->getName(); 00080 } else if ($this->getItem()->getOrder()->getBillingAddress()) { 00081 return $this->getItem()->getOrder()->getBillingAddress()->getName(); 00082 } 00083 } 00084 00085 if ($this->getItem()->getShippingAddress()) { 00086 return $this->getItem()->getShippingAddress()->getName(); 00087 } else if ($this->getItem()->getBillingAddress()) { 00088 return $this->getItem()->getBillingAddress()->getName(); 00089 } 00090 00091 return ''; 00092 }
getDefaultSender | ( | ) |
Retrive default value for giftmessage sender
Definition at line 53 of file Default.php.
00054 { 00055 if(!$this->getItem()) { 00056 return ''; 00057 } 00058 00059 if($this->getItem()->getOrder()) { 00060 return $this->getItem()->getOrder()->getBillingAddress()->getName(); 00061 } 00062 00063 return $this->getItem()->getBillingAddress()->getName(); 00064 }
getFieldId | ( | $ | id | ) |
Retrive real html id for field
string | $name |
Definition at line 111 of file Default.php.
00112 { 00113 return $this->getFieldIdPrefix() . $id; 00114 }
getFieldIdPrefix | ( | ) |
Retrive field html id prefix
Definition at line 121 of file Default.php.
00122 { 00123 return 'giftmessage_item_' . $this->getItem()->getId() . '_'; 00124 }
getFieldName | ( | $ | name | ) |
Retrive real name for field
string | $name |
Definition at line 100 of file Default.php.
00101 { 00102 return 'giftmessage[' . $this->getItem()->getId() . '][' . $name . ']'; 00103 }
getHtmlId | ( | ) |
Retrive block html id
Definition at line 180 of file Default.php.
00181 { 00182 return substr($this->getFieldIdPrefix(), 0, -1); 00183 }
getItem | ( | ) |
getMessage | ( | ) |
Retrive gift message for entity
Definition at line 152 of file Default.php.
00153 { 00154 if(!isset($this->_giftMessage[$this->getItem()->getGiftMessageId()])) { 00155 $this->_initMessage(); 00156 } 00157 00158 return $this->_giftMessage[$this->getItem()->getGiftMessageId()]; 00159 }
getSaveUrl | ( | ) |
$_giftMessage = array() [protected] |
Definition at line 46 of file Default.php.