Scenario of disable sale/purchase price done

This commit is contained in:
Cihan Şentürk
2022-12-19 12:22:59 +03:00
committed by GitHub
parent a9703e45ca
commit afb1a9fadb
3 changed files with 8 additions and 2 deletions

View File

@ -39,9 +39,10 @@ class ItemButton extends Component
*/
public function render()
{
$items = Item::enabled()->orderBy('name')->take(setting('default.select_limit'))->get();
$price_type = $this->getPriceType($this->type, $this->isSale, $this->isPurchase);
$items = Item::priceType($price_type)->enabled()->orderBy('name')->take(setting('default.select_limit'))->get();
foreach ($items as $item) {
$price = $item->{$price_type . '_price'};