如何捕获销售的总价值和magento的订单号?
问题描述:
Sorry, I'm using online translator.
I use the following script on the page (app/code/core/Mage/Checkout/Block/onepage/Success.php) in magento that is working normally capturing the sample values (27.99) and (My Product Description). How do I get it to capture the full value of the sale and the order number?
<?php
$sale_amount = '27.99';
$product = 'My Product Description';
include('afiliados/controller/record-sale.php');
?>
Can someone help me?
Thank you.
对不起,我正在使用在线翻译。 p>
我使用以下内容 magento中页面上的脚本(app / code / core / Mage / Checkout / Block / onepage / Success.php)正常工作,捕获样本值(27.99)和(我的产品描述)。 如何获取销售的全部价值和订单号? p>
&lt;?php
$ sale_amount = '27 .99';
$ product = '我的产品描述';
include('afiliados / controller / record-sale.php');
?&gt;
code> pre>
有人可以帮帮我吗? / p>
谢谢。 p>
div>
答
You're probably looking for something like this:
$orderId = Mage::getSingleton('checkout/session')->getLastRealOrderId();
$order = Mage::getModel('sales/order')->load($orderId);
echo $order->getGrandTotal();