Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
iamgergo committed Feb 14, 2024
1 parent 44eda69 commit 630f95a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/Fields/Items.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
use Closure;
use Cone\Bazar\Models\Product;
use Cone\Bazar\Models\Variant;
use Cone\Bazar\Support\Currency;
use Cone\Root\Fields\MorphMany;
use Cone\Root\Fields\MorphTo;
use Cone\Root\Fields\Number;
use Cone\Root\Fields\Text;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Http\Request;
use Illuminate\Support\Number as NumberFormatter;

class Items extends MorphMany
{
Expand Down Expand Up @@ -61,14 +61,14 @@ public function fields(Request $request): array
->min(0)
->required()
->format(static function (Request $request, Model $model, ?float $value): string {
return NumberFormatter::currency($value, $model->itemable->currency);
return (new Currency($value, $model->itemable->currency))->format();
}),

Number::make(__('TAX'), 'tax')
->min(0)
->required()
->format(static function (Request $request, Model $model, ?float $value): string {
return NumberFormatter::currency($value, $model->itemable->currency);
return (new Currency($value, $model->itemable->currency))->format();
}),

Number::make(__('Quantity'), 'quantity')
Expand Down
3 changes: 0 additions & 3 deletions src/Fields/Variants.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,10 @@

use Closure;
use Cone\Bazar\Bazar;
use Cone\Bazar\Fields\Price;
use Cone\Bazar\Models\Variant;
use Cone\Root\Fields\Editor;
use Cone\Root\Fields\HasMany;
use Cone\Root\Fields\ID;
use Cone\Root\Fields\Text;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Http\Request;

class Variants extends HasMany
Expand Down

0 comments on commit 630f95a

Please sign in to comment.