3

I have magento installation that contains 3 site. Now i want to get the cart total for each site and show in one place. Is there any way to get the cart total based on site ID or site code ?

2
  • cart total based on website id or store id ? Commented Mar 23, 2019 at 12:42
  • based on site id or site code.
    – Mehar
    Commented Mar 24, 2019 at 8:27

2 Answers 2

2
+50

Try This :-

$storeId = Mage::app()->getStore()->getStoreId;
$quote = Mage::getModel('sales/quote')->getCollection()->addFieldtoFilter('store_id', array('eq' => $storeId));

foreach ($quote as $quotes)
{
    $cartTotal = $quotes->getGrandTotal();
}
1
  • Thnkx buddy :).. Commented Apr 1, 2019 at 18:24
1

Try below way..

    $storeId = Mage::app()->getStore()->getStoreId;
    $quote_collection = Mage::getResourceModel('sales/quote_collection')->setStoreId($storeId);
     foreach ($quote_collection as $quote) {
        $cartTotal = $quote->getGrandTotal();
     } 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.