Skip to content

Instantly share code, notes, and snippets.

@kanampalli
Created April 14, 2016 08:20
Show Gist options
  • Save kanampalli/d20dd29d42da50fd73378fd547fec87c to your computer and use it in GitHub Desktop.
Save kanampalli/d20dd29d42da50fd73378fd547fec87c to your computer and use it in GitHub Desktop.
/* Details of products and stores: */
<?php
/**
* @author MagePsycho <info@magepsycho.com>
* @website http://www.magepsycho.com
* @category using Header / Footer outside of Magento
*/
$mageFilename = '/var/www/html/magento1.9/app/Mage.php';
require_once $mageFilename;
umask(0);
Mage::app('default');
// This has to run to authenticate customer and checkout session calls.
Mage::getSingleton('core/session', array('himaja kanampalli' => 'frontend'));
// Get any customer model you desire.
$oSession = Mage::getSingleton( 'customer/session' );
$oCustomer = $oSession->getCustomer();
$oCheckout = Mage::getSingleton( 'checkout/session' );
$oQuote = $oCheckout->getQuote();
// var_dump( $oCustomer );
// var_dump( $oSession );
// var_dump( $oQuote );
// var_dump( $oCheckout );
$oCart = $oQuote->getAllItems();
if( !empty( $oCart ) )
{
foreach ( $oCart as $oItem )
{
$sName = $oItem->getProduct()->getName();
$fPrice = $oItem->getProduct()->getPrice();
var_dump( $sName );
var_dump( $fPrice );
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment