Magento Checkout 成功页面产品价格和 SKU 检索 [英] Magento Checkout success page product price and SKU retrival

查看:22
本文介绍了Magento Checkout 成功页面产品价格和 SKU 检索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想向我的客户站点添加 Commission 连接点,因为他们询问了每个产品的 sku 和价格.在确认页面/成功页面之后,我们只需要传递这些值.但在这里我如何获得所有产品详细信息.包括 sku,我需要传递的价格.有没有办法分别获取每个产品的详细信息.

谢谢苏雷什

解决方案

没错@leek

但是如果您想使用 CJ 添加高级设置,请遵循此方法.

<?php$_customerId = Mage::getSingleton('customer/session')->getCustomerId();$lastOrderId = Mage::getSingleton('checkout/session')->getLastOrderId();$order = Mage::getSingleton('销售/订单');$order->load($lastOrderId);$_totalData =$order->getData();$_sub = $_totalData['subtotal'];//USD ==>global_currency_code,base_currency_code order_currency_code//如果它很简单,请执行此操作 ==>https://www.emjcd.com/u?AMOUNT= $_sub;//print_r($order);打印_r($_totalData);$_order = $this->getOrder();$allitems = $order->getAllItems();$index = 1;$cjData = "";//需要的格式==>&ITEM1=3214sku&AMT1=13.49&QTY1=1&ITEM2=6577sku&AMT2=7.99&QTY2=2&foreach($allitems 作为 $item){$cjData.="&ITEM".$index."=".$item->getSku()."&AMT".$index."=".$item->getPrice()."&;QTY".$index."=".$item->getQtyToShip();$索引++;}?><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">

<!-- CJ集成部分结束-->

效果很好.

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.

Thanks Suresh

解决方案

Yeah you are right @leek

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 -->

Its worked perfectly.

这篇关于Magento Checkout 成功页面产品价格和 SKU 检索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆