Skip to content

Instantly share code, notes, and snippets.

@deniscsz
Created October 9, 2012 13:42
Show Gist options
  • Save deniscsz/3858885 to your computer and use it in GitHub Desktop.
Save deniscsz/3858885 to your computer and use it in GitHub Desktop.
Calculando que todos os produtos tem apenas UM custo de envio.
/**
* calculates total value from quote
*
* @return int|float
*/
public function getShippingPrice() {
/**
* get quote items
*/
$items = Mage::getSingleton('checkout/cart')->getItems();
$sumMax = 0;
if($items){
foreach ($items as $item){
/**
* calculate price by items
*/
$priceByItem = $this->calculate($item);
if($sumMax < $priceByItem) {
$sumMax = $priceByItem;
}
}
}
return $sumMax;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment