Created
October 9, 2012 13:42
-
-
Save deniscsz/3858885 to your computer and use it in GitHub Desktop.
Calculando que todos os produtos tem apenas UM custo de envio.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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