Skip to content

Instantly share code, notes, and snippets.

@delineas delineas/product.php Secret

Created Sep 13, 2019
Embed
What would you like to do?
Reto Refactorización WRP 36
<?php
class Product {
// ... more code
function amount() {
$product_price = $this->quantity * $this->productPrice;
$discountRate = 1;
if($product_price > 1500) {
$discountRate = 0.7;
}
else {
$discountRate = 0.95;
}
return $product_price * $discountRate;
}
// ... more code
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.