1
0
Fork 0

fix bug for discount

main
A1Gard 1 year ago
parent 1b9fee8dca
commit f756f830f8

@ -270,6 +270,13 @@ class Product extends Model implements HasMedia
return $def; return $def;
} }
public function getOldPrice()
{
if ($this->getPurePrice() == 0) {
return __('Call us!');
}
return number_format($this->price) . ' ' . config('app.currency_type');
}
public function getPrice() public function getPrice()
{ {
if ($this->getPurePrice() == 0) { if ($this->getPurePrice() == 0) {
@ -290,7 +297,7 @@ class Product extends Model implements HasMedia
function hasDiscount() function hasDiscount()
{ {
return $this->discounts()->where('expire', '>', \DB::raw('NOW()'))->count() > 1; return $this->discounts()->where('expire', '>', \DB::raw('NOW()'))->count() > 0;
} }
public function isFav() public function isFav()

Loading…
Cancel
Save