Magento Forum

   
Calculate shipping per total cost of items in shopping cart
 
dzotik
Jr. Member
 
Total Posts:  2
Joined:  2011-10-05
 

Hello, I am sure this is simpe question:

I am looking for magento to calculate shipping cost per total $ of items.

If I make purchase for $0- $50 then shipping is $5.00

If my shopping cart total purchase $50-$100, then shipping $3.00

How to set tis up and what are the steps.

Thank you.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Black Hacker
Jr. Member
 
Total Posts:  12
Joined:  2010-03-03
 

Create new module or Override Carrier Model.
Add code like that:

$totals =  Mage::getSingleton('checkout/cart')->getQuote()->getTotals();
$totalPrice $totals["subtotal"]->getValue();
if (
$totalPrice >= 4000{
                    $method 
Mage::getModel('shipping/rate_result_method');
                    
$method->setCarrier($this->_code);
                    
$method->setMethod('atmarkcafe_customrate_three');
                    
$method->setCarrierTitle($this->getConfigData('title'));
                    
$method->setMethodTitle($this->getConfigData('parcel_name'));
                    
$method->setPrice(0);
                    
$method->setCost(2);
                    
$result->append($method);

                
else if ($totalPrice 4000{
                    $method 
Mage::getModel('shipping/rate_result_method');
                    
$method->setCarrier($this->_code);
                    
$method->setMethod('atmarkcafe_customrate_three');
                    
$method->setCarrierTitle($this->getConfigData('title'));
                    
$method->setMethodTitle($this->getConfigData('parcel_name'));
                    
$method->setPrice($this->getConfigData('parcel_price'));
                    
$method->setCost($this->getConfigData('parcel_price'));
                    
//$method->setPrice(500);
                    //$method->setCost(2);
                    
$result->append($method);
                
}
}

Hope this help smile

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