Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require("app/bootstrap.php");
- $bootstrap = MagentoFrameworkAppBootstrap::create(BP, $_SERVER);
- $obj = $bootstrap->getObjectManager();
- // Set the state (not sure if this is neccessary)
- $state = $obj->get('MagentoFrameworkAppState')->setAreaCode('frontend');
- // Get cart items
- $quote = $obj->get('MagentoCheckoutModelSession')->getQuote();
- $quoteItems = $quote->getAllVisibleItems();
- echo "Found " . count($quoteItems) . " cart items";
- // Expected output:
- // Found 3 cart items
- // Actual output:
- // Found 0 cart items
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement