cancel
Showing results for 
Search instead for 
Did you mean: 

Magento - How to print foreach values?

SOLVED

Magento - How to print foreach values?

Code :

 

<?php
    class Gta_MerchantNotification_Model_Observer
    {
        
        public function merchantremainder($Observer)
        {

            $order = $Observer->getEvent()->getOrder();
            $order_details = $order->getAllVisibleItems();
            
            foreach ($order_details as $list) {
                $incrementid = $list->getIncrementId();
                $sku = $list->getsku();
                $name = $list->getName();
                $price = $list->getPrice();              
            }
        	Mage::log($list,null,'merchant.log',true);
        }
}
?>

How to print value in Mage::log like, incrementid, sku, name, price

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Magento - How to print foreach values?

Hi @Aveeva 

try following code.

Mage::log("$incrementid.'-'.$sku .'-'.$name.'-'. $price", null, 'merchant.log', true);

 

---
Problem Solved Click Accept as Solution!:Magento Community India Forum

View solution in original post

2 REPLIES 2

Re: Magento - How to print foreach values?

Hi @Aveeva 

try following code.

Mage::log("$incrementid.'-'.$sku .'-'.$name.'-'. $price", null, 'merchant.log', true);

 

---
Problem Solved Click Accept as Solution!:Magento Community India Forum

Re: Magento - How to print foreach values?

@Mukesh Tiwari  How to send observer values via mail to example@gmail.com