cancel
Showing results for 
Search instead for 
Did you mean: 

PHP CODE in Magento extension einbinden zur Barcode Generierung auf pdf Rechnung

PHP CODE in Magento extension einbinden zur Barcode Generierung auf pdf Rechnung

Hallo Zusammen , 

 

ich nutze eine Extension zur Erstellung der PDF Rechnungen. Nun benötige ich einen Barcode auf der PDF Rechnung. Vom Support habe ich nur folgendes erhalten : 

 

---
$barcodeOptions = array('text' => $text);
$rendererOptions = array();

$renderer = Zend_Barcode::draw('code128', 'image', $barcodeOptions, $rendererOptions);

$outputFilename = Mage::getBaseDir('tmp') . DS . 'barcode_' . $text . '.png';
@imagepng($renderer, $outputFilename);

echo sprintf('<img src="%s" />', $outputFilename);
---

 

Wer kann mir sagen, was an diesem Code noch hinzugefügt werden muss, und wo das in dieser Datei rein muss : 

 

<!-- Header and footer blocks have to be at the beginning of the file and must be a direct descendant of the body element to work properly. -->
<?php echo $this->getChildHtml('header'); ?>
<?php echo $this->getChildHtml('footer'); ?>

<table id="addressWindow">
<tr>
<td>
<div id="senderAddress"><?php echo $this->getSenderAddress(); ?></div>
<div id="billingAddress">
<?php echo $this->getBillingAddress(); ?>
</div>
</td>
<?php if ($this->isShowShippingAddress() === true): ?>
<td>
<div id="shippingAddress">
<?php echo $this->getShippingAddress(); ?>
</div>
</td>
<?php endif; ?>
</tr>
</table>

<?php if ($this->getCustomerTaxVatNumber()): ?>
<div id="customerTaxVatNumber"><?php echo $this->__('TAX/VAT Number: %s', $this->getCustomerTaxVatNumber()); ?></div>
<?php endif; ?>

<div id="invoiceTitle">
<?php echo $this->__('Invoice #%s', $this->getSource()->getIncrementId()); ?>
</div>

<div id="invoiceData">
<div id="invoiceDate"><?php echo $this->__('Invoice Date: %s', $this->getSourceDate()); ?></div>
<div id="orderNumber"><?php echo $this->__('Order No.: %s', $this->getOrder()->getIncrementId()); ?></div>
<div id="orderDate"><?php echo $this->__('Order Date: %s', $this->getOrderDate()); ?></div>
<?php if ($this->getCustomerId()): ?>
<div id="customerNumber"><?php echo $this->__('Customer No.: %s', $this->getCustomerId()); ?></div>
<?php endif; ?>
</div>

<table id="paymentAndShippingData" cellpadding="0" cellspacing="0">
<tr>
<td id="paymentMethodData">
<div class="methodTitle"><?php echo $this->__('Payment Method'); ?></div>
<div class="methodText"><?php echo $this->getPaymentMethodText(); ?></div>
</td>
<td id="shippingMethodData">
<?php if ($this->getOrder()->getShippingDescription()): ?>
<div class="methodTitle"><?php echo $this->__('Shipping Method'); ?></div>
<div class="methodText"><p><?php echo $this->getOrder()->getShippingDescription(); ?></p></div>
<?php endif; ?>
</td>
</tr>
</table>

<?php if ($this->getSalutationText()): ?>
<p>
<?php echo $this->getSalutationText(); ?>
</p>
<?php endif; ?>

<table id="itemTable">
<thead>
<tr>
<th class="columnSku"><?php echo $this->__('SKU'); ?></th>
<th class="columnName"><?php echo $this->__('Product Name'); ?></th>
<th class="columnQty"><?php echo $this->__('Qty'); ?></th>
<th class="columnPrice"><?php echo $this->__('Price'); ?></th>
<?php if ($this->isShowTaxes()): ?>
<th class="columnTaxPercent"><nobr><?php echo $this->__('Tax (%)'); ?></nobr></th>
<?php endif; ?>
<th class="columnRowTotal"><?php echo $this->__('Row Total'); ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($this->getItems() as $sourceItem): ?>
<?php echo $this->getItemHtml($sourceItem); ?>
<?php endforeach; ?>
</tbody>
</table>
<?php echo $this->getChildHtml('totals'); ?>

<?php foreach ($this->getCrosssellProducts() as $product): ?>
<?php echo $this->getCrosssellItemHtml($product); ?>
<?php break; ?>
<?php endforeach; ?>

<?php if ($this->getCouponCode()): ?>
<p id="couponBox"><b><?php echo $this->__('Used coupon code: %s', $this->getCouponCode()); ?></b></p>
<?php endif; ?>

<?php if ($this->getBillsafeFreetext()): ?>
<p><?php echo $this->getBillsafeFreetext(); ?></p>
<?php endif; ?>

<?php if ($this->getGiftMessage()): ?>
<p>
<?php echo $this->__('Message from: %s', $this->getGiftMessage()->getSender()); ?><br />
<?php echo $this->__('Message to: %s', $this->getGiftMessage()->getRecipient()); ?><br />
<?php echo $this->getGiftMessage()->getMessage(); ?>
</p>
<?php endif; ?>

<!-- Show Checkout Attributes (if enabled) -->
<?php foreach ($this->getCheckoutAttributes() as $attribute): ?>
<?php echo $this->__('%s: %s', $attribute['label'], $attribute['value']); ?>
<?php endforeach; ?>

<!-- Show Customer Invoice Comments (if enabled) -->
<?php if ($this->isShowCustomerSourceComments()): ?>
<p>
<?php foreach ($this->getSource()->getCommentsCollection() as $comment): ?>
<?php echo $comment->getComment(); ?>
<?php endforeach; ?>
</p>
<?php endif; ?>

<!-- Show Customer Order Comments (if enabled) -->
<?php if ($this->isShowCustomerOrderComments()): ?>
<p>
<?php foreach ($this->getOrder()->getVisibleStatusHistory() as $comment): ?>
<?php echo $comment->getComment(); ?>
<?php endforeach; ?>
</p>
<!-- Support for OneStepCheckout Extension Comments -->
<?php if ($this->getOrder()->getOnestepcheckoutCustomercomment()): ?>
<?php echo $this->getOrder()->getOnestepcheckoutCustomercomment(); ?>
<?php endif; ?>
<?php endif; ?>

<?php if ($this->getCustomerGroupSpecificFreetext()): ?>
<p><?php echo $this->getCustomerGroupSpecificFreetext(); ?></p>
<?php endif; ?>

<?php if ($this->getConfiguredFreeTextWithPlaceholders()): ?>
<p><?php echo $this->getConfiguredFreeTextWithPlaceholders(); ?></p>
<?php endif; ?>

<?php echo $this->getFooterPageCountHtml(); ?>