2013-04-25 44 views
4

我試圖從總金額中扣除稅額或僅獲得小額金額,因此我可以將其置於會員鏈接中,但我無法在客戶點擊地點訂單按鈕後,在最後一個謝謝頁面中獲取稅額或裸計小計。我試圖在magento的謝謝頁面中獲得稅額

<?php echo $_product->getData('tax_amount'); ?> 

$totalItemsInCart = Mage::helper('checkout/cart')->getItemsCount(); //total items in cart 
$totals = Mage::getSingleton('checkout/session')->getQuote()->getTotals(); //Total object 
$subtotal = round($totals["subtotal"]->getValue()); //Subtotal value 
$grandtotal = round($totals["grand_total"]->getValue()); //Grandtotal value 


if(isset($totals['tax']) && $totals['tax']->getValue()) { 
    $tax = round($totals['tax']->getValue()); //Tax value if present 
} else { 
    $tax = ''; 
} 

echo $tax; 

,但沒有運氣,我不能讓稅額我只能獲得與稅額小計。所以,請任何幫助,將不勝感激

謝謝

回答

11
Mage::helper('checkout')->getQuote()->getShippingAddress()->getData('tax_amount') 

在這裏,你會得到你的稅額

相關問題