Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Magento Cart Variables for Tracking
 
kmgkid
Jr. Member
 
Total Posts:  6
Joined:  2009-07-02
 

Does anyone know Magento’s Cart variables?  I am trying to pass parameters them to singlefeed’s tracker. Below are singlefeeds variables that need to capture Magneto’s equivalent .

var order_id = “”;
var order_value = “”;
var total_units = “”;
var product_ids = “”;
var product_units = “”;

Thank you.

 
Magento Community Magento Community
Magento Community
Magento Community
 
sino
Member
 
Avatar
Total Posts:  34
Joined:  2008-04-22
 

Hello, did you happen to find out the answer to this?

 
Magento Community Magento Community
Magento Community
Magento Community
 
kmgkid
Jr. Member
 
Total Posts:  6
Joined:  2009-07-02
 

I got most of it.  You can decide if you want to track the sub total or total.  Here im just passing the subtotal to singlefeed.

This goes in your success.phtml

<?php 
//-------------------------------------------
// GET MAGENTO ORDER VALUES FOR TRACKING CODE
//-------------------------------------------
$order_details Mage::getModel('sales/order')->loadByIncrementId(Mage::getSingleton('checkout/session')->getLastRealOrderId());


$sale_subtotal number_format($order_details->subtotal,2); // GETS THE SUB TOTAL NOT INCLUDING TAX AND SHIPPING
$sale_grandtotal number_format($order_details->getGrandTotal(),2); // GETS THE GRAND TOTAL INCLUDING TAX AND SHIPPING
$sale_taxtotal number_format($order_details->getTaxAmount(),2); // GETS THE TAX TOTAL
$sale_shippingtotal number_format($order_details->getShippingAmount(),2); // GETS THE SHIPPING TOTAL
?>




<!--SINGLEFEED TRACKER-->
<
script type="text/javascript">
<!--
var 
order_id "<?php echo $this->getOrderId() ?>";
var 
order_value "<?php echo $sale_subtotal; ?>";
var 
total_units "";
var 
product_ids "";
var 
product_units "";
//-->
</script>
<script src="https://reporting.singlefeed.com/z/convert.pl?merchant_id=XXYOURACTXX" type="text/javascript" ></script>
<!--SINGLEFEED TRACKER END-->
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top