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

Integration with Oracle UCM using AJAX
 
edlitmus
Jr. Member
 
Total Posts:  25
Joined:  2008-07-21
 

I’m working on integration of Oracle’s Universal Content Management system with Magento, using ajax to populate blocks from the store into pages served up by the UCM.

So far so good, it seems like it’s going to work out well, but I’d like to get someone to sanity check some things for me.

I currently have a php script in the magento directory that is acting as a dispatch for the ajax calls. One thing I need to be able to do is log a user into the store. Can someone let me know if this is the right way to do it?

<?php
require_once('/opt/local/apache2/htdocs/magento/app/Mage.php');
umask(0);

$session_id $_COOKIE['magento'];
session_id($session_id);

Mage::app('default');

$session Mage::getSingleton('customer/session');

if (isset(
$_REQUEST['cart'])) {
    cart
();
}
else if (isset($_REQUEST['price'])) {
    price
();
}
else if (isset($_REQUEST['login_status'])) {
    login_status
($session);
}
else if (isset($_REQUEST['login'])) {
    login
($_REQUEST$session);
    
sync_cart($session);
}

<snip...>

function 
login($args$session{
    
if (!$session->login($args['username']$args['password'])) {
        error_log
("can't log in!");
    
}
}

function sync_cart($session{
    $customer 
$session->getCustomer();
    
$cart Mage::getSingleton('checkout/cart');
    
$cart_session $cart->getCheckoutSession();
    
$cart_session->loadCustomerQuote();
    
$cart->updateItems();
}

?>

I guess I don’t need the customer object at all in the sync_cart function, but what about the rest? It seems to work okay, but is there anything I might be missing?

Any input is appreciated!

 
Magento Community Magento Community
Magento Community
Magento Community
 
edlitmus
Jr. Member
 
Total Posts:  25
Joined:  2008-07-21
 

$cart->updateItems();

That line doesn’t seem to be needed at all. And I didn’t need a customer object at all. I did have to add some session handling:

// try to restore session...
if (isset($_COOKIE['magento'])) {
    $session_id 
$_COOKIE['magento'];
    
session_id($session_id);
}
// or set up a new one...
else {
    session_name
('example.com');
    
session_start();
}

And now it works as expected using the proxy setup.

Any other insights? Anyone?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Bruno Sanos
Jr. Member
 
Total Posts:  9
Joined:  2008-05-10
 

Hello, could you tell me more how you’re doing this integration with the Oracle?

 
Magento Community Magento Community
Magento Community
Magento Community
 
patu7
Member
 
Total Posts:  64
Joined:  2011-09-12
 

HI,

if anybody knows how to integrate Magento with oracle…

plz guide me for d same…

Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top