Skip to content

Commit

Permalink
Merge pull request #250 from michaelscheel/development
Browse files Browse the repository at this point in the history
Added support for invoices with solely downloadable products
  • Loading branch information
Schrank committed Jun 29, 2015
2 parents 8e4a244 + 3611248 commit b257050
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
18 changes: 11 additions & 7 deletions src/app/code/community/FireGento/Pdf/Helper/Invoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,21 @@ class FireGento_Pdf_Helper_Invoice extends Mage_Core_Helper_Abstract
*/
public function getShippingCountryNotes(Mage_Sales_Model_Order $order)
{
$shippingCountryId = $order->getShippingAddress()->getCountryId();
$countryNotes = unserialize(Mage::getStoreConfig('sales_pdf/invoice/shipping_country_notes'));
if (!$order->getIsVirtual()) {
$shippingCountryId = $order->getShippingAddress()->getCountryId();
$countryNotes = unserialize(Mage::getStoreConfig('sales_pdf/invoice/shipping_country_notes'));

$shippingCountryNotes = array();
foreach ($countryNotes as $countryNote) {
if ($countryNote['country'] == $shippingCountryId) {
$shippingCountryNotes[] = $countryNote['note'];
$shippingCountryNotes = array();
foreach ($countryNotes as $countryNote) {
if ($countryNote['country'] == $shippingCountryId) {
$shippingCountryNotes[] = $countryNote['note'];
}
}

return $shippingCountryNotes;
}

return $shippingCountryNotes;
return array();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,8 @@ protected function insertHeader(&$page, $order, $document)
|| $mode == 'shipment'
&& Mage::getStoreConfig('sales_pdf/shipment/shipping_method_position')
== FireGento_Pdf_Model_System_Config_Source_Shipping::POSITION_HEADER);
if ($putShippingMethod) {

if ($putShippingMethod && $order->getIsNotVirtual()) {
$page->drawText(
Mage::helper('firegento_pdf')->__('Shipping method:'),
($this->margin['right'] - $labelRightOffset),
Expand Down

0 comments on commit b257050

Please sign in to comment.