0

I am using this code to display full tax info in PDF totals:

public function getTotalsForDisplay()
{
    $store = $this->getOrder()->getStore();
    $config= Mage::getSingleton('tax/config');
    if ($config->displaySalesTaxWithGrandTotal($store)) {
        return array();
    }

    $fontSize = $this->getFontSize() ? $this->getFontSize() : 7;
    $_fullInfo = $this->getOrder()->getFullTaxInfo();
    $total = array();

    $amount = $this->getOrder()->formatPriceTxt($this->getAmount());
    $label = 'gesetzliche MwSt:';
    $total[] = array(
        'amount'    => $amount,
        'label'     => $label,
        'font_size' => $fontSize
    );
    foreach ($_fullInfo as $info) {
        $percent    = $info['percent'];
        $amount     = $info['amount'];
        $rates      = $info['rates'];
        $total[] = array(
           'amount'    => $this->getOrder()->formatPriceTxt($amount),
           'label'     => $rates[0]['title'].' ',
           'font_size' => $fontSize-1
       );
    }


    return $total;

While this is working fine, it will output the tax rate title as label while I need to output the rate with added % instead. How do I need to modify 'label' => $rates[0]['title'].' ', to output the rate instead of the title?

1 Answer 1

0

Facepalm Well that was easy

$rates[0]['percent'].'%',

I am certain I tried this earlier though and it wouldn't work...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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