如何在 magento 中获取销售总额和订单号?
How to capture the total value of the sale and the order number in magento?
抱歉,我正在使用在线翻译。
我在 magento 的页面 (app/code/core/Mage/Checkout/Block/onepage/Success.php) 上使用以下脚本,该脚本正常工作以捕获样本值 (27.99) 和(我的产品描述)。我如何才能获取销售的全部价值和订单号?
<?php
$sale_amount = '27.99';
$product = 'My Product Description';
include('afiliados/controller/record-sale.php');
?>
有人可以帮助我吗?
谢谢。
您可能正在寻找这样的东西:
$orderId = Mage::getSingleton('checkout/session')->getLastRealOrderId();
$order = Mage::getModel('sales/order')->load($orderId);
echo $order->getGrandTotal();
抱歉,我正在使用在线翻译。
我在 magento 的页面 (app/code/core/Mage/Checkout/Block/onepage/Success.php) 上使用以下脚本,该脚本正常工作以捕获样本值 (27.99) 和(我的产品描述)。我如何才能获取销售的全部价值和订单号?
<?php
$sale_amount = '27.99';
$product = 'My Product Description';
include('afiliados/controller/record-sale.php');
?>
有人可以帮助我吗?
谢谢。
您可能正在寻找这样的东西:
$orderId = Mage::getSingleton('checkout/session')->getLastRealOrderId();
$order = Mage::getModel('sales/order')->load($orderId);
echo $order->getGrandTotal();