2

I need to display the prices of the purchased products on the packing slip. I managed to display it for bundle products, but for the simple products it's always showing $0,00.

I was trying to do the same as in the onvoice pdf, cause there it works. So I was using the same call as in \app\code\core\Mage\Sales\Model\Order\Pdf\Items\Invoice\Default.php where it says :

    // draw item Prices
    $i = 0;
    $prices = $this->getItemPricesForDisplay();
    foreach ($prices as $priceData){           

        /* draw Subtotal */
        $lines[$i][] = array(
            'text'  => $priceData['subtotal'],
            'feed'  => 520,                
            'align' => 'right'
        );
        $i++;
    }

The getItemPricesForDisplay()function is defined within app\code\core\Mage\Sales\Model\Order\Pdf\Items\Abstract.php. So I used the same code for getting the prices in the app\code\core\Mage\Sales\Model\Order\Pdf\Items\Shipment\Default.php but it's always returning 0,00.

Why is that? Do I have to change something or do it completely different to get the price of that product in the packing slip?

1 Answer 1

2

Try adding

$this->insertTotals($page, $order);

directly after

/* Draw item */
            $this->_drawItem($item, $page, $order);
            $page = end($pdf->pages);
        }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.