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

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
 
Amasty
Mentor
 
Avatar
Total Posts:  3988
Joined:  2009-11-10
 
dzotik - 06 October 2011 08:58 PM

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.

Hello! You can also use a ready-made extension - Shipping Rules. Its features include:

- Modify shipping rates according to your business needs
- Shipping rules based on order and product attributes
- Modify rates both for the whole order and a single product
- Change shipping based on customer groups and store views
- Provide correct rates for LTL freights

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