Forums

Mage Enabler
[resolved] Same database? (2 posts)

  1. websitedesignby
    Member
    Posted 2 years ago #

    Do WordPress and Magento have to use the same database?

    I have mage-enabler successfully installed. I add an item to my shopping cart on the Magento site.

    When I run this code in WordPress

    $cart = Mage::helper('checkout/cart')->getCart()->getItemsCount();
                                echo "<pre>";
                                print_r($cart);
                                echo "<pre>";

    It returns 0

    Did not see anything in any of the instructions saying it has to use the same database but I am wondering if this is the reason.

  2. websitedesignby
    Member
    Posted 2 years ago #

    Never mind. I got it. Magento and WordPress do NOT have to be using the same database.

    My issue was I did not have

    if(class_exists('Mage')){
        Mage::getSingleton('core/session', array('name' => 'frontend'));
     }

    above get_header(); in my template file.

    Great plug-in. Thanks!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic