diff --git a/app/Product.php b/app/Product.php index b85d0e3..2e05749 100644 --- a/app/Product.php +++ b/app/Product.php @@ -10,8 +10,7 @@ class Product extends Model public function getPrice($type = 'cash') { - // TODO: if there is no credit_price then return cash_price - if ($type == 'credit') { + if ($type == 'credit' && $this->credit_price) { return $this->credit_price; } diff --git a/resources/views/cart/partials/product-search-box.blade.php b/resources/views/cart/partials/product-search-box.blade.php index 912bd7e..9d6c39e 100644 --- a/resources/views/cart/partials/product-search-box.blade.php +++ b/resources/views/cart/partials/product-search-box.blade.php @@ -4,7 +4,7 @@ - Refresh + {{ link_to_route('cart.show', 'Bersihkan Pencarian', [$draft->draftKey], ['class' => 'btn btn-sm']) }} @includeWhen ($queriedProducts, 'cart.partials.product-search-result-box') diff --git a/resources/views/cart/partials/product-search-result-box.blade.php b/resources/views/cart/partials/product-search-result-box.blade.php index e0754b0..6041773 100644 --- a/resources/views/cart/partials/product-search-result-box.blade.php +++ b/resources/views/cart/partials/product-search-result-box.blade.php @@ -13,7 +13,7 @@