Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8129345
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T08:16:45+00:00 2026-06-06T08:16:45+00:00

This might get a little confusing as I have tried everything to make this

  • 0

This might get a little confusing as I have tried everything to make this work. All I want is a link in my brand site (domain.com) which shows the qty in my magento 1.5.1 cart (domain.com/shop) I quite easily pulled in product data and navigation blocks but no matter what I do, cart qty is always 0 from outside magento.
The main way I tried was just in my brand site to go:

    require_once $_SERVER['DOCUMENT_ROOT'].'/shop/app/Mage.php';
    umask(0);
    Mage::app();        
    Mage::getSingleton('core/session', array('name'=>'frontend'));
    // trying everything 
    Mage::getSingleton('checkout/cart')->getItemsCount(); // returns 0
    Mage::helper('checkout/cart')->getItemsCount(); // returns 0
    Mage::getSingleton('customer/session')->isLoggedIn(); // returns blank
    Mage::helper('checkout/cart')->getCart()->getItemsCount(); // returns 0
    Mage::helper('checkout/cart')->getCart()->getQuote()->getItemsCount(); // returns blank

Then, when none of those worked, I created a template in Magento just to give me the cart qty as a block which returns the block fine but still zero in the cart!

    $block = $this->layout->createBlock('core/template');
    $block->setTemplate('page/html/cartForBrand.phtml');
    return $block->renderView();

and the block in magento is simply

    Mage::getSingleton('core/session', array('name'=>'frontend'));
    $cart = Mage::getModel('checkout/cart')->getQuote()->getData()['items_qty'];

I’ve seen a lot of people having similar issues: / session_cookie_management, .domain.com cookie_domain(even though that’s subdomain specific), I’ve read and tried everything I could find for 2 days. Constantly deleting session and cache directories and clearing cache and cookies with magento caching disabled.

This is the first question I’ve posted on this site after using it for years, I’ve been stuck on this for 3 days! Pulling my hair out!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T08:16:46+00:00Added an answer on June 6, 2026 at 8:16 am

    If all you want is the qty why instantiate magento at all. Just set a client side cookie (ie cart_qty) and then read this cookie on your main site header.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay, the post title might be a little confusing. I have this code: class
This might get a little convoluted so please let me know if you need
This might be a little subjective, but I'd like to get your input on
This might be a little odd, but how can I get the column name
I expect this might get some downvotes / closevotes but I'm going to ask
This might sound daft but how do you get silverlight to run as a
This might seam like a strange question but.... public string MyProperty { get {
This might be a little bit odd question, but Im trying to figure out
i need to get this little gray rectangle (red circle) to be displayed both
Our team at work has enthusiastically adopted a rebase workflow, but we might have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.