Public Member Functions | |
setOrder (Mage_Sales_Model_Order $order) | |
setSource (Mage_Core_Model_Abstract $source) | |
setItem (Varien_Object $item) | |
setPdf (Mage_Sales_Model_Order_Pdf_Abstract $pdf) | |
setPage (Zend_Pdf_Page $page) | |
getOrder () | |
getSource () | |
getItem () | |
getPdf () | |
getPage () | |
draw () | |
getItemOptions () | |
getSku ($item) | |
Protected Member Functions | |
_formatOptionValue ($value) | |
_parseDescription () | |
_setFontRegular ($size=7) | |
_setFontBold ($size=7) | |
_setFontItalic ($size=7) | |
Protected Attributes | |
$_order | |
$_source | |
$_item | |
$_pdf | |
$_pdfPage |
Definition at line 35 of file Abstract.php.
_formatOptionValue | ( | $ | value | ) | [protected] |
Definition at line 208 of file Abstract.php.
00209 { 00210 $order = $this->getOrder(); 00211 00212 $resultValue = ''; 00213 if (is_array($value)) { 00214 if (isset($value['qty'])) { 00215 $resultValue .= sprintf('%d', $value['qty']) . ' x '; 00216 } 00217 00218 $resultValue .= $value['title']; 00219 00220 if (isset($value['price'])) { 00221 $resultValue .= " " . $order->formatPrice($value['price']); 00222 } 00223 return $resultValue; 00224 } else { 00225 return $value; 00226 } 00227 }
_parseDescription | ( | ) | [protected] |
Definition at line 229 of file Abstract.php.
00230 { 00231 $description = $this->getItem()->getDescription(); 00232 if (preg_match_all('/<li.*?>(.*?)<\/li>/i', $description, $matches)) { 00233 return $matches[1]; 00234 } 00235 00236 return array($description); 00237 }
_setFontBold | ( | $ | size = 7 |
) | [protected] |
Definition at line 262 of file Abstract.php.
00263 { 00264 $font = Zend_Pdf_Font::fontWithPath(Mage::getBaseDir() . '/lib/LinLibertineFont/LinLibertine_Bd-2.8.1.ttf'); 00265 $this->getPage()->setFont($font, $size); 00266 return $font; 00267 }
_setFontItalic | ( | $ | size = 7 |
) | [protected] |
Definition at line 269 of file Abstract.php.
00270 { 00271 $font = Zend_Pdf_Font::fontWithPath(Mage::getBaseDir() . '/lib/LinLibertineFont/LinLibertine_It-2.8.2.ttf'); 00272 $this->getPage()->setFont($font, $size); 00273 return $font; 00274 }
_setFontRegular | ( | $ | size = 7 |
) | [protected] |
Definition at line 255 of file Abstract.php.
00256 { 00257 $font = Zend_Pdf_Font::fontWithPath(Mage::getBaseDir() . '/lib/LinLibertineFont/LinLibertineC_Re-2.8.0.ttf'); 00258 $this->getPage()->setFont($font, $size); 00259 return $font; 00260 }
draw | ( | ) | [abstract] |
Draw item line
Reimplemented in Mage_Bundle_Model_Sales_Order_Pdf_Items_Creditmemo, Mage_Bundle_Model_Sales_Order_Pdf_Items_Invoice, Mage_Bundle_Model_Sales_Order_Pdf_Items_Shipment, Mage_Downloadable_Model_Sales_Order_Pdf_Items_Abstract, Mage_Downloadable_Model_Sales_Order_Pdf_Items_Creditmemo, Mage_Downloadable_Model_Sales_Order_Pdf_Items_Invoice, Mage_Sales_Model_Order_Pdf_Items_Creditmemo_Default, Mage_Sales_Model_Order_Pdf_Items_Creditmemo_Grouped, Mage_Sales_Model_Order_Pdf_Items_Invoice_Default, Mage_Sales_Model_Order_Pdf_Items_Invoice_Grouped, and Mage_Sales_Model_Order_Pdf_Items_Shipment_Default.
getItem | ( | ) |
Retrieve item object
Mage_Core_Exception |
Definition at line 166 of file Abstract.php.
00167 { 00168 if (is_null($this->_item)) { 00169 Mage::throwException(Mage::helper('sales')->__('Item object is not specified.')); 00170 } 00171 return $this->_item; 00172 }
getItemOptions | ( | ) |
Definition at line 239 of file Abstract.php.
00239 { 00240 $result = array(); 00241 if ($options = $this->getItem()->getOrderItem()->getProductOptions()) { 00242 if (isset($options['options'])) { 00243 $result = array_merge($result, $options['options']); 00244 } 00245 if (isset($options['additional_options'])) { 00246 $result = array_merge($result, $options['additional_options']); 00247 } 00248 if (isset($options['attributes_info'])) { 00249 $result = array_merge($result, $options['attributes_info']); 00250 } 00251 } 00252 return $result; 00253 }
getOrder | ( | ) |
Retrieve order object
Mage_Core_Exception |
Definition at line 138 of file Abstract.php.
00139 { 00140 if (is_null($this->_order)) { 00141 Mage::throwException(Mage::helper('sales')->__('Order object is not specified.')); 00142 } 00143 return $this->_order; 00144 }
getPage | ( | ) |
Retrieve Pdf page object
Mage_Core_Exception |
Definition at line 194 of file Abstract.php.
00195 { 00196 if (is_null($this->_pdfPage)) { 00197 Mage::throwException(Mage::helper('sales')->__('PDF page object is not specified.')); 00198 } 00199 return $this->_pdfPage; 00200 }
getPdf | ( | ) |
Retrieve Pdf model
Mage_Core_Exception |
Definition at line 180 of file Abstract.php.
00181 { 00182 if (is_null($this->_pdf)) { 00183 Mage::throwException(Mage::helper('sales')->__('PDF object is not specified.')); 00184 } 00185 return $this->_pdf; 00186 }
getSku | ( | $ | item | ) |
Definition at line 276 of file Abstract.php.
00277 { 00278 if ($item->getOrderItem()->getProductOptionByCode('simple_sku')) 00279 return $item->getOrderItem()->getProductOptionByCode('simple_sku'); 00280 else 00281 return $item->getSku(); 00282 }
getSource | ( | ) |
Retrieve source object
Mage_Core_Exception |
Definition at line 152 of file Abstract.php.
00153 { 00154 if (is_null($this->_source)) { 00155 Mage::throwException(Mage::helper('sales')->__('Source object is not specified.')); 00156 } 00157 return $this->_source; 00158 }
setItem | ( | Varien_Object $ | item | ) |
setOrder | ( | Mage_Sales_Model_Order $ | order | ) |
Set order model
Mage_Sales_Model_Order | $order |
Definition at line 78 of file Abstract.php.
setPage | ( | Zend_Pdf_Page $ | page | ) |
setPdf | ( | Mage_Sales_Model_Order_Pdf_Abstract $ | ) |
Set Pdf model
Mage_Sales_Model_Order_Pdf_Abstract |
Definition at line 114 of file Abstract.php.
setSource | ( | Mage_Core_Model_Abstract $ | source | ) |
Set Source model
Mage_Core_Model_Abstract | $source |
Definition at line 90 of file Abstract.php.
$_item [protected] |
Definition at line 56 of file Abstract.php.
$_order [protected] |
Definition at line 42 of file Abstract.php.
$_pdf [protected] |
Definition at line 63 of file Abstract.php.
$_pdfPage [protected] |
Definition at line 70 of file Abstract.php.
$_source [protected] |
Definition at line 49 of file Abstract.php.