added banning for when amount is under 0

This commit is contained in:
2026-07-20 21:29:30 +03:30
parent 5d98a6f041
commit 10a510529d
4 changed files with 48 additions and 0 deletions
@@ -421,6 +421,7 @@ class CartController extends Controller
}
app(ConfigService::class)->assertProductTradingOpen($product);
app(ConfigService::class)->assertMainGoldZeroBeforeOtherProductBuy($wallet_interface->wallet, $product);
$qty = (int) $item->quantity;
@@ -118,6 +118,8 @@ class SingleOrderController extends Controller
// Check if the user wants to buy
if ($data['direction'] == 1) {
$config->assertMainGoldZeroBeforeOtherProductBuy($wallet, $data['product']);
$data['service_charge_percentage'] = isset($data['fee_free']) && $data['fee_free'] === true ? 0 : ($data['product']['percent_fee_buy']) * $data['number'];
$data['price_original'] = $this->resolveProductUnitBasePrice($data['product']);
$this->applyCashPriceDiff($config, $data['product'], 1, $data, (float) $data['price_original']);