Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Problème in Mage_Sales_Model_Quote_Address_Total_Shipping
 
hafsa_rani
Sr. Member
 
Avatar
Total Posts:  102
Joined:  2011-02-04
 

Hello every body; and sorry again and again for my bad laguage;
i have tried to update the grand total in shopping cart,
what i did is adding this code :

//the condition is to discount the price of the gift from grand total; it works when the gift product is alone in the shopping cart but when i add an other product to the shopping cart that condition doen’t aplly!!!!

$price$item->getProduct()->getPrice();
         
// $cat = Mage::getModel('catalog/category')->load((int)$current);
        
        
foreach (( $item->getProduct()->getCategoryIds()) as $cat){    
        
if ($cat == 138)//Category gift

            
$address->setGrandTotal(($address->getGrandTotal()+ $address->getShippingAmount())-$price);
            
$address->setBaseGrandTotal(($address->getBaseGrandTotal() + $address->getBaseShippingAmount()-$price));
        
}
        
else
        

          $address
->setGrandTotal(($address->getGrandTotal()+ $address->getShippingAmount()));
          
$address->setBaseGrandTotal($address->getBaseGrandTotal() + $address->getBaseShippingAmount());
        
}  
          }
Thank you in advance.
eny help will be appriciated.
 
Magento Community Magento Community
Magento Community
Magento Community
 
hafsa_rani
Sr. Member
 
Avatar
Total Posts:  102
Joined:  2011-02-04
 

hello enybody there??
i’m tring to post my issues in this forum but no answers, I really need help.
and evy help will be apriciate it thank you in advance.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top