I wish to modify the shipping cost Double if they add more than 5 items at the cart.
class ChangeShipping_MyCarrier_Model_Carrier extends
Mage_Shipping_Model_Carrier_Abstract implements
Mage_Shipping_Model_Carrier_Interface
{
protected function _getStandardShippingRate()
{
$rate = Mage::getModel('shipping/rate_result_method');
$rate->setCarrier($this->_code);
$rate->setCarrierTitle($this->getConfigData('title'));
$rate->setMethod('standand');
$rate->setMethodTitle('Standard');
$items_count = Mage::helper('checkout/cart')->getItemsCount();
if ($items_count > 6) {
$rate->setPrice(19.99);
} else {
$rate->setPrice(9.99);
}
$rate->setCost(0);
return $rate;
}
}
This function executes flawless without IF condition but shows error then.