<input type="hidden" name="Tariff" value="<?php echo ceil($_order->getBaseGrandTotal() * 100); ?>">
Magento Get Order Total In Pence Request
Frage
I am integrating a custom payment gateway into magento.
I need to send the order total to them in pence, currently it is set to pounds.
My current code is below
<?php
$_order = new Mage_Sales_Model_Order();
$orderId = Mage::getSingleton('checkout/session')->getLastRealOrderId();
$_order->loadByIncrementId($orderId);
?>
<form name="mygatewayform" method="get" action="gateway url">
<input type="hidden" name="Tariff" value="<?php echo $_order->getBaseGrandTotal(); ?>">
</form>
This adds the total to the 'action' gateway URL as the Tariff but total is in pounds i.e. 1.50 but needs to be in pence 150.
Lösung
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow