Magento Checkout成功页面产品价格和SKU检索 [英] Magento Checkout success page product price and SKU retrival
本文介绍了Magento Checkout成功页面产品价格和SKU检索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在我的客户站点上添加佣金结点,因为他们要求提供每种产品的SKU和价格.仅在确认页面/成功页面之后,我们需要传递这些值.但是,在这里我如何获得所有产品详细信息.包括sku,我需要通过的价格.有什么方法可以分别获取每个产品的详细信息.
I want to add Commission junction to my client site, in that they asked for each product sku's and price. After the confirmation page/ success page only we need to pass thes values. But here how i can get all the product details. Including sku, price i need to pass. Is there any way to get each product details separately.
谢谢 苏雷什(Suresh)
Thanks Suresh
推荐答案
是的,你说得对@leek
Yeah you are right @leek
但是,如果要使用CJ添加高级设置,请遵循此方法.
But if you want to add advanced setup with CJ then follow this method.
<!-- Start of CJ Integration Part -->
<?php
$_customerId = Mage::getSingleton('customer/session')->getCustomerId();
$lastOrderId = Mage::getSingleton('checkout/session')->getLastOrderId();
$order = Mage::getSingleton('sales/order');
$order->load($lastOrderId);
$_totalData =$order->getData();
$_sub = $_totalData['subtotal'];//USD ==> global_currency_code,base_currency_code order_currency_code
// Incase if it is simple do this ==> https://www.emjcd.com/u?AMOUNT= $_sub;
//print_r($order); print_r($_totalData);
$_order = $this->getOrder();
$allitems = $order->getAllItems();
$index = 1;
$cjData = "";//Needed format ==> &ITEM1=3214sku&AMT1=13.49&QTY1=1&ITEM2=6577sku&AMT2=7.99&QTY2=2&
foreach($allitems as $item)
{
$cjData.="&ITEM".$index."=".$item->getSku()."&AMT".$index."=".$item->getPrice()."&QTY".$index."=".$item->getQtyToShip();
$index++;
}
?>
<div style="display:none;">
<img src="https://www.emjcd.com/u?CID=id&OID=<?php echo $this->getOrderId(); ?>&TYPE=type<?php echo $cjData; ?>&CURRENCY=USD&METHOD=IMG" height="1" width="20">
</div>
<!-- End of CJ Integration Part -->
它工作得很好.
这篇关于Magento Checkout成功页面产品价格和SKU检索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文