From 7670106ab1d023c02873cc6cc77b2e46967c6529 Mon Sep 17 00:00:00 2001 From: wychoong <67364036+wychoong@users.noreply.github.com> Date: Tue, 10 Sep 2024 18:45:01 +0800 Subject: [PATCH 01/35] Fix extended model morph map by checking parent class map (#1944) --- packages/core/src/Base/ModelManifest.php | 2 +- .../core/src/Base/Traits/HasModelExtending.php | 18 ++++++++++++++++++ packages/core/src/Facades/ModelManifest.php | 2 +- .../Unit/Base/Traits/HasModelExtendingTest.php | 13 +++++++++++++ 4 files changed, 33 insertions(+), 2 deletions(-) diff --git a/packages/core/src/Base/ModelManifest.php b/packages/core/src/Base/ModelManifest.php index 68999a9bcc..7ab6677be8 100644 --- a/packages/core/src/Base/ModelManifest.php +++ b/packages/core/src/Base/ModelManifest.php @@ -143,7 +143,7 @@ public function guessModelClass(string $modelContract): string return 'Lunar\\Models\\'.$shortName; } - public function isLunarModel(BaseModel $model): bool + public function isLunarModel(string|BaseModel $model): bool { $class = (new \ReflectionClass($model)); diff --git a/packages/core/src/Base/Traits/HasModelExtending.php b/packages/core/src/Base/Traits/HasModelExtending.php index 7306c70705..c0a0412d94 100644 --- a/packages/core/src/Base/Traits/HasModelExtending.php +++ b/packages/core/src/Base/Traits/HasModelExtending.php @@ -3,6 +3,7 @@ namespace Lunar\Base\Traits; use Illuminate\Database\Eloquent\Builder; +use Illuminate\Database\Eloquent\Relations\Relation; use Illuminate\Support\Arr; use Lunar\Facades\ModelManifest; @@ -46,6 +47,23 @@ public static function modelClass(): string return ModelManifest::get($contractClass) ?? static::class; } + public function getMorphClass(): string + { + $morphMap = Relation::morphMap(); + + if ($customModelMorphMap = array_search(static::modelClass(), $morphMap, true)) { + return $customModelMorphMap; + } + + $parentClass = get_parent_class(static::class); + + if (ModelManifest::isLunarModel($parentClass) && $lunarModelMorphMap = array_search($parentClass, $morphMap, true)) { + return $lunarModelMorphMap; + } + + return parent::getMorphClass(); + } + public static function isLunarInstance(): bool { return static::class == static::modelClass(); diff --git a/packages/core/src/Facades/ModelManifest.php b/packages/core/src/Facades/ModelManifest.php index 700071d594..877de04cea 100644 --- a/packages/core/src/Facades/ModelManifest.php +++ b/packages/core/src/Facades/ModelManifest.php @@ -16,7 +16,7 @@ * @method static string|null get(string $interfaceClass) * @method static string guessContractClass(string $modelClass) * @method static string guessModelClass(string $modelContract) - * @method static bool isLunarModel(BaseModel $model) + * @method static bool isLunarModel(string|BaseModel $model) * @method static string getTable(BaseModel $model) * @method static void morphMap() * @method static string getMorphMapKey(string $className) diff --git a/tests/core/Unit/Base/Traits/HasModelExtendingTest.php b/tests/core/Unit/Base/Traits/HasModelExtendingTest.php index 40e8e95e7c..e6350ff368 100644 --- a/tests/core/Unit/Base/Traits/HasModelExtendingTest.php +++ b/tests/core/Unit/Base/Traits/HasModelExtendingTest.php @@ -45,3 +45,16 @@ function () { expect($newStaticMethod)->toBeInstanceOf(Collection::class); expect($newStaticMethod)->toHaveCount(3); }); + +test('morph map is correct when models are extended', function () { + \Lunar\Facades\ModelManifest::replace( + \Lunar\Models\Contracts\Product::class, + \Lunar\Tests\Core\Stubs\Models\CustomProduct::class + ); + + expect((new \Lunar\Tests\Core\Stubs\Models\CustomProduct)->getMorphClass()) + ->toBe('product') + ->and((new Product)->getMorphClass()) + ->toBe('product'); +}); + From 4ffbaf01be7232fba84227ea1406860a39295ccf Mon Sep 17 00:00:00 2001 From: alecritson Date: Tue, 10 Sep 2024 10:47:34 +0000 Subject: [PATCH 02/35] chore: fix code style --- tests/core/Unit/Base/Traits/HasModelExtendingTest.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tests/core/Unit/Base/Traits/HasModelExtendingTest.php b/tests/core/Unit/Base/Traits/HasModelExtendingTest.php index e6350ff368..413a276eb9 100644 --- a/tests/core/Unit/Base/Traits/HasModelExtendingTest.php +++ b/tests/core/Unit/Base/Traits/HasModelExtendingTest.php @@ -52,9 +52,8 @@ function () { \Lunar\Tests\Core\Stubs\Models\CustomProduct::class ); - expect((new \Lunar\Tests\Core\Stubs\Models\CustomProduct)->getMorphClass()) - ->toBe('product') - ->and((new Product)->getMorphClass()) - ->toBe('product'); + expect((new \Lunar\Tests\Core\Stubs\Models\CustomProduct)->getMorphClass()) + ->toBe('product') + ->and((new Product)->getMorphClass()) + ->toBe('product'); }); - From 412b31ec21481b8190833c4a21148bd435827001 Mon Sep 17 00:00:00 2001 From: Kevin Fowler Date: Tue, 10 Sep 2024 06:46:24 -0700 Subject: [PATCH 03/35] OrderFactory: make sure taxTotal is an integer. (#1941) --- packages/core/database/factories/OrderFactory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/database/factories/OrderFactory.php b/packages/core/database/factories/OrderFactory.php index 7ec861a3d4..456201bc73 100644 --- a/packages/core/database/factories/OrderFactory.php +++ b/packages/core/database/factories/OrderFactory.php @@ -13,7 +13,7 @@ class OrderFactory extends BaseFactory public function definition(): array { $total = $this->faker->numberBetween(200, 25000); - $taxTotal = ($total - 100) * .2; + $taxTotal = intval(($total - 100) * .2); return [ 'channel_id' => Channel::factory(), From fc20edbb07f7077be18d86359f08ad4eec5362c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9as=20Lundgren?= <1066486+adevade@users.noreply.github.com> Date: Wed, 11 Sep 2024 11:04:31 +0200 Subject: [PATCH 04/35] Preload base prices on Product Variant page (#1934) --- .../Resources/ProductResource/Widgets/ProductOptionsWidget.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/admin/src/Filament/Resources/ProductResource/Widgets/ProductOptionsWidget.php b/packages/admin/src/Filament/Resources/ProductResource/Widgets/ProductOptionsWidget.php index a082be186d..2a50f3e01f 100644 --- a/packages/admin/src/Filament/Resources/ProductResource/Widgets/ProductOptionsWidget.php +++ b/packages/admin/src/Filament/Resources/ProductResource/Widgets/ProductOptionsWidget.php @@ -245,7 +245,7 @@ public function mapVariantPermutations($fillMissing = true): void )] )->toArray(); - $variants = $this->record->variants->load('values.option')->map(function ($variant) { + $variants = $this->record->variants->load(['basePrices.currency', 'basePrices.priceable', 'values.option'])->map(function ($variant) { return [ 'id' => $variant->id, 'sku' => $variant->sku, From 9eac4c75f1374691abaa2f38edaa7154427115da Mon Sep 17 00:00:00 2001 From: wychoong <67364036+wychoong@users.noreply.github.com> Date: Tue, 17 Sep 2024 16:30:34 +0800 Subject: [PATCH 05/35] Add helper function to get model morph name (#1947) --- packages/admin/src/Filament/Resources/ProductResource.php | 2 +- .../Resources/ProductResource/Pages/ListProducts.php | 2 +- .../admin/src/Filament/Resources/ProductTypeResource.php | 4 ++-- .../Support/Actions/Collections/CreateChildCollection.php | 2 +- .../Support/Actions/Collections/CreateRootCollection.php | 4 ++-- .../Support/Actions/Traits/CreatesChildCollections.php | 2 +- .../src/Support/Forms/Components/AttributeSelector.php | 4 ++-- .../admin/src/Support/Forms/Components/Attributes.php | 6 +++--- packages/admin/src/Support/Resources/BaseResource.php | 2 +- packages/core/database/factories/CartLineFactory.php | 2 +- .../database/factories/DiscountPurchasableFactory.php | 2 +- packages/core/database/factories/OrderLineFactory.php | 2 +- packages/core/database/factories/UrlFactory.php | 2 +- .../state/ConvertProductTypeAttributesToProducts.php | 4 ++-- packages/core/src/Base/Traits/HasAttributes.php | 2 +- packages/core/src/Base/Traits/HasModelExtending.php | 7 +++++++ packages/core/src/Console/InstallLunar.php | 6 +++--- packages/core/src/DiscountTypes/BuyXGetY.php | 4 ++-- packages/core/src/Models/Discount.php | 4 ++-- packages/core/src/Models/ProductType.php | 4 ++-- .../database/factories/ShippingExclusionFactory.php | 2 +- .../src/Drivers/ShippingMethods/Collection.php | 2 +- .../src/Drivers/ShippingMethods/FlatRate.php | 2 +- .../src/Drivers/ShippingMethods/FreeShipping.php | 2 +- .../src/Drivers/ShippingMethods/ShipBy.php | 2 +- .../ProductTypeResource/Pages/CreateProductTypeTest.php | 2 +- .../ProductTypeResource/Pages/EditProductTypeTest.php | 8 ++++---- tests/core/Unit/Base/Traits/HasModelExtendingTest.php | 4 ++++ 28 files changed, 51 insertions(+), 40 deletions(-) diff --git a/packages/admin/src/Filament/Resources/ProductResource.php b/packages/admin/src/Filament/Resources/ProductResource.php index 14b2d5440f..724c09a1a9 100644 --- a/packages/admin/src/Filament/Resources/ProductResource.php +++ b/packages/admin/src/Filament/Resources/ProductResource.php @@ -177,7 +177,7 @@ public static function getBaseNameFormComponent(): Component { $nameType = Attribute::whereHandle('name') ->whereAttributeType( - (new (static::getModel()))->getMorphClass() + static::getModel()::morphName() ) ->first()?->type ?: TranslatedText::class; diff --git a/packages/admin/src/Filament/Resources/ProductResource/Pages/ListProducts.php b/packages/admin/src/Filament/Resources/ProductResource/Pages/ListProducts.php index 82d7c6bb3c..f02e59b67f 100644 --- a/packages/admin/src/Filament/Resources/ProductResource/Pages/ListProducts.php +++ b/packages/admin/src/Filament/Resources/ProductResource/Pages/ListProducts.php @@ -52,7 +52,7 @@ public static function createRecord(array $data, string $model): Model $currency = Currency::getDefault(); $nameAttribute = Attribute::whereAttributeType( - (new $model)->getMorphClass() + $model::morphName() ) ->whereHandle('name') ->first() diff --git a/packages/admin/src/Filament/Resources/ProductTypeResource.php b/packages/admin/src/Filament/Resources/ProductTypeResource.php index a56958ca9c..31648eeb64 100644 --- a/packages/admin/src/Filament/Resources/ProductTypeResource.php +++ b/packages/admin/src/Filament/Resources/ProductTypeResource.php @@ -54,7 +54,7 @@ public static function getDefaultForm(Forms\Form $form): Forms\Form Forms\Components\Tabs\Tab::make(__('lunarpanel::producttype.tabs.product_attributes.label')) ->schema([ AttributeSelector::make('mappedAttributes') - ->withType((new Product)->getMorphClass()) + ->withType(Product::morphName()) ->relationship(name: 'mappedAttributes') ->label('') ->columnSpan(2), @@ -62,7 +62,7 @@ public static function getDefaultForm(Forms\Form $form): Forms\Form Forms\Components\Tabs\Tab::make(__('lunarpanel::producttype.tabs.variant_attributes.label')) ->schema([ AttributeSelector::make('mappedAttributes') - ->withType((new ProductVariant)->getMorphClass()) + ->withType(ProductVariant::morphName()) ->relationship(name: 'mappedAttributes') ->label('') ->columnSpan(2), diff --git a/packages/admin/src/Support/Actions/Collections/CreateChildCollection.php b/packages/admin/src/Support/Actions/Collections/CreateChildCollection.php index 10482f94f1..30756048e9 100644 --- a/packages/admin/src/Support/Actions/Collections/CreateChildCollection.php +++ b/packages/admin/src/Support/Actions/Collections/CreateChildCollection.php @@ -26,7 +26,7 @@ public function setUp(): void $this->success(); }); - $attribute = Attribute::where('attribute_type', '=', (new Collection)->getMorphClass()) + $attribute = Attribute::where('attribute_type', '=', Collection::morphName()) ->where('handle', '=', 'name')->first(); $formInput = TextInput::class; diff --git a/packages/admin/src/Support/Actions/Collections/CreateRootCollection.php b/packages/admin/src/Support/Actions/Collections/CreateRootCollection.php index 0f84795d36..092aeca520 100644 --- a/packages/admin/src/Support/Actions/Collections/CreateRootCollection.php +++ b/packages/admin/src/Support/Actions/Collections/CreateRootCollection.php @@ -23,7 +23,7 @@ public function setUp(): void $record = $this->process(function (array $data) { $attribute = Attribute::whereHandle('name')->whereAttributeType( - (new Collection)->getMorphClass() + Collection::morphName() )->first()->type; return Collection::create([ @@ -58,7 +58,7 @@ public function setUp(): void $this->success(); }); - $attribute = Attribute::where('attribute_type', '=', (new Collection)->getMorphClass()) + $attribute = Attribute::where('attribute_type', '=', Collection::morphName()) ->where('handle', '=', 'name')->first(); $formInput = TextInput::class; diff --git a/packages/admin/src/Support/Actions/Traits/CreatesChildCollections.php b/packages/admin/src/Support/Actions/Traits/CreatesChildCollections.php index fc92b7fbff..f7df262119 100644 --- a/packages/admin/src/Support/Actions/Traits/CreatesChildCollections.php +++ b/packages/admin/src/Support/Actions/Traits/CreatesChildCollections.php @@ -13,7 +13,7 @@ public function createChildCollection(Collection $parent, array|string $name) DB::beginTransaction(); $attribute = Attribute::whereHandle('name')->whereAttributeType( - (new Collection)->getMorphClass() + Collection::morphName() )->first()->type; $parent->appendNode(Collection::create([ diff --git a/packages/admin/src/Support/Forms/Components/AttributeSelector.php b/packages/admin/src/Support/Forms/Components/AttributeSelector.php index f4c8eda52c..f6820986b3 100644 --- a/packages/admin/src/Support/Forms/Components/AttributeSelector.php +++ b/packages/admin/src/Support/Forms/Components/AttributeSelector.php @@ -57,8 +57,8 @@ public function getAttributeGroups() $this->getRelationship()->getParent() ); - if ($type === (new ProductType)->getMorphClass()) { - $type = (new Product)->getMorphClass(); + if ($type === ProductType::morphName()) { + $type = Product::morphName(); } if ($this->attributableType) { diff --git a/packages/admin/src/Support/Forms/Components/Attributes.php b/packages/admin/src/Support/Forms/Components/Attributes.php index 4af835e54f..8df4b49223 100644 --- a/packages/admin/src/Support/Forms/Components/Attributes.php +++ b/packages/admin/src/Support/Forms/Components/Attributes.php @@ -26,13 +26,13 @@ protected function setUp(): void $productTypeId = null; - $morphMap = (new $modelClass)->getMorphClass(); + $morphMap = $modelClass::morphName(); $attributeQuery = Attribute::where('attribute_type', $morphMap); // Products are unique in that they use product types to map attributes, so we need // to try and find the product type ID - if ($morphMap == (new Product)->getMorphClass()) { + if ($morphMap == Product::morphName()) { $productTypeId = $record?->product_type_id ?: ProductType::first()->id; // If we have a product type, the attributes should be based off that. @@ -41,7 +41,7 @@ protected function setUp(): void } } - if ($morphMap == (new ProductVariant)->getMorphClass()) { + if ($morphMap == ProductVariant::morphName()) { $productTypeId = $record?->product?->product_type_id ?: ProductType::first()->id; // If we have a product type, the attributes should be based off that. if ($productTypeId) { diff --git a/packages/admin/src/Support/Resources/BaseResource.php b/packages/admin/src/Support/Resources/BaseResource.php index 0eb1960be9..6277e40f6d 100644 --- a/packages/admin/src/Support/Resources/BaseResource.php +++ b/packages/admin/src/Support/Resources/BaseResource.php @@ -125,7 +125,7 @@ protected static function applyGlobalSearchAttributeConstraints(Builder $query, protected static function mapSearchableAttributes(array &$map) { $attributes = Attribute::whereAttributeType( - (new (static::getModel()))->getMorphClass() + static::getModel()::morphName() ) ->whereSearchable(true) ->get(); diff --git a/packages/core/database/factories/CartLineFactory.php b/packages/core/database/factories/CartLineFactory.php index 3dda127e31..2c2118b6ea 100644 --- a/packages/core/database/factories/CartLineFactory.php +++ b/packages/core/database/factories/CartLineFactory.php @@ -15,7 +15,7 @@ public function definition(): array return [ 'cart_id' => Cart::factory(), 'quantity' => $this->faker->numberBetween(0, 1000), - 'purchasable_type' => (new ProductVariant)->getMorphClass(), + 'purchasable_type' => ProductVariant::morphName(), 'purchasable_id' => ProductVariant::factory(), 'meta' => null, ]; diff --git a/packages/core/database/factories/DiscountPurchasableFactory.php b/packages/core/database/factories/DiscountPurchasableFactory.php index a67036c6f2..a39e1d93bf 100644 --- a/packages/core/database/factories/DiscountPurchasableFactory.php +++ b/packages/core/database/factories/DiscountPurchasableFactory.php @@ -13,7 +13,7 @@ public function definition(): array { return [ 'purchasable_id' => ProductVariant::factory(), - 'purchasable_type' => (new ProductVariant)->getMorphClass(), + 'purchasable_type' => ProductVariant::morphName(), ]; } } diff --git a/packages/core/database/factories/OrderLineFactory.php b/packages/core/database/factories/OrderLineFactory.php index 94adb8d4a0..198e4dfac1 100644 --- a/packages/core/database/factories/OrderLineFactory.php +++ b/packages/core/database/factories/OrderLineFactory.php @@ -16,7 +16,7 @@ public function definition(): array { return [ 'order_id' => Order::factory(), - 'purchasable_type' => (new ProductVariant)->getMorphClass(), + 'purchasable_type' => ProductVariant::morphName(), 'purchasable_id' => ProductVariant::factory(), 'type' => 'physical', 'description' => $this->faker->sentence, diff --git a/packages/core/database/factories/UrlFactory.php b/packages/core/database/factories/UrlFactory.php index 285b215fe2..00f8fcd740 100644 --- a/packages/core/database/factories/UrlFactory.php +++ b/packages/core/database/factories/UrlFactory.php @@ -16,7 +16,7 @@ public function definition(): array 'slug' => $this->faker->slug, 'default' => true, 'language_id' => Language::factory(), - 'element_type' => (new Product)->getMorphClass(), + 'element_type' => Product::morphName(), 'element_id' => 1, ]; } diff --git a/packages/core/database/state/ConvertProductTypeAttributesToProducts.php b/packages/core/database/state/ConvertProductTypeAttributesToProducts.php index 863d618c80..dcf9c144e6 100644 --- a/packages/core/database/state/ConvertProductTypeAttributesToProducts.php +++ b/packages/core/database/state/ConvertProductTypeAttributesToProducts.php @@ -23,7 +23,7 @@ public function run() DB::table("{$prefix}attributes") ->whereAttributeType( - (new ProductType)->getMorphClass() + ProductType::morphName() ) ->update([ 'attribute_type' => 'product', @@ -31,7 +31,7 @@ public function run() DB::table("{$prefix}attribute_groups") ->whereAttributableType( - (new ProductType)->getMorphClass() + ProductType::morphName() ) ->update([ 'attributable_type' => 'product', diff --git a/packages/core/src/Base/Traits/HasAttributes.php b/packages/core/src/Base/Traits/HasAttributes.php index da028fc439..2d3f7bbee0 100644 --- a/packages/core/src/Base/Traits/HasAttributes.php +++ b/packages/core/src/Base/Traits/HasAttributes.php @@ -19,7 +19,7 @@ public function getAttributableClassnameAttribute() public function getAttributableMorphMapAttribute() { - return (new self)->getMorphClass(); + return self::morphName(); } /** diff --git a/packages/core/src/Base/Traits/HasModelExtending.php b/packages/core/src/Base/Traits/HasModelExtending.php index c0a0412d94..7cafe6c00d 100644 --- a/packages/core/src/Base/Traits/HasModelExtending.php +++ b/packages/core/src/Base/Traits/HasModelExtending.php @@ -47,6 +47,13 @@ public static function modelClass(): string return ModelManifest::get($contractClass) ?? static::class; } + /** + * Returns the model alias registered in the model relation morph map. + */ + public static function morphName():string{ + return (new (static::modelClass()))->getMorphClass(); + } + public function getMorphClass(): string { $morphMap = Relation::morphMap(); diff --git a/packages/core/src/Console/InstallLunar.php b/packages/core/src/Console/InstallLunar.php index 25d62e0a71..ed9f889f74 100644 --- a/packages/core/src/Console/InstallLunar.php +++ b/packages/core/src/Console/InstallLunar.php @@ -140,7 +140,7 @@ public function handle(): void $this->components->info('Setting up initial attributes'); $group = AttributeGroup::create([ - 'attributable_type' => (new Product)->getMorphClass(), + 'attributable_type' => Product::morphName(), 'name' => collect([ 'en' => 'Details', ]), @@ -149,7 +149,7 @@ public function handle(): void ]); $collectionGroup = AttributeGroup::create([ - 'attributable_type' => (new Collection)->getMorphClass(), + 'attributable_type' => Collection::morphName(), 'name' => collect([ 'en' => 'Details', ]), @@ -251,7 +251,7 @@ public function handle(): void $type->mappedAttributes()->attach( Attribute::whereAttributeType( - (new Product)->getMorphClass() + Product::morphName() )->get()->pluck('id') ); } diff --git a/packages/core/src/DiscountTypes/BuyXGetY.php b/packages/core/src/DiscountTypes/BuyXGetY.php index cf938d282d..6329049ed0 100644 --- a/packages/core/src/DiscountTypes/BuyXGetY.php +++ b/packages/core/src/DiscountTypes/BuyXGetY.php @@ -58,7 +58,7 @@ public function apply(Cart $cart): Cart // Get all purchasables that are eligible. $conditions = $cart->lines->reject(function ($line) { return ! $this->discount->purchasableConditions->first(function ($item) use ($line) { - return $item->purchasable_type == (new Product)->getMorphClass() && + return $item->purchasable_type == Product::morphName() && $item->purchasable_id == $line->purchasable->product->id; }); }); @@ -89,7 +89,7 @@ public function apply(Cart $cart): Cart // Get the reward lines and sort by cheapest first. $rewardLines = $cart->lines->filter(function ($line) { return $this->discount->purchasableRewards->first(function ($item) use ($line) { - return $item->purchasable_type == (new Product)->getMorphClass() && + return $item->purchasable_type == Product::morphName() && $item->purchasable_id == $line->purchasable->product->id; }); })->sortBy('subTotal.value'); diff --git a/packages/core/src/Models/Discount.php b/packages/core/src/Models/Discount.php index d580ff56fe..4bcf8f7628 100644 --- a/packages/core/src/Models/Discount.php +++ b/packages/core/src/Models/Discount.php @@ -179,7 +179,7 @@ public function scopeProducts(Builder $query, iterable $productIds = [], array|s fn ($subQuery) => $subQuery->whereDoesntHave('purchasables', fn ($query) => $query->when($types, fn ($query) => $query->whereIn('type', $types))) ->orWhereHas('purchasables', fn ($relation) => $relation->whereIn('purchasable_id', $productIds) - ->wherePurchasableType((new Product)->getMorphClass()) + ->wherePurchasableType(Product::morphName()) ->when( $types, fn ($query) => $query->whereIn('type', $types) @@ -200,7 +200,7 @@ public function scopeProductVariants(Builder $query, iterable $variantIds = [], fn ($subQuery) => $subQuery->whereDoesntHave('purchasables', fn ($query) => $query->when($types, fn ($query) => $query->whereIn('type', $types))) ->orWhereHas('purchasables', fn ($relation) => $relation->whereIn('purchasable_id', $variantIds) - ->wherePurchasableType((new ProductVariant)->getMorphClass()) + ->wherePurchasableType(ProductVariant::morphName()) ->when( $types, fn ($query) => $query->whereIn('type', $types) diff --git a/packages/core/src/Models/ProductType.php b/packages/core/src/Models/ProductType.php index f3526e1fe0..5ae661cbd4 100644 --- a/packages/core/src/Models/ProductType.php +++ b/packages/core/src/Models/ProductType.php @@ -52,14 +52,14 @@ public function mappedAttributes(): MorphToMany public function productAttributes(): MorphToMany { return $this->mappedAttributes()->whereAttributeType( - (new Product)->getMorphClass() + Product::morphName() ); } public function variantAttributes(): MorphToMany { return $this->mappedAttributes()->whereAttributeType( - (new ProductVariant)->getMorphClass() + ProductVariant::morphName() ); } diff --git a/packages/table-rate-shipping/database/factories/ShippingExclusionFactory.php b/packages/table-rate-shipping/database/factories/ShippingExclusionFactory.php index ddd98ea247..69a84a0d10 100644 --- a/packages/table-rate-shipping/database/factories/ShippingExclusionFactory.php +++ b/packages/table-rate-shipping/database/factories/ShippingExclusionFactory.php @@ -14,7 +14,7 @@ public function definition(): array { return [ 'purchasable_id' => 1, - 'purchasable_type' => (new Product)->getMorphClass(), + 'purchasable_type' => Product::morphName(), ]; } } diff --git a/packages/table-rate-shipping/src/Drivers/ShippingMethods/Collection.php b/packages/table-rate-shipping/src/Drivers/ShippingMethods/Collection.php index 3ff6d86c7f..ed16b140d1 100644 --- a/packages/table-rate-shipping/src/Drivers/ShippingMethods/Collection.php +++ b/packages/table-rate-shipping/src/Drivers/ShippingMethods/Collection.php @@ -45,7 +45,7 @@ public function resolve(ShippingOptionRequest $shippingOptionRequest): ?Shipping $hasExclusions = $shippingZone->shippingExclusions() ->whereHas('exclusions', function ($query) use ($productIds) { - $query->wherePurchasableType((new Product)->getMorphClass()) + $query->wherePurchasableType(Product::morphName()) ->whereIn('purchasable_id', $productIds); })->exists(); diff --git a/packages/table-rate-shipping/src/Drivers/ShippingMethods/FlatRate.php b/packages/table-rate-shipping/src/Drivers/ShippingMethods/FlatRate.php index d00886319c..c25c445f56 100644 --- a/packages/table-rate-shipping/src/Drivers/ShippingMethods/FlatRate.php +++ b/packages/table-rate-shipping/src/Drivers/ShippingMethods/FlatRate.php @@ -45,7 +45,7 @@ public function resolve(ShippingOptionRequest $shippingOptionRequest): ?Shipping $hasExclusions = $shippingZone->shippingExclusions() ->whereHas('exclusions', function ($query) use ($productIds) { - $query->wherePurchasableType((new Product)->getMorphClass()) + $query->wherePurchasableType(Product::morphName()) ->whereIn('purchasable_id', $productIds); })->exists(); diff --git a/packages/table-rate-shipping/src/Drivers/ShippingMethods/FreeShipping.php b/packages/table-rate-shipping/src/Drivers/ShippingMethods/FreeShipping.php index 449c5dd36f..a6ef71e912 100644 --- a/packages/table-rate-shipping/src/Drivers/ShippingMethods/FreeShipping.php +++ b/packages/table-rate-shipping/src/Drivers/ShippingMethods/FreeShipping.php @@ -46,7 +46,7 @@ public function resolve(ShippingOptionRequest $shippingOptionRequest): ?Shipping $hasExclusions = $shippingZone->shippingExclusions() ->whereHas('exclusions', function ($query) use ($productIds) { - $query->wherePurchasableType((new Product)->getMorphClass()) + $query->wherePurchasableType(Product::morphName()) ->whereIn('purchasable_id', $productIds); })->exists(); diff --git a/packages/table-rate-shipping/src/Drivers/ShippingMethods/ShipBy.php b/packages/table-rate-shipping/src/Drivers/ShippingMethods/ShipBy.php index e11fea9875..cabcb98acc 100644 --- a/packages/table-rate-shipping/src/Drivers/ShippingMethods/ShipBy.php +++ b/packages/table-rate-shipping/src/Drivers/ShippingMethods/ShipBy.php @@ -53,7 +53,7 @@ public function resolve(ShippingOptionRequest $shippingOptionRequest): ?Shipping $hasExclusions = $shippingZone->shippingExclusions() ->whereHas('exclusions', function ($query) use ($productIds) { - $query->wherePurchasableType((new Product)->getMorphClass()) + $query->wherePurchasableType(Product::morphName()) ->whereIn('purchasable_id', $productIds); })->exists(); diff --git a/tests/admin/Feature/Filament/Resources/ProductTypeResource/Pages/CreateProductTypeTest.php b/tests/admin/Feature/Filament/Resources/ProductTypeResource/Pages/CreateProductTypeTest.php index ef494e59b7..903c514f2b 100644 --- a/tests/admin/Feature/Filament/Resources/ProductTypeResource/Pages/CreateProductTypeTest.php +++ b/tests/admin/Feature/Filament/Resources/ProductTypeResource/Pages/CreateProductTypeTest.php @@ -54,7 +54,7 @@ ->assertHasNoFormErrors(); $this->assertDatabaseHas((new ProductType)->mappedAttributes()->getTable(), [ - 'attributable_type' => (new ProductType)->getMorphClass(), + 'attributable_type' => ProductType::morphName(), 'attributable_id' => $component->get('record')->id, ]); }); diff --git a/tests/admin/Feature/Filament/Resources/ProductTypeResource/Pages/EditProductTypeTest.php b/tests/admin/Feature/Filament/Resources/ProductTypeResource/Pages/EditProductTypeTest.php index 44b04035fe..94b006a031 100644 --- a/tests/admin/Feature/Filament/Resources/ProductTypeResource/Pages/EditProductTypeTest.php +++ b/tests/admin/Feature/Filament/Resources/ProductTypeResource/Pages/EditProductTypeTest.php @@ -26,13 +26,13 @@ ->assertHasNoFormErrors(); $this->assertDatabaseHas((new ProductType)->mappedAttributes()->getTable(), [ - 'attributable_type' => (new ProductType)->getMorphClass(), + 'attributable_type' => ProductType::morphName(), 'attributable_id' => $component->get('record')->id, 'attribute_id' => $attributeA->id, ]); $this->assertDatabaseHas((new ProductType)->mappedAttributes()->getTable(), [ - 'attributable_type' => (new ProductType)->getMorphClass(), + 'attributable_type' => ProductType::morphName(), 'attributable_id' => $component->get('record')->id, 'attribute_id' => $attributeB->id, ]); @@ -46,13 +46,13 @@ ->assertHasNoFormErrors(); $this->assertDatabaseHas((new ProductType)->mappedAttributes()->getTable(), [ - 'attributable_type' => (new ProductType)->getMorphClass(), + 'attributable_type' => ProductType::morphName(), 'attributable_id' => $component->get('record')->id, 'attribute_id' => $attributeA->id, ]); $this->assertDatabaseMissing((new ProductType)->mappedAttributes()->getTable(), [ - 'attributable_type' => (new ProductType)->getMorphClass(), + 'attributable_type' => ProductType::morphName(), 'attributable_id' => $component->get('record')->id, 'attribute_id' => $attributeB->id, ]); diff --git a/tests/core/Unit/Base/Traits/HasModelExtendingTest.php b/tests/core/Unit/Base/Traits/HasModelExtendingTest.php index 413a276eb9..da758ad99d 100644 --- a/tests/core/Unit/Base/Traits/HasModelExtendingTest.php +++ b/tests/core/Unit/Base/Traits/HasModelExtendingTest.php @@ -53,7 +53,11 @@ function () { ); expect((new \Lunar\Tests\Core\Stubs\Models\CustomProduct)->getMorphClass()) + ->toBe('product') + ->and(\Lunar\Tests\Core\Stubs\Models\CustomProduct::morphName()) ->toBe('product') ->and((new Product)->getMorphClass()) + ->toBe('product') + ->and(Product::morphName()) ->toBe('product'); }); From 6b0e787e6c2fb02684cb68eb3e775d827f5f3c80 Mon Sep 17 00:00:00 2001 From: alecritson Date: Tue, 17 Sep 2024 08:33:26 +0000 Subject: [PATCH 06/35] chore: fix code style --- packages/core/src/Base/Traits/HasModelExtending.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/core/src/Base/Traits/HasModelExtending.php b/packages/core/src/Base/Traits/HasModelExtending.php index 7cafe6c00d..340c769e02 100644 --- a/packages/core/src/Base/Traits/HasModelExtending.php +++ b/packages/core/src/Base/Traits/HasModelExtending.php @@ -50,10 +50,11 @@ public static function modelClass(): string /** * Returns the model alias registered in the model relation morph map. */ - public static function morphName():string{ + public static function morphName(): string + { return (new (static::modelClass()))->getMorphClass(); } - + public function getMorphClass(): string { $morphMap = Relation::morphMap(); From f3db11375c7ee03ca94b273543d9ade3e6f7efbc Mon Sep 17 00:00:00 2001 From: Alec Ritson Date: Tue, 17 Sep 2024 09:41:29 +0100 Subject: [PATCH 07/35] Fix extended model resolving (#1949) This PR looks to solve some anomalies that have been discovered with model extending. ## Problem A When replacing a Lunar model, there are instances where the model provided by Lunar is still used for example, if you replace the model like so ```php \Lunar\Facades\ModelManifest::replace( \Lunar\Models\Contracts\Order::class, \App\Models\Order::class ); ``` Later in the Lunar core, we are still referencing `Lunar\Models\Order::first()` or via relationships `$orderLine->order()`. We attempted to resolve these queries to their concrete replacements by overriding the `newModelQuery` method, however there were issues with castable attributes which caused them to be cast multiple times, resulting in errors. ### Solution This has been rewritten so Lunar doesn't try to `fill` the extended instance of the model from the Lunar base class anymore and instead just populates the attributes as they are. Since this should just be a simple class swap it should no longer result in duplicate calls to attribute casters. There are some additional checks to see if we are actually working with a model that hasn't been extended to ensure we are not getting into a situation where we try and rehydrate with the same class. ### Affected issues This change should resolve #1942 #1930 ## Problem B If your own custom model was named something other than it's counterpart, for example: ```php \Lunar\Facades\ModelManifest::replace( \Lunar\Models\Contracts\Order::class, \App\Models\MyCustomOrder::class ); ``` This would result in the table name and subsequent foreign key naming to be incorrect i.e. `my_custom_order` and `my_custom_order_id`. This would mean developers would need to add their own methods to override this in order for the naming to resolve properly, which is a bit of a maintenance burden and easily missed when encountering errors. ### Solution The `HasModelExtending` trait now provides its own `getTable` and `getForeignKey` methods which will check which class within Lunar we are extending and return the appropriate table name and foreign key. ## How this slipped through testing Looks like there was an oversight and although there were tests for extending models, the tests themselves didn't use any extending when performing more complex tasks, like creating orders from carts. This PR has now added some model extending to tests which were affected by the issues referenced above to hopefully keep this in check and make for a more "real world" test environment. --------- Co-authored-by: alecritson --- .../src/Base/Traits/HasModelExtending.php | 52 +++++++++++++++++-- tests/core/Stubs/Models/CustomOrder.php | 5 ++ tests/core/Stubs/Models/Order.php | 5 ++ .../Unit/Actions/Carts/CreateOrderTest.php | 10 +++- .../Base/Traits/HasModelExtendingTest.php | 7 +++ 5 files changed, 74 insertions(+), 5 deletions(-) create mode 100644 tests/core/Stubs/Models/CustomOrder.php create mode 100644 tests/core/Stubs/Models/Order.php diff --git a/packages/core/src/Base/Traits/HasModelExtending.php b/packages/core/src/Base/Traits/HasModelExtending.php index 340c769e02..a8e0f2a689 100644 --- a/packages/core/src/Base/Traits/HasModelExtending.php +++ b/packages/core/src/Base/Traits/HasModelExtending.php @@ -3,25 +3,71 @@ namespace Lunar\Base\Traits; use Illuminate\Database\Eloquent\Builder; +use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\Relation; use Illuminate\Support\Arr; +use Illuminate\Support\Str; +use Lunar\Base\BaseModel; use Lunar\Facades\ModelManifest; trait HasModelExtending { public function newModelQuery(): Builder { - $realClass = static::modelClass(); + $concreteClass = static::modelClass(); + $parentClass = get_parent_class($concreteClass); // If they are both the same class i.e. they haven't changed // then just call the parent method. - if ($this instanceof $realClass) { + if ($parentClass == BaseModel::class || $this instanceof $concreteClass) { return parent::newModelQuery(); } return $this->newEloquentBuilder( $this->newBaseQueryBuilder() - )->setModel(new $realClass($this->toArray())); + )->setModel( + static::withoutEvents( + fn () => $this->replicateInto($concreteClass) + ) + ); + } + + public function replicateInto($newClass) + { + $defaults = array_values(array_filter([ + $this->getKeyName(), + $this->getCreatedAtColumn(), + $this->getUpdatedAtColumn(), + ...$this->uniqueIds(), + 'laravel_through_key', + ])); + + $attributes = Arr::except( + $this->getAttributes(), $defaults + ); + + return tap(new $newClass, function ($instance) use ($attributes): Model { + $instance->setRawAttributes($attributes); + + $instance->setRelations($this->relations); + + return $instance; + }); + } + + public function getForeignKey(): string + { + $parentClass = get_parent_class($this); + + return $parentClass == BaseModel::class ? parent::getForeignKey() : Str::snake(class_basename($parentClass)).'_'.$this->getKeyName(); + + } + + public function getTable() + { + $parentClass = get_parent_class($this); + + return $parentClass == BaseModel::class ? parent::getTable() : (new $parentClass)->table; } public static function __callStatic($method, $parameters) diff --git a/tests/core/Stubs/Models/CustomOrder.php b/tests/core/Stubs/Models/CustomOrder.php new file mode 100644 index 0000000000..7cf7db04ce --- /dev/null +++ b/tests/core/Stubs/Models/CustomOrder.php @@ -0,0 +1,5 @@ +create([ 'default' => true, ]); @@ -223,8 +229,8 @@ function can_update_draft_order() ->and($order->shippingAddress)->toBeInstanceOf(OrderAddress::class) ->and($order->billingAddress)->toBeInstanceOf(OrderAddress::class); - $this->assertDatabaseHas((new Order)->getTable(), $datacheck); - $this->assertDatabaseHas((new OrderLine)->getTable(), [ + assertDatabaseHas((new Order)->getTable(), $datacheck); + assertDatabaseHas((new OrderLine)->getTable(), [ 'identifier' => $shippingOption->getIdentifier(), ]); diff --git a/tests/core/Unit/Base/Traits/HasModelExtendingTest.php b/tests/core/Unit/Base/Traits/HasModelExtendingTest.php index da758ad99d..24f55d3e09 100644 --- a/tests/core/Unit/Base/Traits/HasModelExtendingTest.php +++ b/tests/core/Unit/Base/Traits/HasModelExtendingTest.php @@ -38,6 +38,13 @@ function () { expect($sizeOption->sizes)->toHaveCount(1); }); +test('extended model returns correct table name', function () { + expect((new \Lunar\Tests\Core\Stubs\Models\CustomOrder)->getTable()) + ->toBe( + (new \Lunar\Models\Order)->getTable() + ); +}); + test('can forward static method calls to extended model', function () { /** @see \Lunar\Tests\Core\Stubs\Models\ProductOption::getSizesStatic() */ $newStaticMethod = ProductOption::getSizesStatic(); From c4381dc732aaa3e43b6032afa1871438b74e1956 Mon Sep 17 00:00:00 2001 From: Alec Ritson Date: Tue, 17 Sep 2024 09:41:49 +0100 Subject: [PATCH 08/35] Manually map models on migration instead of loading via directory (#1928) Currently if you publish the migrations they can fail due to trying to read a directory relative to the the vendor folder. This PR instead opts to manually map the models to prevent this issue completely. --------- Co-authored-by: alecritson Co-authored-by: Glenn Jacobs --- ..._15_100000_remap_polymorphic_relations.php | 52 ++++++++++++++++--- 1 file changed, 44 insertions(+), 8 deletions(-) diff --git a/packages/core/database/migrations/2024_03_15_100000_remap_polymorphic_relations.php b/packages/core/database/migrations/2024_03_15_100000_remap_polymorphic_relations.php index 8e509cee2d..748ef41d27 100644 --- a/packages/core/database/migrations/2024_03_15_100000_remap_polymorphic_relations.php +++ b/packages/core/database/migrations/2024_03_15_100000_remap_polymorphic_relations.php @@ -1,20 +1,56 @@ classes() - ->extending(BaseModel::class) - ->get() - )->mapWithKeys( + $modelClasses = collect([ + \Lunar\Models\CartLine::class, + \Lunar\Models\ProductOption::class, + \Lunar\Models\Asset::class, + \Lunar\Models\Brand::class, + \Lunar\Models\TaxZone::class, + \Lunar\Models\TaxZoneCountry::class, + \Lunar\Models\TaxZoneCustomerGroup::class, + \Lunar\Models\DiscountCollection::class, + \Lunar\Models\TaxClass::class, + \Lunar\Models\ProductOptionValue::class, + \Lunar\Models\Channel::class, + \Lunar\Models\AttributeGroup::class, + \Lunar\Models\Tag::class, + \Lunar\Models\Cart::class, + \Lunar\Models\Collection::class, + \Lunar\Models\Discount::class, + \Lunar\Models\TaxRate::class, + \Lunar\Models\Price::class, + \Lunar\Models\DiscountPurchasable::class, + \Lunar\Models\State::class, + \Lunar\Models\UserPermission::class, + \Lunar\Models\OrderAddress::class, + \Lunar\Models\Country::class, + \Lunar\Models\Address::class, + \Lunar\Models\Url::class, + \Lunar\Models\ProductVariant::class, + \Lunar\Models\TaxZonePostcode::class, + \Lunar\Models\ProductAssociation::class, + \Lunar\Models\TaxRateAmount::class, + \Lunar\Models\Attribute::class, + \Lunar\Models\Order::class, + \Lunar\Models\Customer::class, + \Lunar\Models\OrderLine::class, + \Lunar\Models\CartAddress::class, + \Lunar\Models\Language::class, + \Lunar\Models\TaxZoneState::class, + \Lunar\Models\Currency::class, + \Lunar\Models\Product::class, + \Lunar\Models\Transaction::class, + \Lunar\Models\ProductType::class, + \Lunar\Models\CollectionGroup::class, + \Lunar\Models\CustomerGroup::class, + ])->mapWithKeys( fn ($class) => [ $class => \Lunar\Facades\ModelManifest::getMorphMapKey($class), ] From efe4bd215c814c23a7f7f1e26a4c4d4890fdffe9 Mon Sep 17 00:00:00 2001 From: Alec Ritson Date: Wed, 18 Sep 2024 12:52:07 +0100 Subject: [PATCH 09/35] Tweak pint action author (#1959) --- .github/workflows/fix-code-style.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/fix-code-style.yml b/.github/workflows/fix-code-style.yml index 5870b8e5bd..517d722242 100644 --- a/.github/workflows/fix-code-style.yml +++ b/.github/workflows/fix-code-style.yml @@ -10,7 +10,7 @@ jobs: - name: Checkout code uses: actions/checkout@v4 with: - token: ${{ secrets.ACCESS_TOKEN }} + token: ${{ secrets.GITHUB_TOKEN }} ref: ${{ github.head_ref }} - name: Set up PHP uses: shivammathur/setup-php@v2 @@ -26,5 +26,8 @@ jobs: - name: Commit changes uses: stefanzweifel/git-auto-commit-action@v4 with: + commit_user_name: "GitHub Action" + commit_user_email: "action@github.com" + commit_author: "Author " commit_message: > chore: fix code style From 80d4b39ce202c094c385eae6fdf51a9b402dcc6f Mon Sep 17 00:00:00 2001 From: Alec Ritson Date: Wed, 18 Sep 2024 12:56:35 +0100 Subject: [PATCH 10/35] Fix method `getMorphClass` call on string (#1957) --- packages/admin/src/helpers.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/admin/src/helpers.php b/packages/admin/src/helpers.php index 0f36ccafd1..896463aeb5 100644 --- a/packages/admin/src/helpers.php +++ b/packages/admin/src/helpers.php @@ -95,7 +95,7 @@ function get_search_builder($model, $search): Laravel\Scout\Builder|Builder foreach (explode(' ', $search) as $searchWord) { $query->where(function (Builder $query) use ($model, $searchWord) { - $attributes = Attribute::whereAttributeType($model->getMorphClass()) + $attributes = Attribute::whereAttributeType($model::morphName()) ->whereSearchable(true) ->get(); From 24cba88e1bdd53d77c97b7313be10e76190e98d6 Mon Sep 17 00:00:00 2001 From: Kyle Anderson Date: Wed, 18 Sep 2024 08:19:53 -0400 Subject: [PATCH 11/35] Update documentation to point to correct config file for cart session (#1952) --- docs/core/reference/carts.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/core/reference/carts.md b/docs/core/reference/carts.md index 8a40354e4c..6d171c3d3f 100644 --- a/docs/core/reference/carts.md +++ b/docs/core/reference/carts.md @@ -270,7 +270,7 @@ When you call current, you have two options, you either return `null` if they don't have a cart, or you want to create one straight away. By default, we do not create them initially as this could lead to a ton of cart models being created for no good reason. If you want to enable this functionality, you can -adjust the config in `lunar/cart.php` +adjust the config in `lunar/cart_session.php` ### Forgetting the cart Forgetting the cart will remove it from the user session and also soft-delete From 4aad66d2927719d924ef35f6f55aa4c0283a4b4f Mon Sep 17 00:00:00 2001 From: wychoong <67364036+wychoong@users.noreply.github.com> Date: Wed, 18 Sep 2024 20:43:40 +0800 Subject: [PATCH 12/35] Fix price breaks not storing in correct currency factor (#1948) --- .../ShippingZoneResource/Pages/ManageShippingRates.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/table-rate-shipping/src/Filament/Resources/ShippingZoneResource/Pages/ManageShippingRates.php b/packages/table-rate-shipping/src/Filament/Resources/ShippingZoneResource/Pages/ManageShippingRates.php index 1d80cfb149..9d84b2f26f 100644 --- a/packages/table-rate-shipping/src/Filament/Resources/ShippingZoneResource/Pages/ManageShippingRates.php +++ b/packages/table-rate-shipping/src/Filament/Resources/ShippingZoneResource/Pages/ManageShippingRates.php @@ -57,6 +57,7 @@ function () { ->label( __('lunarpanel.shipping::relationmanagers.shipping_rates.form.shipping_method_id.label') ) + ->required() ->relationship(name: 'shippingMethod', titleAttribute: 'name') ->columnSpan(2), Forms\Components\TextInput::make('price') @@ -180,9 +181,14 @@ protected static function saveShippingRate(?ShippingRate $shippingRate = null, a $shippingRate->priceBreaks()->delete(); + $currencies = Currency::all(); $tiers = collect($data['prices'] ?? [])->map( - function ($price) { - $price['min_quantity'] = $price['min_quantity'] * 100; + function ($price) use ($currencies) { + $currency = $currencies->first(fn ($currency) => $currency->id == $price['currency_id']); + + $price['min_quantity'] = (int) ($price['min_quantity'] * $currency->factor); + + $price['price'] = (int) ($price['price'] * $currency->factor); return $price; } From 4c4b26fe6e32105764a7dfac67ffe22b3f7d2386 Mon Sep 17 00:00:00 2001 From: Matt Floyd Date: Thu, 26 Sep 2024 09:21:22 -0400 Subject: [PATCH 13/35] Remove duplicated code sample (#1967) --- docs/core/reference/carts.md | 9 --------- 1 file changed, 9 deletions(-) diff --git a/docs/core/reference/carts.md b/docs/core/reference/carts.md index 6d171c3d3f..9ef5955e50 100644 --- a/docs/core/reference/carts.md +++ b/docs/core/reference/carts.md @@ -129,15 +129,6 @@ foreach ($cart->shippingBreakdown->items as $shippingBreakdown) { } -foreach ($cart->discountBreakdown as $discountBreakdown) { - $discountBreakdown->discount_id - foreach ($discountBreakdown->lines as $discountLine) { - $discountLine->quantity - $discountLine->line - } - $discountBreakdown->total->value -} - foreach ($cart->discountBreakdown as $discountBreakdown) { $discountBreakdown->discount_id foreach ($discountBreakdown->lines as $discountLine) { From 6766bba673be0b1b4870ea66b7af41a796608d0d Mon Sep 17 00:00:00 2001 From: wychoong <67364036+wychoong@users.noreply.github.com> Date: Thu, 26 Sep 2024 21:22:01 +0800 Subject: [PATCH 14/35] Add discount config to service provider (#1965) --- packages/core/src/LunarServiceProvider.php | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/core/src/LunarServiceProvider.php b/packages/core/src/LunarServiceProvider.php index 7164d09715..d4df153a7d 100644 --- a/packages/core/src/LunarServiceProvider.php +++ b/packages/core/src/LunarServiceProvider.php @@ -95,6 +95,7 @@ class LunarServiceProvider extends ServiceProvider 'cart', 'cart_session', 'database', + 'discounts', 'media', 'orders', 'payments', From 26d70d7e6494b2b542ed093351741f7dd700da7d Mon Sep 17 00:00:00 2001 From: Matt Floyd Date: Mon, 30 Sep 2024 05:17:44 -0400 Subject: [PATCH 15/35] Fix docblock return types (#1968) --- packages/core/src/Pipelines/Cart/ApplyDiscounts.php | 2 +- packages/core/src/Pipelines/Cart/ApplyShipping.php | 2 +- packages/core/src/Pipelines/Cart/Calculate.php | 2 +- packages/core/src/Pipelines/Cart/CalculateLines.php | 2 +- packages/core/src/Pipelines/Cart/CalculateTax.php | 2 +- .../core/src/Pipelines/Order/Creation/CleanUpOrderLines.php | 2 +- .../core/src/Pipelines/Order/Creation/CreateOrderAddresses.php | 2 +- packages/core/src/Pipelines/Order/Creation/CreateOrderLines.php | 2 +- .../core/src/Pipelines/Order/Creation/CreateShippingLine.php | 2 +- .../core/src/Pipelines/Order/Creation/FillOrderFromCart.php | 2 +- .../core/src/Pipelines/Order/Creation/MapDiscountBreakdown.php | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/core/src/Pipelines/Cart/ApplyDiscounts.php b/packages/core/src/Pipelines/Cart/ApplyDiscounts.php index bf84f14e21..bd0570b132 100644 --- a/packages/core/src/Pipelines/Cart/ApplyDiscounts.php +++ b/packages/core/src/Pipelines/Cart/ApplyDiscounts.php @@ -11,7 +11,7 @@ final class ApplyDiscounts /** * Called just before cart totals are calculated. * - * @return void + * @return mixed */ public function handle(Cart $cart, Closure $next) { diff --git a/packages/core/src/Pipelines/Cart/ApplyShipping.php b/packages/core/src/Pipelines/Cart/ApplyShipping.php index da69179466..d516fc7adf 100644 --- a/packages/core/src/Pipelines/Cart/ApplyShipping.php +++ b/packages/core/src/Pipelines/Cart/ApplyShipping.php @@ -14,7 +14,7 @@ final class ApplyShipping /** * Called just before cart totals are calculated. * - * @return void + * @return mixed */ public function handle(Cart $cart, Closure $next) { diff --git a/packages/core/src/Pipelines/Cart/Calculate.php b/packages/core/src/Pipelines/Cart/Calculate.php index 353f519729..18c4520a31 100644 --- a/packages/core/src/Pipelines/Cart/Calculate.php +++ b/packages/core/src/Pipelines/Cart/Calculate.php @@ -11,7 +11,7 @@ class Calculate /** * Called just before cart totals are calculated. * - * @return void + * @return mixed */ public function handle(Cart $cart, Closure $next) { diff --git a/packages/core/src/Pipelines/Cart/CalculateLines.php b/packages/core/src/Pipelines/Cart/CalculateLines.php index 06599eb189..176b678cc9 100644 --- a/packages/core/src/Pipelines/Cart/CalculateLines.php +++ b/packages/core/src/Pipelines/Cart/CalculateLines.php @@ -12,7 +12,7 @@ class CalculateLines /** * Called just before cart totals are calculated. * - * @return void + * @return mixed */ public function handle(Cart $cart, Closure $next) { diff --git a/packages/core/src/Pipelines/Cart/CalculateTax.php b/packages/core/src/Pipelines/Cart/CalculateTax.php index 78890c7046..6927e071d2 100644 --- a/packages/core/src/Pipelines/Cart/CalculateTax.php +++ b/packages/core/src/Pipelines/Cart/CalculateTax.php @@ -15,7 +15,7 @@ class CalculateTax /** * Called just before cart totals are calculated. * - * @return void + * @return mixed */ public function handle(Cart $cart, Closure $next) { diff --git a/packages/core/src/Pipelines/Order/Creation/CleanUpOrderLines.php b/packages/core/src/Pipelines/Order/Creation/CleanUpOrderLines.php index 452697cfa4..0d6dcebbdb 100644 --- a/packages/core/src/Pipelines/Order/Creation/CleanUpOrderLines.php +++ b/packages/core/src/Pipelines/Order/Creation/CleanUpOrderLines.php @@ -8,7 +8,7 @@ class CleanUpOrderLines { /** - * @return Closure + * @return mixed */ public function handle(Order $order, Closure $next) { diff --git a/packages/core/src/Pipelines/Order/Creation/CreateOrderAddresses.php b/packages/core/src/Pipelines/Order/Creation/CreateOrderAddresses.php index b6b36ab243..c296933661 100644 --- a/packages/core/src/Pipelines/Order/Creation/CreateOrderAddresses.php +++ b/packages/core/src/Pipelines/Order/Creation/CreateOrderAddresses.php @@ -9,7 +9,7 @@ class CreateOrderAddresses { /** - * @return Closure + * @return mixed */ public function handle(Order $order, Closure $next) { diff --git a/packages/core/src/Pipelines/Order/Creation/CreateOrderLines.php b/packages/core/src/Pipelines/Order/Creation/CreateOrderLines.php index f1015e09c7..93400d5f62 100644 --- a/packages/core/src/Pipelines/Order/Creation/CreateOrderLines.php +++ b/packages/core/src/Pipelines/Order/Creation/CreateOrderLines.php @@ -9,7 +9,7 @@ class CreateOrderLines { /** - * @return Closure + * @return mixed */ public function handle(Order $order, Closure $next) { diff --git a/packages/core/src/Pipelines/Order/Creation/CreateShippingLine.php b/packages/core/src/Pipelines/Order/Creation/CreateShippingLine.php index a879de275d..234fdf3e86 100644 --- a/packages/core/src/Pipelines/Order/Creation/CreateShippingLine.php +++ b/packages/core/src/Pipelines/Order/Creation/CreateShippingLine.php @@ -10,7 +10,7 @@ class CreateShippingLine { /** - * @return Closure + * @return mixed */ public function handle(Order $order, Closure $next) { diff --git a/packages/core/src/Pipelines/Order/Creation/FillOrderFromCart.php b/packages/core/src/Pipelines/Order/Creation/FillOrderFromCart.php index e05dd673ab..4671eb15d7 100644 --- a/packages/core/src/Pipelines/Order/Creation/FillOrderFromCart.php +++ b/packages/core/src/Pipelines/Order/Creation/FillOrderFromCart.php @@ -10,7 +10,7 @@ class FillOrderFromCart { /** - * @return Closure + * @return mixed */ public function handle(Order $order, Closure $next) { diff --git a/packages/core/src/Pipelines/Order/Creation/MapDiscountBreakdown.php b/packages/core/src/Pipelines/Order/Creation/MapDiscountBreakdown.php index f4953c8fa2..fd92f7a6e5 100644 --- a/packages/core/src/Pipelines/Order/Creation/MapDiscountBreakdown.php +++ b/packages/core/src/Pipelines/Order/Creation/MapDiscountBreakdown.php @@ -8,7 +8,7 @@ class MapDiscountBreakdown { /** - * @return Closure + * @return mixed */ public function handle(Order $order, Closure $next) { From 3d66fb2927a31475cc2cc9ed83f39d169eb52886 Mon Sep 17 00:00:00 2001 From: Glenn Jacobs Date: Mon, 7 Oct 2024 10:39:30 +0100 Subject: [PATCH 16/35] Update alpha mentions to beta (#1980) Seems we missed a few mentions when moving to beta. This looks to resolve them. --- README.md | 2 +- docs/admin/overview.md | 4 ++-- docs/core/installation.md | 6 +++--- docs/core/overview.md | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 61c8a203b1..7ec01edf64 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@

Lunar

> [!CAUTION] -> Version 1.x is currently in alpha release. We recommend this version for new projects, however, it is not feature-complete and therefore may not be deemed production-ready. +> Version 1.x is currently in beta release. We recommend this version for new projects, however, it is not feature-complete and therefore may not be deemed production-ready. [Lunar](https://lunarphp.io) is a set of Laravel packages that bring functionality akin to Shopify and other e-commerce platforms to diff --git a/docs/admin/overview.md b/docs/admin/overview.md index c2a3e40158..d2f0003abe 100644 --- a/docs/admin/overview.md +++ b/docs/admin/overview.md @@ -1,8 +1,8 @@ # Introduction -::: danger Alpha Release +::: danger Beta Release Although many Lunar sites have been launched using v1.x, you may not consider this version production-ready for your own -use and should exercise the same amount of caution as you would with any software in an alpha state. 🚀 +use and should exercise the same amount of caution as you would with any software in an beta state. 🚀 ::: Lunar's admin panel is powered by Filament v3. It allows you to easily extend the admin panel to suit your project. diff --git a/docs/core/installation.md b/docs/core/installation.md index 9633b8b4dc..cd572157ac 100644 --- a/docs/core/installation.md +++ b/docs/core/installation.md @@ -1,8 +1,8 @@ # Installation -::: danger Alpha Release +::: danger Beta Release Although many Lunar sites have been launched using v1.x, you may not consider this version production-ready for your own -use and should exercise the same amount of caution as you would with any software in an alpha state. 🚀 +use and should exercise the same amount of caution as you would with any software in an beta state. 🚀 ::: ## Requirements @@ -20,7 +20,7 @@ use and should exercise the same amount of caution as you would with any softwar ### Composer Require Package ```sh -composer require lunarphp/lunar:"^1.0.0-alpha" -W +composer require lunarphp/lunar:"^1.0.0-beta" -W ``` ::: tip diff --git a/docs/core/overview.md b/docs/core/overview.md index bbdb47fdb1..d274fa5781 100644 --- a/docs/core/overview.md +++ b/docs/core/overview.md @@ -1,8 +1,8 @@ # Welcome to Lunar! -::: danger Alpha Release -Although many Lunar sites have been launched using v1.x, you may not consider this version production-ready for your own -use and should exercise the same amount of caution as you would with any software in an alpha state. 🚀 +::: danger Beta Release +Although many Lunar sites have been launched using v1.x, you may not consider this version production-ready for your own +use and should exercise the same amount of caution as you would with any software in an beta state. 🚀 ::: We are delighted you are considering Lunar for your project. We've spent a lot of time developing this package to bring headless e-commerce functionality to Laravel. From ab7f6d5ebeb5533498ff13c36155534f181adad6 Mon Sep 17 00:00:00 2001 From: Lionel Guichard Date: Mon, 21 Oct 2024 08:56:10 +0200 Subject: [PATCH 17/35] Fix: case sensitivity typo (#1991) --- packages/admin/src/Support/Forms/Components/Attributes.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/admin/src/Support/Forms/Components/Attributes.php b/packages/admin/src/Support/Forms/Components/Attributes.php index 8df4b49223..429b3fde61 100644 --- a/packages/admin/src/Support/Forms/Components/Attributes.php +++ b/packages/admin/src/Support/Forms/Components/Attributes.php @@ -86,7 +86,7 @@ protected function setUp(): void } foreach ($state as $key => $value) { - if (! $value instanceof \Lunar\Base\Fieldtype) { + if (! $value instanceof \Lunar\Base\FieldType) { continue; } From ac92f140819f4ce0a73ffddcd9eb676ae82ed9a2 Mon Sep 17 00:00:00 2001 From: wychoong <67364036+wychoong@users.noreply.github.com> Date: Mon, 21 Oct 2024 14:57:00 +0800 Subject: [PATCH 18/35] Fix `class_implements` error on string 'product_variant' (#1964) fixes #1942 fix `class_implements` error on string 'product_variant' Co-authored-by: Alec Ritson --- packages/core/src/Observers/OrderLineObserver.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/core/src/Observers/OrderLineObserver.php b/packages/core/src/Observers/OrderLineObserver.php index 967607dd53..af384a4281 100644 --- a/packages/core/src/Observers/OrderLineObserver.php +++ b/packages/core/src/Observers/OrderLineObserver.php @@ -32,8 +32,12 @@ public function creating(OrderLine $orderLine) */ public function updating(OrderLine $orderLine) { - if (! in_array(Purchasable::class, class_implements($orderLine->purchasable_type, true))) { - throw new NonPurchasableItemException($orderLine->purchasable_type); + $purchasableModel = class_exists($orderLine->purchasable_type) ? + $orderLine->purchasable_type : + Relation::getMorphedModel($orderLine->purchasable_type); + + if (! $purchasableModel || ! in_array(Purchasable::class, class_implements($purchasableModel, true))) { + throw new NonPurchasableItemException($purchasableModel); } } } From 694014e8940c303e2b3e3b6e5e3cc5fbf5639788 Mon Sep 17 00:00:00 2001 From: Aidas Klimas Date: Mon, 21 Oct 2024 15:09:30 +0800 Subject: [PATCH 19/35] Fix Order relation manager url generation (#1995) --- .../RelationManagers/OrdersRelationManager.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/admin/src/Filament/Resources/CustomerResource/RelationManagers/OrdersRelationManager.php b/packages/admin/src/Filament/Resources/CustomerResource/RelationManagers/OrdersRelationManager.php index 5598f7863e..99b114b773 100644 --- a/packages/admin/src/Filament/Resources/CustomerResource/RelationManagers/OrdersRelationManager.php +++ b/packages/admin/src/Filament/Resources/CustomerResource/RelationManagers/OrdersRelationManager.php @@ -6,6 +6,7 @@ use Filament\Tables\Table; use Lunar\Admin\Filament\Resources\OrderResource; use Lunar\Admin\Support\RelationManagers\BaseRelationManager; +use Lunar\Admin\Filament\Resources\OrderResource\Pages\ManageOrder; use Lunar\Models\Order; class OrdersRelationManager extends BaseRelationManager @@ -18,7 +19,7 @@ public function getDefaultTable(Table $table): Table OrderResource::getTableColumns() )->actions([ Tables\Actions\Action::make('viewOrder') - ->url(fn (Order $record): string => route('filament.lunar.resources.orders.order', $record)), + ->url(fn (Order $record): string => ManageOrder::getUrl(['record' => $record])), ]); } } From 19858f375dd1b90e21301e836bdef55d493b4d90 Mon Sep 17 00:00:00 2001 From: Lionel Guichard Date: Mon, 21 Oct 2024 09:09:56 +0200 Subject: [PATCH 20/35] Fix Missing morphName in database state (#1990) --- .../core/database/state/EnsureMediaCollectionsAreRenamed.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/database/state/EnsureMediaCollectionsAreRenamed.php b/packages/core/database/state/EnsureMediaCollectionsAreRenamed.php index 9701b71553..3993a6bea0 100644 --- a/packages/core/database/state/EnsureMediaCollectionsAreRenamed.php +++ b/packages/core/database/state/EnsureMediaCollectionsAreRenamed.php @@ -35,7 +35,7 @@ protected function shouldRun() protected function getOutdatedMediaQuery() { return DB::table(app(config('media-library.media_model'))->getTable()) - ->whereIn('model_type', [Product::class, Collection::class, Brand::class]) + ->whereIn('model_type', [Product::morphName(), Collection::morphName(), Brand::morphName()]) ->where('collection_name', 'products'); } } From b4418b854fa7a24910d77e10f39a0cc11bfbd11a Mon Sep 17 00:00:00 2001 From: Ryan Mitchell Date: Mon, 21 Oct 2024 08:10:49 +0100 Subject: [PATCH 21/35] Fix unsupported operand type on discounts (#1984) --- packages/core/src/DiscountTypes/AbstractDiscountType.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/DiscountTypes/AbstractDiscountType.php b/packages/core/src/DiscountTypes/AbstractDiscountType.php index 8e0d3305b5..868313bb49 100644 --- a/packages/core/src/DiscountTypes/AbstractDiscountType.php +++ b/packages/core/src/DiscountTypes/AbstractDiscountType.php @@ -64,7 +64,7 @@ protected function checkDiscountConditions(Cart $cart): bool $validCoupon = $cartCoupon ? ($cartCoupon === $conditionCoupon) : blank($conditionCoupon); - $minSpend = ($data['min_prices'][$cart->currency->code] ?? 0) / $cart->currency->factor; + $minSpend = (int) ($data['min_prices'][$cart->currency->code] ?? 0) / (int) $cart->currency->factor; $minSpend = (int) bcmul($minSpend, $cart->currency->factor); $lines = $this->getEligibleLines($cart); From 5266054468e09de4994427bfa61c5331ab9bea6f Mon Sep 17 00:00:00 2001 From: Aidas Klimas Date: Tue, 22 Oct 2024 14:56:48 +0800 Subject: [PATCH 22/35] Fix create product url (#1999) same as https://github.com/lunarphp/lunar/pull/1995 Co-authored-by: Aidas Klimas --- .../Filament/Resources/ProductResource/Pages/ListProducts.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/admin/src/Filament/Resources/ProductResource/Pages/ListProducts.php b/packages/admin/src/Filament/Resources/ProductResource/Pages/ListProducts.php index f02e59b67f..f994e004ee 100644 --- a/packages/admin/src/Filament/Resources/ProductResource/Pages/ListProducts.php +++ b/packages/admin/src/Filament/Resources/ProductResource/Pages/ListProducts.php @@ -27,7 +27,7 @@ protected function getDefaultHeaderActions(): array static::createActionFormInputs() )->using( fn (array $data, string $model) => static::createRecord($data, $model) - )->successRedirectUrl(fn (Model $record): string => route('filament.lunar.resources.products.edit', [ + )->successRedirectUrl(fn (Model $record): string => ProductResource::getUrl('edit', [ 'record' => $record, ])), ]; From d01de0dccf254ae4d63d160d8c43b0386911bef9 Mon Sep 17 00:00:00 2001 From: Ryan Mitchell Date: Mon, 28 Oct 2024 11:09:43 +0000 Subject: [PATCH 23/35] Make Product name and SKU searchable (#1986) --- .../RelationManagers/OrdersRelationManager.php | 2 +- packages/admin/src/Filament/Resources/ProductResource.php | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/admin/src/Filament/Resources/CustomerResource/RelationManagers/OrdersRelationManager.php b/packages/admin/src/Filament/Resources/CustomerResource/RelationManagers/OrdersRelationManager.php index 99b114b773..b01eea5116 100644 --- a/packages/admin/src/Filament/Resources/CustomerResource/RelationManagers/OrdersRelationManager.php +++ b/packages/admin/src/Filament/Resources/CustomerResource/RelationManagers/OrdersRelationManager.php @@ -5,8 +5,8 @@ use Filament\Tables; use Filament\Tables\Table; use Lunar\Admin\Filament\Resources\OrderResource; -use Lunar\Admin\Support\RelationManagers\BaseRelationManager; use Lunar\Admin\Filament\Resources\OrderResource\Pages\ManageOrder; +use Lunar\Admin\Support\RelationManagers\BaseRelationManager; use Lunar\Models\Order; class OrdersRelationManager extends BaseRelationManager diff --git a/packages/admin/src/Filament/Resources/ProductResource.php b/packages/admin/src/Filament/Resources/ProductResource.php index 724c09a1a9..7627d533da 100644 --- a/packages/admin/src/Filament/Resources/ProductResource.php +++ b/packages/admin/src/Filament/Resources/ProductResource.php @@ -300,7 +300,8 @@ public static function getNameTableColumn(): Tables\Columns\Column ->attributeData() ->limitedTooltip() ->limit(50) - ->label(__('lunarpanel::product.table.name.label')); + ->label(__('lunarpanel::product.table.name.label')) + ->searchable(); } public static function getSkuTableColumn(): Tables\Columns\Column @@ -323,7 +324,8 @@ public static function getSkuTableColumn(): Tables\Columns\Column }) ->listWithLineBreaks() ->limitList(1) - ->toggleable(); + ->toggleable() + ->searchable(); } public static function getDefaultRelations(): array From e97122ea4b6cd904fb1fca38f8f91a8fa0ef1520 Mon Sep 17 00:00:00 2001 From: Lionel Guichard Date: Tue, 5 Nov 2024 10:38:13 +0100 Subject: [PATCH 24/35] Fix Rule unique slug url use morph class (#1983) --- .../src/Support/Resources/Pages/ManageUrlsRelatedRecords.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/admin/src/Support/Resources/Pages/ManageUrlsRelatedRecords.php b/packages/admin/src/Support/Resources/Pages/ManageUrlsRelatedRecords.php index 3d8cc834d0..d644f000e1 100644 --- a/packages/admin/src/Support/Resources/Pages/ManageUrlsRelatedRecords.php +++ b/packages/admin/src/Support/Resources/Pages/ManageUrlsRelatedRecords.php @@ -55,7 +55,7 @@ public function form(Form $form): Form ignoreRecord: true, modifyRuleUsing: function (Unique $rule, callable $get) { return $rule - ->where('element_type', static::$model) + ->where('element_type', (new static::$model)->getMorphClass()) ->where('language_id', $get('language_id')); } ) From 0b2d76ec604760029ca25256fdffaf9d86c622a7 Mon Sep 17 00:00:00 2001 From: tvlokven <113194867+tvlokven@users.noreply.github.com> Date: Tue, 5 Nov 2024 10:43:14 +0100 Subject: [PATCH 25/35] =?UTF-8?q?Fix=20an=20issue=20where=20the=20AmountOf?= =?UTF-8?q?f=20percentage=20is=20cast=20to=20an=20int,=20even=20t=E2=80=A6?= =?UTF-8?q?=20(#2004)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The admin panel allows you to enter a decimal value when creating an AmountOff Discount with a percentage discount. However, it gets cast to an int in the AmountOff class, which results in the percentage being rounded and the discount amount being slightly off. You could argue that usually percentage discounts are given as whole numbers, but since the admin panel already supports decimal values, I think this should be changed. Fixes #2003 --------- Co-authored-by: tim Co-authored-by: Author Co-authored-by: Alec Ritson --- packages/core/src/DiscountTypes/AmountOff.php | 2 +- .../core/Unit/DiscountTypes/AmountOffTest.php | 35 +++++++++++++------ 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/packages/core/src/DiscountTypes/AmountOff.php b/packages/core/src/DiscountTypes/AmountOff.php index 105bca64e9..a915a6f48d 100644 --- a/packages/core/src/DiscountTypes/AmountOff.php +++ b/packages/core/src/DiscountTypes/AmountOff.php @@ -224,7 +224,7 @@ protected function getEligibleLines(Cart $cart): \Illuminate\Support\Collection /** * Apply the percentage to the cart line. */ - private function applyPercentage(int $value, Cart $cart): Cart + private function applyPercentage(float $value, Cart $cart): Cart { $lines = $this->getEligibleLines($cart); diff --git a/tests/core/Unit/DiscountTypes/AmountOffTest.php b/tests/core/Unit/DiscountTypes/AmountOffTest.php index 06e9a03b74..f7729fc83e 100644 --- a/tests/core/Unit/DiscountTypes/AmountOffTest.php +++ b/tests/core/Unit/DiscountTypes/AmountOffTest.php @@ -784,7 +784,16 @@ expect($lastLine->discountTotal->value)->toEqual(333); }); -test('can apply percentage discount', function () { +test('can apply percentage discount', function ( + string $coupon, + float $percentage, + int $discountTotalForOne, + int $taxTotalForOne, + int $totalForOne, + int $discountTotalForTwo, + int $taxTotalForTwo, + int $totalForTwo +) { $customerGroup = CustomerGroup::getDefault(); $channel = Channel::getDefault(); @@ -794,7 +803,7 @@ $cart = Cart::factory()->create([ 'channel_id' => $channel->id, 'currency_id' => $currency->id, - 'coupon_code' => '10PERCENTOFF', + 'coupon_code' => $coupon, ]); $purchasable = ProductVariant::factory()->create(); @@ -816,9 +825,9 @@ $discount = Discount::factory()->create([ 'type' => AmountOff::class, 'name' => 'Test Coupon', - 'coupon' => '10PERCENTOFF', + 'coupon' => $coupon, 'data' => [ - 'percentage' => 10, + 'percentage' => $percentage, 'fixed_value' => false, ], ]); @@ -843,9 +852,9 @@ $cart = $cart->calculate(); - expect($cart->discountTotal->value)->toEqual(100); - expect($cart->taxTotal->value)->toEqual(180); - expect($cart->total->value)->toEqual(1080); + expect($cart->discountTotal->value)->toEqual($discountTotalForOne); + expect($cart->taxTotal->value)->toEqual($taxTotalForOne); + expect($cart->total->value)->toEqual($totalForOne); $cart->lines()->delete(); @@ -857,10 +866,14 @@ $cart = $cart->refresh()->calculate(); - expect($cart->discountTotal->value)->toEqual(200); - expect($cart->taxTotal->value)->toEqual(360); - expect($cart->total->value)->toEqual(2160); -}); + expect($cart->discountTotal->value)->toEqual($discountTotalForTwo); + expect($cart->taxTotal->value)->toEqual($taxTotalForTwo); + expect($cart->total->value)->toEqual($totalForTwo); +})->with([ + '10% Discount' => ['10PERCENTOFF', 10, 100, 180, 1080, 200, 360, 2160], + '10.25% Discount' => ['10PT25PERCENTOFF', 10.25, 103, 179, 1076, 205, 359, 2154], + '10.5% Discount' => ['10PT5PERCENTOFF', 10.5, 105, 179, 1074, 210, 358, 2148], +]); test('can only same discount to line once', function () { $customerGroup = CustomerGroup::getDefault(); From 4635e1c06c2263c0188a545065a727b4f2045d3c Mon Sep 17 00:00:00 2001 From: Andrea De Luca <53230888+se09deluca@users.noreply.github.com> Date: Thu, 7 Nov 2024 09:52:15 +0100 Subject: [PATCH 26/35] Fix: typo in blade variable name (#2015) The pdf/order.blade.php file expects the variable that holds the order data to be named 'record'. 'order' should be the old variable name (before 1.x) --- .../src/Filament/Resources/OrderResource/Pages/EditOrder.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/admin/src/Filament/Resources/OrderResource/Pages/EditOrder.php b/packages/admin/src/Filament/Resources/OrderResource/Pages/EditOrder.php index 7faee4a2f4..818581b64c 100644 --- a/packages/admin/src/Filament/Resources/OrderResource/Pages/EditOrder.php +++ b/packages/admin/src/Filament/Resources/OrderResource/Pages/EditOrder.php @@ -44,7 +44,7 @@ protected function getDefaultHeaderActions(): array return response()->streamDownload(function () { echo Pdf::loadView('lunarpanel::pdf.order', [ - 'order' => $this->record, + 'record' => $this->record, ])->stream(); }, name: "Order-{$this->record->reference}.pdf"); }), From 4edc13d0f571776df9d182f064170ae830017af6 Mon Sep 17 00:00:00 2001 From: wychoong <67364036+wychoong@users.noreply.github.com> Date: Wed, 20 Nov 2024 06:24:29 +0800 Subject: [PATCH 27/35] Fix: panel Attributes field exclude section/group with empty attributes (#2020) **before** ![image](https://github.com/user-attachments/assets/26dcff52-f662-498e-aab9-541baee0d606) --------- Co-authored-by: Author --- packages/admin/src/Support/Forms/Components/Attributes.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/admin/src/Support/Forms/Components/Attributes.php b/packages/admin/src/Support/Forms/Components/Attributes.php index 429b3fde61..4f474aa802 100644 --- a/packages/admin/src/Support/Forms/Components/Attributes.php +++ b/packages/admin/src/Support/Forms/Components/Attributes.php @@ -61,7 +61,8 @@ protected function setUp(): void 'model' => $group, 'fields' => $attributes->groupBy('attribute_group_id')->get($group->id, []), ]; - }); + }) + ->filter(fn ($group) => count($group['fields'])); $groupComponents = []; From 6ec0b6ed07c2fa50f85eb53801da9416d445f988 Mon Sep 17 00:00:00 2001 From: Ryan Mitchell Date: Tue, 19 Nov 2024 22:26:18 +0000 Subject: [PATCH 28/35] Make discount name searchable (#2017) Currently the discount listing in the admin panel is unsearchable as there is no indexer set up and none of the fields are searchable so the database has nothing to do. This PR adds searchable to the name field. --- packages/admin/src/Filament/Resources/DiscountResource.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/admin/src/Filament/Resources/DiscountResource.php b/packages/admin/src/Filament/Resources/DiscountResource.php index 82b052e342..8eff546762 100644 --- a/packages/admin/src/Filament/Resources/DiscountResource.php +++ b/packages/admin/src/Filament/Resources/DiscountResource.php @@ -361,7 +361,8 @@ protected static function getTableColumns(): array \Lunar\Models\Discount::SCHEDULED => 'info', }), Tables\Columns\TextColumn::make('name') - ->label(__('lunarpanel::discount.table.name.label')), + ->label(__('lunarpanel::discount.table.name.label')) + ->searchable(), Tables\Columns\TextColumn::make('type') ->formatStateUsing(function ($state) { return (new $state)->getName(); From ae02fbc06090c51e66d5ec275613a0730fc0e300 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20L=C3=B3pez=20Pesa?= Date: Tue, 19 Nov 2024 23:42:20 +0100 Subject: [PATCH 29/35] Add Spanish localization files (#2009) This commit introduces new Spanish localization files for various components within the admin and shipping packages. These include translation strings for customer groups, product variants, shipping methods, and more, etc... --------- Co-authored-by: Glenn Jacobs --- packages/admin/resources/lang/es/actions.php | 46 +++ packages/admin/resources/lang/es/activity.php | 29 ++ packages/admin/resources/lang/es/address.php | 93 +++++ .../admin/resources/lang/es/attribute.php | 55 +++ .../resources/lang/es/attributegroup.php | 46 +++ packages/admin/resources/lang/es/auth.php | 32 ++ packages/admin/resources/lang/es/brand.php | 72 ++++ packages/admin/resources/lang/es/channel.php | 39 +++ .../admin/resources/lang/es/collection.php | 45 +++ .../resources/lang/es/collectiongroup.php | 37 ++ .../admin/resources/lang/es/components.php | 109 ++++++ packages/admin/resources/lang/es/currency.php | 51 +++ packages/admin/resources/lang/es/customer.php | 63 ++++ .../admin/resources/lang/es/customergroup.php | 40 +++ packages/admin/resources/lang/es/discount.php | 324 ++++++++++++++++++ .../admin/resources/lang/es/fieldtypes.php | 72 ++++ packages/admin/resources/lang/es/global.php | 12 + packages/admin/resources/lang/es/language.php | 33 ++ packages/admin/resources/lang/es/order.php | 292 ++++++++++++++++ packages/admin/resources/lang/es/product.php | 121 +++++++ .../admin/resources/lang/es/productoption.php | 124 +++++++ .../admin/resources/lang/es/producttype.php | 52 +++ .../resources/lang/es/productvariant.php | 105 ++++++ .../resources/lang/es/relationmanagers.php | 262 ++++++++++++++ packages/admin/resources/lang/es/staff.php | 81 +++++ packages/admin/resources/lang/es/tag.php | 21 ++ packages/admin/resources/lang/es/taxclass.php | 27 ++ packages/admin/resources/lang/es/taxrate.php | 33 ++ packages/admin/resources/lang/es/taxzone.php | 69 ++++ packages/admin/resources/lang/es/user.php | 29 ++ packages/admin/resources/lang/es/widgets.php | 118 +++++++ packages/core/resources/lang/es/base.php | 9 + .../core/resources/lang/es/exceptions.php | 21 ++ .../resources/lang/es/plugin.php | 7 + .../resources/lang/es/relationmanagers.php | 77 +++++ .../lang/es/shippingexclusionlist.php | 19 + .../resources/lang/es/shippingmethod.php | 58 ++++ .../resources/lang/es/shippingzone.php | 50 +++ 38 files changed, 2773 insertions(+) create mode 100644 packages/admin/resources/lang/es/actions.php create mode 100644 packages/admin/resources/lang/es/activity.php create mode 100644 packages/admin/resources/lang/es/address.php create mode 100644 packages/admin/resources/lang/es/attribute.php create mode 100644 packages/admin/resources/lang/es/attributegroup.php create mode 100644 packages/admin/resources/lang/es/auth.php create mode 100644 packages/admin/resources/lang/es/brand.php create mode 100644 packages/admin/resources/lang/es/channel.php create mode 100644 packages/admin/resources/lang/es/collection.php create mode 100644 packages/admin/resources/lang/es/collectiongroup.php create mode 100644 packages/admin/resources/lang/es/components.php create mode 100644 packages/admin/resources/lang/es/currency.php create mode 100644 packages/admin/resources/lang/es/customer.php create mode 100644 packages/admin/resources/lang/es/customergroup.php create mode 100644 packages/admin/resources/lang/es/discount.php create mode 100644 packages/admin/resources/lang/es/fieldtypes.php create mode 100644 packages/admin/resources/lang/es/global.php create mode 100644 packages/admin/resources/lang/es/language.php create mode 100644 packages/admin/resources/lang/es/order.php create mode 100644 packages/admin/resources/lang/es/product.php create mode 100644 packages/admin/resources/lang/es/productoption.php create mode 100644 packages/admin/resources/lang/es/producttype.php create mode 100644 packages/admin/resources/lang/es/productvariant.php create mode 100644 packages/admin/resources/lang/es/relationmanagers.php create mode 100644 packages/admin/resources/lang/es/staff.php create mode 100644 packages/admin/resources/lang/es/tag.php create mode 100644 packages/admin/resources/lang/es/taxclass.php create mode 100644 packages/admin/resources/lang/es/taxrate.php create mode 100644 packages/admin/resources/lang/es/taxzone.php create mode 100644 packages/admin/resources/lang/es/user.php create mode 100644 packages/admin/resources/lang/es/widgets.php create mode 100644 packages/core/resources/lang/es/base.php create mode 100644 packages/core/resources/lang/es/exceptions.php create mode 100644 packages/table-rate-shipping/resources/lang/es/plugin.php create mode 100644 packages/table-rate-shipping/resources/lang/es/relationmanagers.php create mode 100644 packages/table-rate-shipping/resources/lang/es/shippingexclusionlist.php create mode 100644 packages/table-rate-shipping/resources/lang/es/shippingmethod.php create mode 100644 packages/table-rate-shipping/resources/lang/es/shippingzone.php diff --git a/packages/admin/resources/lang/es/actions.php b/packages/admin/resources/lang/es/actions.php new file mode 100644 index 0000000000..fe47f95174 --- /dev/null +++ b/packages/admin/resources/lang/es/actions.php @@ -0,0 +1,46 @@ + [ + 'create_root' => [ + 'label' => 'Crear colección raíz', + ], + 'create_child' => [ + 'label' => 'Crear colección secundaria', + ], + 'move' => [ + 'label' => 'Mover colección', + ], + 'delete' => [ + 'label' => 'Eliminar', + ], + ], + 'orders' => [ + 'update_status' => [ + 'label' => 'Actualizar estado', + 'wizard' => [ + 'step_one' => [ + 'label' => 'Estado', + ], + 'step_two' => [ + 'label' => 'Correos y notificaciones', + 'no_mailers' => 'No hay correos disponibles para este estado.', + ], + 'step_three' => [ + 'label' => 'Previsualizar y guardar', + 'no_mailers' => 'No se han seleccionado correos para la previsualización.', + ], + ], + 'notification' => [ + 'label' => 'Estado del pedido actualizado', + ], + 'billing_email' => [ + 'label' => 'Correo de facturación', + ], + 'shipping_email' => [ + 'label' => 'Correo de envío', + ], + ], + + ], +]; diff --git a/packages/admin/resources/lang/es/activity.php b/packages/admin/resources/lang/es/activity.php new file mode 100644 index 0000000000..7e4aaf9ddc --- /dev/null +++ b/packages/admin/resources/lang/es/activity.php @@ -0,0 +1,29 @@ + 'Actividad', + + 'plural_label' => 'Actividades', + + 'table' => [ + 'subject' => 'Asunto', + 'description' => 'Descripción', + 'log' => 'Registro', + 'logged_at' => 'Registrado en', + 'event' => 'Evento', + 'logged_from' => 'Registrado desde', + 'logged_until' => 'Registrado hasta', + ], + + 'form' => [ + 'causer_type' => 'Tipo de causante', + 'causer_id' => 'ID del causante', + 'subject_type' => 'Tipo de asunto', + 'subject_id' => 'ID del asunto', + 'description' => 'Descripción', + 'attributes' => 'Atributos', + 'old' => 'Antiguo', + ], + +]; diff --git a/packages/admin/resources/lang/es/address.php b/packages/admin/resources/lang/es/address.php new file mode 100644 index 0000000000..424a6f7088 --- /dev/null +++ b/packages/admin/resources/lang/es/address.php @@ -0,0 +1,93 @@ + 'Dirección', + + 'plural_label' => 'Direcciones', + + 'table' => [ + 'title' => [ + 'label' => 'Título', + ], + 'first_name' => [ + 'label' => 'Nombre', + ], + 'last_name' => [ + 'label' => 'Apellido', + ], + 'company_name' => [ + 'label' => 'Nombre de la empresa', + ], + 'line_one' => [ + 'label' => 'Dirección', + ], + 'line_two' => [ + 'label' => 'Línea Dos', + ], + 'line_three' => [ + 'label' => 'Línea Tres', + ], + 'city' => [ + 'label' => 'Ciudad', + ], + 'country_id' => [ + 'label' => 'País', + ], + 'state' => [ + 'label' => 'Estado/Provincia', + ], + 'postcode' => [ + 'label' => 'Código postal', + ], + 'contact_email' => [ + 'label' => 'Correo de contacto', + ], + 'contact_phone' => [ + 'label' => 'Teléfono de contacto', + ], + ], + + 'form' => [ + 'title' => [ + 'label' => 'Título', + ], + 'first_name' => [ + 'label' => 'Nombre', + ], + 'last_name' => [ + 'label' => 'Apellido', + ], + 'company_name' => [ + 'label' => 'Nombre de la empresa', + ], + 'line_one' => [ + 'label' => 'Línea Uno', + ], + 'line_two' => [ + 'label' => 'Línea Dos', + ], + 'line_three' => [ + 'label' => 'Línea Tres', + ], + 'city' => [ + 'label' => 'Ciudad', + ], + 'country_id' => [ + 'label' => 'País', + ], + 'state' => [ + 'label' => 'Estado/Provincia', + ], + 'postcode' => [ + 'label' => 'Código postal', + ], + 'contact_email' => [ + 'label' => 'Correo de contacto', + ], + 'contact_phone' => [ + 'label' => 'Teléfono de contacto', + ], + ], + +]; diff --git a/packages/admin/resources/lang/es/attribute.php b/packages/admin/resources/lang/es/attribute.php new file mode 100644 index 0000000000..5d6945f42f --- /dev/null +++ b/packages/admin/resources/lang/es/attribute.php @@ -0,0 +1,55 @@ + 'Atributo', + + 'plural_label' => 'Atributos', + + 'table' => [ + 'name' => [ + 'label' => 'Nombre', + ], + 'description' => [ + 'label' => 'Descripción', + ], + 'handle' => [ + 'label' => 'Identificador', + ], + 'type' => [ + 'label' => 'Tipo', + ], + ], + + 'form' => [ + 'attributable_type' => [ + 'label' => 'Tipo', + ], + 'name' => [ + 'label' => 'Nombre', + ], + 'description' => [ + 'label' => 'Descripción', + 'helper' => 'Se usa para mostrar el texto de ayuda debajo de la entrada', + ], + 'handle' => [ + 'label' => 'Identificador', + ], + 'searchable' => [ + 'label' => 'Buscable', + ], + 'filterable' => [ + 'label' => 'Filtrable', + ], + 'required' => [ + 'label' => 'Requerido', + ], + 'type' => [ + 'label' => 'Tipo', + ], + 'validation_rules' => [ + 'label' => 'Reglas de validación', + 'helper' => 'Reglas para el campo de atributo, ejemplo: min:1|max:10|...', + ], + ], +]; diff --git a/packages/admin/resources/lang/es/attributegroup.php b/packages/admin/resources/lang/es/attributegroup.php new file mode 100644 index 0000000000..785ad2fe8d --- /dev/null +++ b/packages/admin/resources/lang/es/attributegroup.php @@ -0,0 +1,46 @@ + 'Grupo de Atributos', + + 'plural_label' => 'Grupos de Atributos', + + 'table' => [ + 'attributable_type' => [ + 'label' => 'Tipo', + ], + 'name' => [ + 'label' => 'Nombre', + ], + 'handle' => [ + 'label' => 'Identificador', + ], + 'position' => [ + 'label' => 'Posición', + ], + ], + + 'form' => [ + 'attributable_type' => [ + 'label' => 'Tipo', + ], + 'name' => [ + 'label' => 'Nombre', + ], + 'handle' => [ + 'label' => 'Identificador', + ], + 'position' => [ + 'label' => 'Posición', + ], + ], + + 'action' => [ + 'delete' => [ + 'notification' => [ + 'error_protected' => 'Este grupo de atributos no puede ser eliminado porque tiene atributos asociados.', + ], + ], + ], +]; diff --git a/packages/admin/resources/lang/es/auth.php b/packages/admin/resources/lang/es/auth.php new file mode 100644 index 0000000000..5c73f08cce --- /dev/null +++ b/packages/admin/resources/lang/es/auth.php @@ -0,0 +1,32 @@ + 'Administrador', + 'roles.admin.description' => 'Administrador con acceso completo', + 'roles.staff.label' => 'Personal', + 'roles.staff.description' => 'Personal con acceso fundamental', + /** + * Permisos. + */ + 'permissions.settings.label' => 'Configuraciones', + 'permissions.settings.description' => 'Otorga acceso al área de configuraciones del centro', + 'permissions.settings:core.label' => 'Configuraciones Principales', + 'permissions.settings:core.description' => 'Acceso a configuraciones fundamentales de la tienda, como canales, idiomas, monedas, etc.', + 'permissions.settings:manage-staff.label' => 'Gestionar Personal', + 'permissions.settings:manage-staff.description' => 'Permite al miembro del personal editar a otros miembros del personal', + 'permissions.settings:manage-attributes.label' => 'Gestionar Atributos', + 'permissions.settings:manage-attributes.description' => 'Permite al miembro del personal editar y crear atributos adicionales', + 'permissions.catalog:manage-products.label' => 'Gestionar Productos', + 'permissions.catalog:manage-products.description' => 'Permite al miembro del personal editar productos, tipos de productos y marcas', + 'permissions.catalog:manage-collections.label' => 'Gestionar Colecciones', + 'permissions.catalog:manage-collections.description' => 'Permite al miembro del personal editar colecciones y sus grupos', + 'permissions.sales:manage-orders.label' => 'Gestionar Pedidos', + 'permissions.sales:manage-orders.description' => 'Permite al miembro del personal gestionar pedidos', + 'permissions.sales:manage-customers.label' => 'Gestionar Clientes', + 'permissions.sales:manage-customers.description' => 'Permite al miembro del personal gestionar clientes', + 'permissions.sales:manage-discounts.label' => 'Gestionar Descuentos', + 'permissions.sales:manage-discounts.description' => 'Permite al miembro del personal gestionar descuentos', +]; diff --git a/packages/admin/resources/lang/es/brand.php b/packages/admin/resources/lang/es/brand.php new file mode 100644 index 0000000000..72bfc11790 --- /dev/null +++ b/packages/admin/resources/lang/es/brand.php @@ -0,0 +1,72 @@ + 'Marca', + + 'plural_label' => 'Marcas', + + 'table' => [ + 'name' => [ + 'label' => 'Nombre', + ], + 'products_count' => [ + 'label' => 'N.º de productos', + ], + ], + + 'form' => [ + 'name' => [ + 'label' => 'Nombre', + ], + ], + + 'action' => [ + 'delete' => [ + 'notification' => [ + 'error_protected' => 'Esta marca no puede ser eliminada porque tiene productos asociados.', + ], + ], + ], + 'pages' => [ + 'products' => [ + 'label' => 'Productos', + 'actions' => [ + 'attach' => [ + 'label' => 'Asociar un producto', + 'form' => [ + 'record_id' => [ + 'label' => 'Producto', + ], + ], + 'notification' => [ + 'success' => 'Producto asociado a la marca', + ], + ], + 'detach' => [ + 'notification' => [ + 'success' => 'Producto desasociado.', + ], + ], + ], + ], + 'collections' => [ + 'label' => 'Colecciones', + 'table' => [ + 'header_actions' => [ + 'attach' => [ + 'record_select' => [ + 'placeholder' => 'Seleccionar una colección', + ], + ], + ], + ], + 'actions' => [ + 'attach' => [ + 'label' => 'Asociar una colección', + ], + ], + ], + ], + +]; diff --git a/packages/admin/resources/lang/es/channel.php b/packages/admin/resources/lang/es/channel.php new file mode 100644 index 0000000000..1df11a96f2 --- /dev/null +++ b/packages/admin/resources/lang/es/channel.php @@ -0,0 +1,39 @@ + 'Canal', + + 'plural_label' => 'Canales', + + 'table' => [ + 'name' => [ + 'label' => 'Nombre', + ], + 'handle' => [ + 'label' => 'Identificador', + ], + 'url' => [ + 'label' => 'URL', + ], + 'default' => [ + 'label' => 'Predeterminado', + ], + ], + + 'form' => [ + 'name' => [ + 'label' => 'Nombre', + ], + 'handle' => [ + 'label' => 'Identificador', + ], + 'url' => [ + 'label' => 'URL', + ], + 'default' => [ + 'label' => 'Predeterminado', + ], + ], + +]; diff --git a/packages/admin/resources/lang/es/collection.php b/packages/admin/resources/lang/es/collection.php new file mode 100644 index 0000000000..2714530c8c --- /dev/null +++ b/packages/admin/resources/lang/es/collection.php @@ -0,0 +1,45 @@ + 'Colección', + + 'plural_label' => 'Colecciones', + + 'form' => [ + 'name' => [ + 'label' => 'Nombre', + ], + ], + + 'pages' => [ + 'children' => [ + 'label' => 'Colecciones Hijas', + 'actions' => [ + 'create_child' => [ + 'label' => 'Crear Colección Hija', + ], + ], + 'table' => [ + 'children_count' => [ + 'label' => 'N.º Hijas', + ], + 'name' => [ + 'label' => 'Nombre', + ], + ], + ], + 'edit' => [ + 'label' => 'Información Básica', + ], + 'products' => [ + 'label' => 'Productos', + 'actions' => [ + 'attach' => [ + 'label' => 'Asociar Producto', + ], + ], + ], + ], + +]; diff --git a/packages/admin/resources/lang/es/collectiongroup.php b/packages/admin/resources/lang/es/collectiongroup.php new file mode 100644 index 0000000000..15fde58348 --- /dev/null +++ b/packages/admin/resources/lang/es/collectiongroup.php @@ -0,0 +1,37 @@ + 'Grupo de Colecciones', + + 'plural_label' => 'Grupos de Colecciones', + + 'table' => [ + 'name' => [ + 'label' => 'Nombre', + ], + 'handle' => [ + 'label' => 'Identificador', + ], + 'collections_count' => [ + 'label' => 'N.º Colecciones', + ], + ], + + 'form' => [ + 'name' => [ + 'label' => 'Nombre', + ], + 'handle' => [ + 'label' => 'Identificador', + ], + ], + + 'action' => [ + 'delete' => [ + 'notification' => [ + 'error_protected' => 'Este grupo de colecciones no puede ser eliminado porque tiene colecciones asociadas.', + ], + ], + ], +]; diff --git a/packages/admin/resources/lang/es/components.php b/packages/admin/resources/lang/es/components.php new file mode 100644 index 0000000000..cb56c5cf4b --- /dev/null +++ b/packages/admin/resources/lang/es/components.php @@ -0,0 +1,109 @@ + [ + 'notification' => [ + 'updated' => 'Etiquetas actualizadas', + ], + ], + + 'activity-log' => [ + 'input' => [ + 'placeholder' => 'Agregar un comentario', + ], + + 'action' => [ + 'add-comment' => 'Agregar Comentario', + ], + + 'system' => 'Sistema', + + 'partials' => [ + 'orders' => [ + 'order_created' => 'Pedido Creado', + + 'status_change' => 'Estado actualizado', + + 'capture' => 'Pago de :amount con tarjeta terminando en :last_four', + + 'authorized' => 'Autorizado de :amount con tarjeta terminando en :last_four', + + 'refund' => 'Reembolso de :amount con tarjeta terminando en :last_four', + + 'address' => ':type actualizado', + + 'billingAddress' => 'Dirección de facturación', + + 'shippingAddress' => 'Dirección de envío', + ], + + 'update' => [ + 'updated' => ':model actualizado', + ], + + 'create' => [ + 'created' => ':model creado', + ], + + 'tags' => [ + 'updated' => 'Etiquetas actualizadas', + 'added' => 'Agregado', + 'removed' => 'Eliminado', + ], + ], + + 'notification' => [ + 'comment_added' => 'Comentario agregado', + ], + ], + + 'forms' => [ + 'youtube' => [ + 'helperText' => 'Ingresa el ID del video de YouTube. ej. dQw4w9WgXcQ', + ], + ], + + 'collection-tree-view' => [ + 'actions' => [ + 'move' => [ + 'form' => [ + 'target_id' => [ + 'label' => 'Colección Padre', + ], + ], + ], + ], + 'notifications' => [ + 'collections-reordered' => [ + 'success' => 'Colecciones Reordenadas', + ], + 'node-expanded' => [ + 'danger' => 'No se pueden cargar las colecciones', + ], + 'delete' => [ + 'danger' => 'No se puede eliminar la colección', + ], + ], + ], + + 'product-options-list' => [ + 'add-option' => [ + 'label' => 'Agregar Opción', + ], + 'delete-option' => [ + 'label' => 'Eliminar Opción', + ], + 'remove-shared-option' => [ + 'label' => 'Eliminar Opción Compartida', + ], + 'add-value' => [ + 'label' => 'Agregar Otro Valor', + ], + 'name' => [ + 'label' => 'Nombre', + ], + 'values' => [ + 'label' => 'Valores', + ], + ], +]; diff --git a/packages/admin/resources/lang/es/currency.php b/packages/admin/resources/lang/es/currency.php new file mode 100644 index 0000000000..653a95842b --- /dev/null +++ b/packages/admin/resources/lang/es/currency.php @@ -0,0 +1,51 @@ + 'Moneda', + + 'plural_label' => 'Monedas', + + 'table' => [ + 'name' => [ + 'label' => 'Nombre', + ], + 'code' => [ + 'label' => 'Código', + ], + 'exchange_rate' => [ + 'label' => 'Tasa de Cambio', + ], + 'decimal_places' => [ + 'label' => 'Decimales', + ], + 'enabled' => [ + 'label' => 'Habilitado', + ], + 'default' => [ + 'label' => 'Predeterminado', + ], + ], + + 'form' => [ + 'name' => [ + 'label' => 'Nombre', + ], + 'code' => [ + 'label' => 'Código', + ], + 'exchange_rate' => [ + 'label' => 'Tasa de Cambio', + ], + 'decimal_places' => [ + 'label' => 'Decimales', + ], + 'enabled' => [ + 'label' => 'Habilitado', + ], + 'default' => [ + 'label' => 'Predeterminado', + ], + ], + +]; diff --git a/packages/admin/resources/lang/es/customer.php b/packages/admin/resources/lang/es/customer.php new file mode 100644 index 0000000000..341ac80497 --- /dev/null +++ b/packages/admin/resources/lang/es/customer.php @@ -0,0 +1,63 @@ + 'Cliente', + + 'plural_label' => 'Clientes', + + 'table' => [ + 'full_name' => [ + 'label' => 'Nombre', + ], + 'first_name' => [ + 'label' => 'Nombre', + ], + 'last_name' => [ + 'label' => 'Apellido', + ], + 'title' => [ + 'label' => 'Título', + ], + 'company_name' => [ + 'label' => 'Nombre de la Empresa', + ], + 'vat_no' => [ + 'label' => 'NIF', + ], + 'account_reference' => [ + 'label' => 'Referencia de Cuenta', + ], + 'new' => [ + 'label' => 'Nuevo', + ], + 'returning' => [ + 'label' => 'Recurrente', + ], + ], + + 'form' => [ + 'title' => [ + 'label' => 'Título', + ], + 'first_name' => [ + 'label' => 'Nombre', + ], + 'last_name' => [ + 'label' => 'Apellido', + ], + 'company_name' => [ + 'label' => 'Nombre de la Empresa', + ], + 'account_ref' => [ + 'label' => 'Referencia de Cuenta', + ], + 'vat_no' => [ + 'label' => 'NIF', + ], + 'customer_groups' => [ + 'label' => 'Grupos de Clientes', + ], + ], + +]; diff --git a/packages/admin/resources/lang/es/customergroup.php b/packages/admin/resources/lang/es/customergroup.php new file mode 100644 index 0000000000..d8d5c5e0e9 --- /dev/null +++ b/packages/admin/resources/lang/es/customergroup.php @@ -0,0 +1,40 @@ + 'Grupo de Clientes', + + 'plural_label' => 'Grupos de Clientes', + + 'table' => [ + 'name' => [ + 'label' => 'Nombre', + ], + 'handle' => [ + 'label' => 'Identificador', + ], + 'default' => [ + 'label' => 'Predeterminado', + ], + ], + + 'form' => [ + 'name' => [ + 'label' => 'Nombre', + ], + 'handle' => [ + 'label' => 'Identificador', + ], + 'default' => [ + 'label' => 'Predeterminado', + ], + ], + + 'action' => [ + 'delete' => [ + 'notification' => [ + 'error_protected' => 'Este grupo de clientes no puede ser eliminado ya que hay clientes asociados.', + ], + ], + ], +]; diff --git a/packages/admin/resources/lang/es/discount.php b/packages/admin/resources/lang/es/discount.php new file mode 100644 index 0000000000..4f9e051c5f --- /dev/null +++ b/packages/admin/resources/lang/es/discount.php @@ -0,0 +1,324 @@ + 'Descuentos', + 'label' => 'Descuento', + 'form' => [ + 'conditions' => [ + 'heading' => 'Condiciones', + ], + 'buy_x_get_y' => [ + 'heading' => 'Compra X Obtén Y', + ], + 'amount_off' => [ + 'heading' => 'Cantidad Descontada', + ], + 'name' => [ + 'label' => 'Nombre', + ], + 'handle' => [ + 'label' => 'Identificador', + ], + 'starts_at' => [ + 'label' => 'Fecha de Inicio', + ], + 'ends_at' => [ + 'label' => 'Fecha de Fin', + ], + 'priority' => [ + 'label' => 'Prioridad', + 'helper_text' => 'Los descuentos con mayor prioridad se aplicarán primero.', + 'options' => [ + 'low' => [ + 'label' => 'Baja', + ], + 'medium' => [ + 'label' => 'Media', + ], + 'high' => [ + 'label' => 'Alta', + ], + ], + ], + 'stop' => [ + 'label' => 'Detener otros descuentos después de este', + ], + 'coupon' => [ + 'label' => 'Cupón', + 'helper_text' => 'Introduce el cupón necesario para que se aplique el descuento, si se deja en blanco se aplicará automáticamente.', + ], + 'max_uses' => [ + 'label' => 'Máximo de usos', + 'helper_text' => 'Deja en blanco para usos ilimitados.', + ], + 'max_uses_per_user' => [ + 'label' => 'Máximo de usos por usuario', + 'helper_text' => 'Deja en blanco para usos ilimitados.', + ], + 'minimum_cart_amount' => [ + 'label' => 'Monto Mínimo del Carrito', + ], + 'min_qty' => [ + 'label' => 'Cantidad de Producto', + 'helper_text' => 'Establece cuántos productos calificativos son necesarios para que se aplique el descuento.', + ], + 'reward_qty' => [ + 'label' => 'No. de artículos gratuitos', + 'helper_text' => 'Cuántos de cada artículo tienen descuento.', + ], + 'max_reward_qty' => [ + 'label' => 'Cantidad máxima de recompensa', + 'helper_text' => 'La cantidad máxima de productos que se pueden descontar, independientemente de los criterios.', + ], + 'automatic_rewards' => [ + 'label' => 'Agregar recompensas automáticamente', + 'helper_text' => 'Activa para agregar productos de recompensa cuando no estén presentes en el carrito.', + ], + ], + 'table' => [ + 'name' => [ + 'label' => 'Nombre', + ], + 'status' => [ + 'label' => 'Estado', + \Lunar\Models\Discount::ACTIVE => [ + 'label' => 'Activo', + ], + \Lunar\Models\Discount::PENDING => [ + 'label' => 'Pendiente', + ], + \Lunar\Models\Discount::EXPIRED => [ + 'label' => 'Expirado', + ], + \Lunar\Models\Discount::SCHEDULED => [ + 'label' => 'Programado', + ], + ], + 'type' => [ + 'label' => 'Tipo', + ], + 'starts_at' => [ + 'label' => 'Fecha de Inicio', + ], + 'ends_at' => [ + 'label' => 'Fecha de Fin', + ], + ], + 'pages' => [ + 'availability' => [ + 'label' => 'Disponibilidad', + ], + 'limitations' => [ + 'label' => 'Limitaciones', + ], + ], + 'relationmanagers' => [ + 'collections' => [ + 'title' => 'Colecciones', + 'description' => 'Selecciona a qué colecciones se debe limitar este descuento.', + 'actions' => [ + 'attach' => [ + 'label' => 'Adjuntar Colección', + ], + ], + 'table' => [ + 'name' => [ + 'label' => 'Nombre', + ], + 'type' => [ + 'label' => 'Tipo', + 'limitation' => [ + 'label' => 'Limitación', + ], + 'exclusion' => [ + 'label' => 'Exclusión', + ], + ], + ], + 'form' => [ + 'type' => [ + 'options' => [ + 'limitation' => [ + 'label' => 'Limitación', + ], + 'exclusion' => [ + 'label' => 'Exclusión', + ], + ], + ], + ], + ], + 'brands' => [ + 'title' => 'Marcas', + 'description' => 'Selecciona a qué marcas se debe limitar este descuento.', + 'actions' => [ + 'attach' => [ + 'label' => 'Adjuntar Marca', + ], + ], + 'table' => [ + 'name' => [ + 'label' => 'Nombre', + ], + 'type' => [ + 'label' => 'Tipo', + 'limitation' => [ + 'label' => 'Limitación', + ], + 'exclusion' => [ + 'label' => 'Exclusión', + ], + ], + ], + 'form' => [ + 'type' => [ + 'options' => [ + 'limitation' => [ + 'label' => 'Limitación', + ], + 'exclusion' => [ + 'label' => 'Exclusión', + ], + ], + ], + ], + ], + 'products' => [ + 'title' => 'Productos', + 'description' => 'Selecciona a qué productos se debe limitar este descuento.', + 'actions' => [ + 'attach' => [ + 'label' => 'Agregar Producto', + ], + ], + 'table' => [ + 'name' => [ + 'label' => 'Nombre', + ], + 'type' => [ + 'label' => 'Tipo', + 'limitation' => [ + 'label' => 'Limitación', + ], + 'exclusion' => [ + 'label' => 'Exclusión', + ], + ], + ], + 'form' => [ + 'type' => [ + 'options' => [ + 'limitation' => [ + 'label' => 'Limitación', + ], + 'exclusion' => [ + 'label' => 'Exclusión', + ], + ], + ], + ], + ], + 'rewards' => [ + 'title' => 'Recompensas de Productos', + 'description' => 'Selecciona qué productos serán descontados si existen en el carrito y se cumplen las condiciones anteriores.', + 'actions' => [ + 'attach' => [ + 'label' => 'Agregar Producto', + ], + ], + 'table' => [ + 'name' => [ + 'label' => 'Nombre', + ], + 'type' => [ + 'label' => 'Tipo', + 'limitation' => [ + 'label' => 'Limitación', + ], + 'exclusion' => [ + 'label' => 'Exclusión', + ], + ], + ], + 'form' => [ + 'type' => [ + 'options' => [ + 'limitation' => [ + 'label' => 'Limitación', + ], + 'exclusion' => [ + 'label' => 'Exclusión', + ], + ], + ], + ], + ], + 'conditions' => [ + 'title' => 'Condiciones de Producto', + 'description' => 'Selecciona los productos necesarios para que se aplique el descuento.', + 'actions' => [ + 'attach' => [ + 'label' => 'Agregar Producto', + ], + ], + 'table' => [ + 'name' => [ + 'label' => 'Nombre', + ], + 'type' => [ + 'label' => 'Tipo', + 'limitation' => [ + 'label' => 'Limitación', + ], + 'exclusion' => [ + 'label' => 'Exclusión', + ], + ], + ], + 'form' => [ + 'type' => [ + 'options' => [ + 'limitation' => [ + 'label' => 'Limitación', + ], + 'exclusion' => [ + 'label' => 'Exclusión', + ], + ], + ], + ], + ], + 'productvariants' => [ + 'title' => 'Variantes de Productos', + 'description' => 'Selecciona qué variantes de productos se debe limitar a este descuento.', + 'actions' => [ + 'attach' => [ + 'label' => 'Agregar Variante de Producto', + ], + ], + 'table' => [ + 'name' => [ + 'label' => 'Nombre', + ], + 'sku' => [ + 'label' => 'SKU', + ], + 'values' => [ + 'label' => 'Opción(es)', + ], + ], + 'form' => [ + 'type' => [ + 'options' => [ + 'limitation' => [ + 'label' => 'Limitación', + ], + 'exclusion' => [ + 'label' => 'Exclusión', + ], + ], + ], + ], + ], + ], +]; diff --git a/packages/admin/resources/lang/es/fieldtypes.php b/packages/admin/resources/lang/es/fieldtypes.php new file mode 100644 index 0000000000..021935d74c --- /dev/null +++ b/packages/admin/resources/lang/es/fieldtypes.php @@ -0,0 +1,72 @@ + [ + 'label' => 'Desplegable', + 'form' => [ + 'lookups' => [ + 'label' => 'Búsquedas', + 'key_label' => 'Etiqueta', + 'value_label' => 'Valor', + ], + ], + ], + 'listfield' => [ + 'label' => 'Campo de Lista', + ], + 'text' => [ + 'label' => 'Texto', + 'form' => [ + 'richtext' => [ + 'label' => 'Texto Enriquecido', + ], + ], + ], + 'translatedtext' => [ + 'label' => 'Texto Traducido', + 'form' => [ + 'richtext' => [ + 'label' => 'Texto Enriquecido', + ], + 'locales' => 'Locales', + ], + ], + 'toggle' => [ + 'label' => 'Activar/Desactivar', + ], + 'youtube' => [ + 'label' => 'YouTube', + ], + 'vimeo' => [ + 'label' => 'Vimeo', + ], + 'number' => [ + 'label' => 'Número', + 'form' => [ + 'min' => [ + 'label' => 'Mín.', + ], + 'max' => [ + 'label' => 'Máx.', + ], + ], + ], + 'file' => [ + 'label' => 'Archivo', + 'form' => [ + 'file_types' => [ + 'label' => 'Tipos de Archivo Permitidos', + 'placeholder' => 'Nuevo MIME', + ], + 'multiple' => [ + 'label' => 'Permitir Múltiples Archivos', + ], + 'min_files' => [ + 'label' => 'Mín. Archivos', + ], + 'max_files' => [ + 'label' => 'Máx. Archivos', + ], + ], + ], +]; diff --git a/packages/admin/resources/lang/es/global.php b/packages/admin/resources/lang/es/global.php new file mode 100644 index 0000000000..240c2cbecb --- /dev/null +++ b/packages/admin/resources/lang/es/global.php @@ -0,0 +1,12 @@ + [ + 'catalog' => 'Catálogo', + 'sales' => 'Ventas', + 'reports' => 'Informes', + 'settings' => 'Configuraciones', + ], + +]; diff --git a/packages/admin/resources/lang/es/language.php b/packages/admin/resources/lang/es/language.php new file mode 100644 index 0000000000..86a4129959 --- /dev/null +++ b/packages/admin/resources/lang/es/language.php @@ -0,0 +1,33 @@ + 'Idioma', + + 'plural_label' => 'Idiomas', + + 'table' => [ + 'name' => [ + 'label' => 'Nombre', + ], + 'code' => [ + 'label' => 'Código', + ], + 'default' => [ + 'label' => 'Predeterminado', + ], + ], + + 'form' => [ + 'name' => [ + 'label' => 'Nombre', + ], + 'code' => [ + 'label' => 'Código', + ], + 'default' => [ + 'label' => 'Predeterminado', + ], + ], + +]; diff --git a/packages/admin/resources/lang/es/order.php b/packages/admin/resources/lang/es/order.php new file mode 100644 index 0000000000..9a27272e40 --- /dev/null +++ b/packages/admin/resources/lang/es/order.php @@ -0,0 +1,292 @@ + 'Pedido', + + 'plural_label' => 'Pedidos', + + 'breadcrumb' => [ + 'manage' => 'Gestionar', + ], + + 'transactions' => [ + 'capture' => 'Capturado', + 'intent' => 'Intención', + 'refund' => 'Reembolsado', + 'failed' => 'Fallido', + ], + + 'table' => [ + 'status' => [ + 'label' => 'Estado', + ], + 'reference' => [ + 'label' => 'Referencia', + ], + 'customer_reference' => [ + 'label' => 'Referencia del Cliente', + ], + 'customer' => [ + 'label' => 'Cliente', + ], + 'tags' => [ + 'label' => 'Etiquetas', + ], + 'postcode' => [ + 'label' => 'Código Postal', + ], + 'email' => [ + 'label' => 'Correo Electrónico', + 'copy_message' => 'Dirección de correo electrónico copiada', + ], + 'phone' => [ + 'label' => 'Teléfono', + ], + 'total' => [ + 'label' => 'Total', + ], + 'date' => [ + 'label' => 'Fecha', + ], + 'new_customer' => [ + 'label' => 'Tipo de Cliente', + ], + 'placed_after' => [ + 'label' => 'Realizado después de', + ], + 'placed_before' => [ + 'label' => 'Realizado antes de', + ], + ], + + 'form' => [ + 'address' => [ + 'first_name' => [ + 'label' => 'Nombre', + ], + 'last_name' => [ + 'label' => 'Apellido', + ], + 'line_one' => [ + 'label' => 'Dirección Línea 1', + ], + 'line_two' => [ + 'label' => 'Dirección Línea 2', + ], + 'line_three' => [ + 'label' => 'Dirección Línea 3', + ], + 'company_name' => [ + 'label' => 'Nombre de la Empresa', + ], + 'contact_phone' => [ + 'label' => 'Teléfono', + ], + 'contact_email' => [ + 'label' => 'Correo Electrónico', + ], + 'city' => [ + 'label' => 'Ciudad', + ], + 'state' => [ + 'label' => 'Estado / Provincia', + ], + 'postcode' => [ + 'label' => 'Código Postal', + ], + 'country_id' => [ + 'label' => 'País', + ], + ], + + 'reference' => [ + 'label' => 'Referencia', + ], + 'status' => [ + 'label' => 'Estado', + ], + 'transaction' => [ + 'label' => 'Transacción', + ], + 'amount' => [ + 'label' => 'Cantidad', + + 'hint' => [ + 'less_than_total' => "Está a punto de capturar un monto menor al valor total de la transacción", + ], + ], + + 'notes' => [ + 'label' => 'Notas', + ], + 'confirm' => [ + 'label' => 'Confirmar', + + 'alert' => 'Se requiere confirmación', + + 'hint' => [ + 'capture' => 'Por favor confirme que desea capturar este pago', + 'refund' => 'Por favor confirme que desea reembolsar esta cantidad.', + ], + ], + ], + + 'infolist' => [ + 'notes' => [ + 'label' => 'Notas', + 'placeholder' => 'Sin notas en este pedido', + ], + 'delivery_instructions' => [ + 'label' => 'Instrucciones de Entrega', + ], + 'shipping_total' => [ + 'label' => 'Total de Envío', + ], + 'paid' => [ + 'label' => 'Pagado', + ], + 'refund' => [ + 'label' => 'Reembolso', + ], + 'unit_price' => [ + 'label' => 'Precio Unitario', + ], + 'quantity' => [ + 'label' => 'Cantidad', + ], + 'sub_total' => [ + 'label' => 'Subtotal', + ], + 'discount_total' => [ + 'label' => 'Total de Descuentos', + ], + 'total' => [ + 'label' => 'Total', + ], + 'current_stock_level' => [ + 'message' => 'Nivel de Stock Actual: :count', + ], + 'purchase_stock_level' => [ + 'message' => 'al momento de hacer el pedido: :count', + ], + 'status' => [ + 'label' => 'Estado', + ], + 'reference' => [ + 'label' => 'Referencia', + ], + 'customer_reference' => [ + 'label' => 'Referencia del Cliente', + ], + 'channel' => [ + 'label' => 'Canal', + ], + 'date_created' => [ + 'label' => 'Fecha de Creación', + ], + 'date_placed' => [ + 'label' => 'Fecha de Pedido', + ], + 'new_returning' => [ + 'label' => 'Nuevo / Recurrente', + ], + 'new_customer' => [ + 'label' => 'Nuevo Cliente', + ], + 'returning_customer' => [ + 'label' => 'Cliente Recurrente', + ], + 'shipping_address' => [ + 'label' => 'Dirección de Envío', + ], + 'billing_address' => [ + 'label' => 'Dirección de Facturación', + ], + 'address_not_set' => [ + 'label' => 'No se ha establecido dirección', + ], + 'billing_matches_shipping' => [ + 'label' => 'Igual que la dirección de envío', + ], + 'additional_info' => [ + 'label' => 'Información Adicional', + ], + 'no_additional_info' => [ + 'label' => 'Sin Información Adicional', + ], + 'tags' => [ + 'label' => 'Etiquetas', + ], + 'timeline' => [ + 'label' => 'Cronología', + ], + 'transactions' => [ + 'label' => 'Transacciones', + 'placeholder' => 'Sin transacciones', + ], + 'alert' => [ + 'requires_capture' => 'Este pedido aún requiere que se capture el pago.', + 'partially_refunded' => 'Este pedido ha sido parcialmente reembolsado.', + 'refunded' => 'Este pedido ha sido reembolsado.', + ], + ], + + 'action' => [ + 'bulk_update_status' => [ + 'label' => 'Actualizar Estado', + 'notification' => 'Estado de pedidos actualizado', + ], + 'update_status' => [ + 'new_status' => [ + 'label' => 'Nuevo estado', + ], + 'additional_content' => [ + 'label' => 'Contenido adicional', + ], + 'additional_email_recipient' => [ + 'label' => 'Destinatario adicional de correo electrónico', + 'placeholder' => 'opcional', + ], + ], + 'download_order_pdf' => [ + 'label' => 'Descargar PDF', + 'notification' => 'Descargando PDF del pedido', + ], + 'edit_address' => [ + 'label' => 'Editar', + + 'notification' => [ + 'error' => 'Error', + + 'billing_address' => [ + 'saved' => 'Dirección de facturación guardada', + ], + + 'shipping_address' => [ + 'saved' => 'Dirección de envío guardada', + ], + ], + ], + 'edit_tags' => [ + 'label' => 'Editar', + ], + 'capture_payment' => [ + 'label' => 'Capturar Pago', + + 'notification' => [ + 'error' => 'Hubo un problema con la captura', + 'success' => 'Captura exitosa', + ], + ], + 'refund_payment' => [ + 'label' => 'Reembolsar', + + 'notification' => [ + 'error' => 'Hubo un problema con el reembolso', + 'success' => 'Reembolso exitoso', + ], + ], + ], + +]; diff --git a/packages/admin/resources/lang/es/product.php b/packages/admin/resources/lang/es/product.php new file mode 100644 index 0000000000..f17797c69c --- /dev/null +++ b/packages/admin/resources/lang/es/product.php @@ -0,0 +1,121 @@ + 'Producto', + + 'plural_label' => 'Productos', + + 'status' => [ + 'unpublished' => [ + 'content' => 'Actualmente en estado de borrador, este producto está oculto en todos los canales y grupos de clientes.', + ], + 'availability' => [ + 'customer_groups' => 'Este producto actualmente no está disponible para todos los grupos de clientes.', + 'channels' => 'Este producto actualmente no está disponible para todos los canales.', + ], + ], + + 'table' => [ + 'status' => [ + 'label' => 'Estado', + 'states' => [ + 'deleted' => 'Eliminado', + 'draft' => 'Borrador', + 'published' => 'Publicado', + ], + ], + 'name' => [ + 'label' => 'Nombre', + ], + 'brand' => [ + 'label' => 'Marca', + ], + 'sku' => [ + 'label' => 'SKU', + ], + 'stock' => [ + 'label' => 'Stock', + ], + 'producttype' => [ + 'label' => 'Tipo de Producto', + ], + ], + + 'actions' => [ + 'edit_status' => [ + 'label' => 'Actualizar Estado', + 'heading' => 'Actualizar Estado', + ], + ], + + 'form' => [ + 'name' => [ + 'label' => 'Nombre', + ], + 'brand' => [ + 'label' => 'Marca', + ], + 'sku' => [ + 'label' => 'SKU', + ], + 'producttype' => [ + 'label' => 'Tipo de Producto', + ], + 'status' => [ + 'label' => 'Estado', + 'options' => [ + 'published' => [ + 'label' => 'Publicado', + 'description' => 'Este producto estará disponible en todos los grupos de clientes y canales habilitados', + ], + 'draft' => [ + 'label' => 'Borrador', + 'description' => 'Este producto estará oculto en todos los canales y grupos de clientes', + ], + ], + ], + 'tags' => [ + 'label' => 'Etiquetas', + ], + 'collections' => [ + 'label' => 'Colecciones', + ], + ], + + 'pages' => [ + 'availability' => [ + 'label' => 'Disponibilidad', + ], + 'identifiers' => [ + 'label' => 'Identificadores del Producto', + ], + 'inventory' => [ + 'label' => 'Inventario', + ], + 'pricing' => [ + 'form' => [ + 'tax_class_id' => [ + 'label' => 'Clase de Impuesto', + ], + 'tax_ref' => [ + 'label' => 'Referencia de Impuesto', + 'helper_text' => 'Opcional, para integración con sistemas de terceros.', + ], + ], + ], + 'shipping' => [ + 'label' => 'Envío', + ], + 'variants' => [ + 'label' => 'Variantes', + ], + 'collections' => [ + 'label' => 'Colecciones', + ], + 'associations' => [ + 'label' => 'Asociaciones de Productos', + ], + ], + +]; diff --git a/packages/admin/resources/lang/es/productoption.php b/packages/admin/resources/lang/es/productoption.php new file mode 100644 index 0000000000..5515f234e3 --- /dev/null +++ b/packages/admin/resources/lang/es/productoption.php @@ -0,0 +1,124 @@ + 'Opción de Producto', + + 'plural_label' => 'Opciones de Producto', + + 'table' => [ + 'name' => [ + 'label' => 'Nombre', + ], + 'label' => [ + 'label' => 'Etiqueta', + ], + 'handle' => [ + 'label' => 'Identificador', + ], + 'shared' => [ + 'label' => 'Compartido', + ], + ], + + 'form' => [ + 'name' => [ + 'label' => 'Nombre', + ], + 'label' => [ + 'label' => 'Etiqueta', + ], + 'handle' => [ + 'label' => 'Identificador', + ], + ], + + 'widgets' => [ + 'product-options' => [ + 'notifications' => [ + 'save-variants' => [ + 'success' => [ + 'title' => 'Variantes de Producto Guardadas', + ], + ], + ], + 'actions' => [ + 'cancel' => [ + 'label' => 'Cancelar', + ], + 'save-options' => [ + 'label' => 'Guardar Opciones', + ], + 'add-shared-option' => [ + 'label' => 'Agregar Opción Compartida', + 'form' => [ + 'product_option' => [ + 'label' => 'Opción de Producto', + ], + 'no_shared_components' => [ + 'label' => 'No hay opciones compartidas disponibles.', + ], + ], + ], + 'add-restricted-option' => [ + 'label' => 'Agregar Opción', + ], + ], + 'options-list' => [ + 'empty' => [ + 'heading' => 'No hay opciones de producto configuradas', + 'description' => 'Agrega una opción de producto compartida o restringida para comenzar a generar algunas variantes.', + ], + ], + 'options-table' => [ + 'title' => 'Opciones de Producto', + 'configure-options' => [ + 'label' => 'Configurar Opciones', + ], + 'table' => [ + 'option' => [ + 'label' => 'Opción', + ], + 'values' => [ + 'label' => 'Valores', + ], + ], + ], + 'variants-table' => [ + 'title' => 'Variantes de Producto', + 'actions' => [ + 'create' => [ + 'label' => 'Crear Variante', + ], + 'edit' => [ + 'label' => 'Editar', + ], + 'delete' => [ + 'label' => 'Eliminar', + ], + ], + 'empty' => [ + 'heading' => 'No Hay Variantes Configuradas', + ], + 'table' => [ + 'new' => [ + 'label' => 'NUEVO', + ], + 'option' => [ + 'label' => 'Opción', + ], + 'sku' => [ + 'label' => 'SKU', + ], + 'price' => [ + 'label' => 'Precio', + ], + 'stock' => [ + 'label' => 'Stock', + ], + ], + ], + ], + ], + +]; diff --git a/packages/admin/resources/lang/es/producttype.php b/packages/admin/resources/lang/es/producttype.php new file mode 100644 index 0000000000..6fc2112696 --- /dev/null +++ b/packages/admin/resources/lang/es/producttype.php @@ -0,0 +1,52 @@ + 'Tipo de Producto', + + 'plural_label' => 'Tipos de Producto', + + 'table' => [ + 'name' => [ + 'label' => 'Nombre', + ], + 'products_count' => [ + 'label' => 'Cantidad de Productos', + ], + 'product_attributes_count' => [ + 'label' => 'Atributos de Producto', + ], + 'variant_attributes_count' => [ + 'label' => 'Atributos de Variante', + ], + ], + + 'tabs' => [ + 'product_attributes' => [ + 'label' => 'Atributos de Producto', + ], + 'variant_attributes' => [ + 'label' => 'Atributos de Variante', + ], + ], + + 'form' => [ + 'name' => [ + 'label' => 'Nombre', + ], + ], + + 'attributes' => [ + 'no_groups' => 'No hay grupos de atributos disponibles.', + 'no_attributes' => 'No hay atributos disponibles.', + ], + + 'action' => [ + 'delete' => [ + 'notification' => [ + 'error_protected' => 'Este tipo de producto no puede ser eliminado ya que hay productos asociados.', + ], + ], + ], + +]; diff --git a/packages/admin/resources/lang/es/productvariant.php b/packages/admin/resources/lang/es/productvariant.php new file mode 100644 index 0000000000..9b030a6e51 --- /dev/null +++ b/packages/admin/resources/lang/es/productvariant.php @@ -0,0 +1,105 @@ + 'Variante de Producto', + 'plural_label' => 'Variantes de Producto', + 'pages' => [ + 'edit' => [ + 'title' => 'Información Básica', + ], + 'media' => [ + 'title' => 'Medios', + 'form' => [ + 'no_selection' => [ + 'label' => 'Actualmente no tienes una imagen seleccionada para esta variante.', + ], + 'no_media_available' => [ + 'label' => 'Actualmente no hay medios disponibles para este producto.', + ], + 'images' => [ + 'label' => 'Imagen Principal', + 'helper_text' => 'Selecciona la imagen del producto que representa esta variante.', + ], + ], + ], + 'identifiers' => [ + 'title' => 'Identificadores', + ], + 'inventory' => [ + 'title' => 'Inventario', + ], + 'shipping' => [ + 'title' => 'Envío', + ], + ], + 'form' => [ + 'sku' => [ + 'label' => 'SKU', + ], + 'gtin' => [ + 'label' => 'Número Global de Artículo Comercial (GTIN)', + ], + 'mpn' => [ + 'label' => 'Número de Parte del Fabricante (MPN)', + ], + 'ean' => [ + 'label' => 'UPC/EAN', + ], + 'stock' => [ + 'label' => 'En Stock', + ], + 'backorder' => [ + 'label' => 'En Pedido Pendiente', + ], + 'purchasable' => [ + 'label' => 'Comprabilidad', + 'options' => [ + 'always' => 'Siempre', + 'in_stock' => 'En Stock', + 'in_stock_or_on_backorder' => 'En Stock o en Pedido Pendiente', + ], + ], + 'unit_quantity' => [ + 'label' => 'Cantidad por Unidad', + 'helper_text' => 'Cuántos artículos individuales componen 1 unidad.', + ], + 'min_quantity' => [ + 'label' => 'Cantidad Mínima', + 'helper_text' => 'La cantidad mínima de una variante de producto que se puede comprar en una sola compra.', + ], + 'quantity_increment' => [ + 'label' => 'Incremento de Cantidad', + 'helper_text' => 'La variante de producto debe comprarse en múltiplos de esta cantidad.', + ], + 'tax_class_id' => [ + 'label' => 'Clase Impositiva', + ], + 'shippable' => [ + 'label' => 'Enviable', + ], + 'length_value' => [ + 'label' => 'Longitud', + ], + 'length_unit' => [ + 'label' => 'Unidad de Longitud', + ], + 'width_value' => [ + 'label' => 'Anchura', + ], + 'width_unit' => [ + 'label' => 'Unidad de Anchura', + ], + 'height_value' => [ + 'label' => 'Altura', + ], + 'height_unit' => [ + 'label' => 'Unidad de Altura', + ], + 'weight_value' => [ + 'label' => 'Peso', + ], + 'weight_unit' => [ + 'label' => 'Unidad de Peso', + ], + ], +]; diff --git a/packages/admin/resources/lang/es/relationmanagers.php b/packages/admin/resources/lang/es/relationmanagers.php new file mode 100644 index 0000000000..9342e63036 --- /dev/null +++ b/packages/admin/resources/lang/es/relationmanagers.php @@ -0,0 +1,262 @@ + [ + 'actions' => [ + 'attach' => [ + 'label' => 'Adjuntar Grupo de Clientes', + ], + ], + 'form' => [ + 'name' => [ + 'label' => 'Nombre', + ], + 'enabled' => [ + 'label' => 'Habilitado', + ], + 'starts_at' => [ + 'label' => 'Fecha de Inicio', + ], + 'ends_at' => [ + 'label' => 'Fecha de Finalización', + ], + 'visible' => [ + 'label' => 'Visible', + ], + 'purchasable' => [ + 'label' => 'Comprable', + ], + ], + 'table' => [ + 'description' => 'Asocia grupos de clientes a este :type para determinar su disponibilidad.', + 'name' => [ + 'label' => 'Nombre', + ], + 'enabled' => [ + 'label' => 'Habilitado', + ], + 'starts_at' => [ + 'label' => 'Fecha de Inicio', + ], + 'ends_at' => [ + 'label' => 'Fecha de Finalización', + ], + 'visible' => [ + 'label' => 'Visible', + ], + 'purchasable' => [ + 'label' => 'Comprable', + ], + ], + ], + 'channels' => [ + 'actions' => [ + 'attach' => [ + 'label' => 'Programar otro Canal', + ], + ], + 'form' => [ + 'enabled' => [ + 'label' => 'Habilitado', + 'helper_text_false' => 'Este canal no estará habilitado incluso si hay una fecha de inicio presente.', + ], + 'starts_at' => [ + 'label' => 'Fecha de Inicio', + 'helper_text' => 'Deja en blanco para estar disponible desde cualquier fecha.', + ], + 'ends_at' => [ + 'label' => 'Fecha de Finalización', + 'helper_text' => 'Deja en blanco para estar disponible indefinidamente.', + ], + ], + 'table' => [ + 'description' => 'Determina qué canales están habilitados y programa la disponibilidad.', + 'name' => [ + 'label' => 'Nombre', + ], + 'enabled' => [ + 'label' => 'Habilitado', + ], + 'starts_at' => [ + 'label' => 'Fecha de Inicio', + ], + 'ends_at' => [ + 'label' => 'Fecha de Finalización', + ], + ], + ], + 'medias' => [ + 'title' => 'Medios', + 'title_plural' => 'Medios', + 'actions' => [ + 'create' => [ + 'label' => 'Crear Medio', + ], + 'view' => [ + 'label' => 'Ver', + ], + ], + 'form' => [ + 'name' => [ + 'label' => 'Nombre', + ], + 'media' => [ + 'label' => 'Imagen', + ], + 'primary' => [ + 'label' => 'Primario', + ], + ], + 'table' => [ + 'image' => [ + 'label' => 'Imagen', + ], + 'file' => [ + 'label' => 'Archivo', + ], + 'name' => [ + 'label' => 'Nombre', + ], + 'primary' => [ + 'label' => 'Primario', + ], + ], + ], + 'urls' => [ + 'title' => 'URL', + 'title_plural' => 'URLs', + 'actions' => [ + 'create' => [ + 'label' => 'Crear URL', + ], + ], + 'filters' => [ + 'language_id' => [ + 'label' => 'Idioma', + ], + ], + 'form' => [ + 'slug' => [ + 'label' => 'Slug', + ], + 'default' => [ + 'label' => 'Predeterminado', + ], + 'language' => [ + 'label' => 'Idioma', + ], + ], + 'table' => [ + 'slug' => [ + 'label' => 'Slug', + ], + 'default' => [ + 'label' => 'Predeterminado', + ], + 'language' => [ + 'label' => 'Idioma', + ], + ], + ], + 'customer_group_pricing' => [ + 'title' => 'Precios de Grupo de Clientes', + 'title_plural' => 'Precios de Grupo de Clientes', + 'table' => [ + 'heading' => 'Precios de Grupo de Clientes', + 'description' => 'Asocia precios a grupos de clientes para determinar el precio del producto.', + 'empty_state' => [ + 'label' => 'No existen precios de grupos de clientes.', + 'description' => 'Crea un precio de grupo de clientes para comenzar.', + ], + 'actions' => [ + 'create' => [ + 'label' => 'Agregar Precio de Grupo de Clientes', + 'modal' => [ + 'heading' => 'Crear Precio de Grupo de Clientes', + ], + ], + ], + ], + ], + 'pricing' => [ + 'title' => 'Precios', + 'title_plural' => 'Precios', + 'tab_name' => 'Descuentos por Cantidad', + 'table' => [ + 'heading' => 'Descuentos por Cantidad', + 'description' => 'Reduce el precio cuando un cliente compra en mayores cantidades.', + 'empty_state' => [ + 'label' => 'No existen descuentos por cantidad.', + ], + 'actions' => [ + 'create' => [ + 'label' => 'Agregar Descuento por Cantidad', + ], + ], + 'price' => [ + 'label' => 'Precio', + ], + 'customer_group' => [ + 'label' => 'Grupo de Clientes', + 'placeholder' => 'Todos los Grupos de Clientes', + ], + 'min_quantity' => [ + 'label' => 'Cantidad Mínima', + ], + 'currency' => [ + 'label' => 'Moneda', + ], + ], + 'form' => [ + 'price' => [ + 'label' => 'Precio', + 'helper_text' => 'El precio de compra, antes de descuentos.', + ], + 'customer_group_id' => [ + 'label' => 'Grupo de Clientes', + 'placeholder' => 'Todos los Grupos de Clientes', + 'helper_text' => 'Selecciona a qué grupo de clientes aplicar este precio.', + ], + 'min_quantity' => [ + 'label' => 'Cantidad Mínima', + 'helper_text' => 'Selecciona la cantidad mínima para la que estará disponible este precio.', + 'validation' => [ + 'unique' => 'El Grupo de Clientes y la Cantidad Mínima deben ser únicos.', + ], + ], + 'currency_id' => [ + 'label' => 'Moneda', + 'helper_text' => 'Selecciona la moneda para este precio.', + ], + 'compare_price' => [ + 'label' => 'Precio Comparativo', + 'helper_text' => 'El precio original o RRP, para comparación con su precio de compra.', + ], + 'basePrices' => [ + 'title' => 'Precios', + 'form' => [ + 'price' => [ + 'label' => 'Precio', + 'helper_text' => 'El precio de compra, antes de descuentos.', + ], + 'compare_price' => [ + 'label' => 'Precio Comparativo', + 'helper_text' => 'El precio original o RRP, para comparación con su precio de compra.', + ], + ], + 'tooltip' => 'Generado automáticamente en base a las tasas de cambio de divisas.', + ], + ], + ], + 'tax_rate_amounts' => [ + 'table' => [ + 'description' => '', + 'percentage' => [ + 'label' => 'Porcentaje', + ], + 'tax_class' => [ + 'label' => 'Clase Impositiva', + ], + ], + ], +]; diff --git a/packages/admin/resources/lang/es/staff.php b/packages/admin/resources/lang/es/staff.php new file mode 100644 index 0000000000..bb244d3cc8 --- /dev/null +++ b/packages/admin/resources/lang/es/staff.php @@ -0,0 +1,81 @@ + 'Personal', + + 'plural_label' => 'Personal', + + 'table' => [ + 'firstname' => [ + 'label' => 'Nombre', + ], + 'lastname' => [ + 'label' => 'Apellido', + ], + 'email' => [ + 'label' => 'Correo Electrónico', + ], + 'admin' => [ + 'badge' => 'Super Admin', + ], + ], + + 'form' => [ + 'firstname' => [ + 'label' => 'Nombre', + ], + 'lastname' => [ + 'label' => 'Apellido', + ], + 'email' => [ + 'label' => 'Correo Electrónico', + ], + 'password' => [ + 'label' => 'Contraseña', + 'hint' => 'Restablecer contraseña', + ], + 'admin' => [ + 'label' => 'Super Admin', + 'helper' => 'Los roles de super admin no se pueden cambiar en el hub.', + ], + 'roles' => [ + 'label' => 'Roles', + 'helper' => ':roles tienen acceso completo', + ], + 'permissions' => [ + 'label' => 'Permisos', + ], + 'role' => [ + 'label' => 'Nombre del Rol', + ], + ], + + 'action' => [ + 'acl' => [ + 'label' => 'Control de Acceso', + ], + 'add-role' => [ + 'label' => 'Agregar Rol', + ], + 'delete-role' => [ + 'label' => 'Eliminar Rol', + 'heading' => 'Eliminar rol: :role', + ], + ], + + 'acl' => [ + 'title' => 'Control de Acceso', + 'tooltip' => [ + 'roles-included' => 'El permiso está incluido en los siguientes roles', + ], + 'notification' => [ + 'updated' => 'Actualizado', + 'error' => 'Error', + 'no-role' => 'Rol no registrado en Lunar', + 'no-permission' => 'Permiso no registrado en Lunar', + 'no-role-permission' => 'Rol y Permiso no registrados en Lunar', + ], + ], + +]; diff --git a/packages/admin/resources/lang/es/tag.php b/packages/admin/resources/lang/es/tag.php new file mode 100644 index 0000000000..279326801e --- /dev/null +++ b/packages/admin/resources/lang/es/tag.php @@ -0,0 +1,21 @@ + 'Etiqueta', + + 'plural_label' => 'Etiquetas', + + 'table' => [ + 'value' => [ + 'label' => 'Valor', + ], + ], + + 'form' => [ + 'value' => [ + 'label' => 'Valor', + ], + ], + +]; diff --git a/packages/admin/resources/lang/es/taxclass.php b/packages/admin/resources/lang/es/taxclass.php new file mode 100644 index 0000000000..63a22c831d --- /dev/null +++ b/packages/admin/resources/lang/es/taxclass.php @@ -0,0 +1,27 @@ + 'Clase de Impuesto', + + 'plural_label' => 'Clases de Impuesto', + + 'table' => [ + 'name' => [ + 'label' => 'Nombre', + ], + 'default' => [ + 'label' => 'Predeterminado', + ], + ], + + 'form' => [ + 'name' => [ + 'label' => 'Nombre', + ], + 'default' => [ + 'label' => 'Predeterminado', + ], + ], + +]; diff --git a/packages/admin/resources/lang/es/taxrate.php b/packages/admin/resources/lang/es/taxrate.php new file mode 100644 index 0000000000..c29cb30587 --- /dev/null +++ b/packages/admin/resources/lang/es/taxrate.php @@ -0,0 +1,33 @@ + 'Tasa de Impuesto', + + 'plural_label' => 'Tasas de Impuesto', + + 'table' => [ + 'name' => [ + 'label' => 'Nombre', + ], + 'tax_zone' => [ + 'label' => 'Zona Fiscal', + ], + 'priority' => [ + 'label' => 'Prioridad', + ], + ], + + 'form' => [ + 'name' => [ + 'label' => 'Nombre', + ], + 'priority' => [ + 'label' => 'Prioridad', + ], + 'tax_zone_id' => [ + 'label' => 'Zona Fiscal', + ], + ], + +]; diff --git a/packages/admin/resources/lang/es/taxzone.php b/packages/admin/resources/lang/es/taxzone.php new file mode 100644 index 0000000000..638c82d3de --- /dev/null +++ b/packages/admin/resources/lang/es/taxzone.php @@ -0,0 +1,69 @@ + 'Zona Fiscal', + + 'plural_label' => 'Zonas Fiscales', + + 'table' => [ + 'name' => [ + 'label' => 'Nombre', + ], + 'zone_type' => [ + 'label' => 'Tipo de Zona', + ], + 'active' => [ + 'label' => 'Activo', + ], + 'default' => [ + 'label' => 'Predeterminado', + ], + ], + + 'form' => [ + 'name' => [ + 'label' => 'Nombre', + ], + 'zone_type' => [ + 'label' => 'Tipo de Zona', + 'options' => [ + 'country' => 'Limitar a Países', + 'states' => 'Limitar a Estados', + 'postcodes' => 'Limitar a Códigos Postales', + ], + ], + 'price_display' => [ + 'label' => 'Visualización de Precios', + 'options' => [ + 'include_tax' => 'Incluir Impuesto', + 'exclude_tax' => 'Excluir Impuesto', + ], + ], + 'active' => [ + 'label' => 'Activo', + ], + 'default' => [ + 'label' => 'Predeterminado', + ], + + 'zone_countries' => [ + 'label' => 'Países', + ], + + 'zone_country' => [ + 'label' => 'País', + ], + + 'zone_states' => [ + 'label' => 'Estados', + ], + + 'zone_postcodes' => [ + 'label' => 'Códigos Postales', + 'helper' => 'Enumera cada código postal en una nueva línea. Soporta comodines como NW*', + ], + + ], + +]; diff --git a/packages/admin/resources/lang/es/user.php b/packages/admin/resources/lang/es/user.php new file mode 100644 index 0000000000..7abb94ae03 --- /dev/null +++ b/packages/admin/resources/lang/es/user.php @@ -0,0 +1,29 @@ + 'Usuario', + + 'plural_label' => 'Usuarios', + + 'table' => [ + 'name' => [ + 'label' => 'Nombre', + ], + 'email' => [ + 'label' => 'Correo Electrónico', + ], + ], + + 'form' => [ + 'email' => [ + 'label' => 'Correo Electrónico', + ], + 'password' => [ + 'label' => 'Nueva Contraseña', + ], + 'password_confirmation' => [ + 'label' => 'Confirmar Nueva Contraseña', + ], + ], +]; diff --git a/packages/admin/resources/lang/es/widgets.php b/packages/admin/resources/lang/es/widgets.php new file mode 100644 index 0000000000..93fb0c8852 --- /dev/null +++ b/packages/admin/resources/lang/es/widgets.php @@ -0,0 +1,118 @@ + [ + 'orders' => [ + 'order_stats_overview' => [ + 'stat_one' => [ + 'label' => 'Pedidos hoy', + 'increase' => 'Aumento del :percentage% desde :count ayer', + 'decrease' => 'Disminución del :percentage% desde :count ayer', + 'neutral' => 'Sin cambios en comparación con ayer', + ], + 'stat_two' => [ + 'label' => 'Pedidos en los últimos 7 días', + 'increase' => 'Aumento del :percentage% desde :count el periodo anterior', + 'decrease' => 'Disminución del :percentage% desde :count el periodo anterior', + 'neutral' => 'Sin cambios en comparación con el periodo anterior', + ], + 'stat_three' => [ + 'label' => 'Pedidos en los últimos 30 días', + 'increase' => 'Aumento del :percentage% desde :count el periodo anterior', + 'decrease' => 'Disminución del :percentage% desde :count el periodo anterior', + 'neutral' => 'Sin cambios en comparación con el periodo anterior', + ], + 'stat_four' => [ + 'label' => 'Ventas hoy', + 'increase' => 'Aumento del :percentage% desde :total ayer', + 'decrease' => 'Disminución del :percentage% desde :total ayer', + 'neutral' => 'Sin cambios en comparación con ayer', + ], + 'stat_five' => [ + 'label' => 'Ventas en los últimos 7 días', + 'increase' => 'Aumento del :percentage% desde :total el periodo anterior', + 'decrease' => 'Disminución del :percentage% desde :total el periodo anterior', + 'neutral' => 'Sin cambios en comparación con el periodo anterior', + ], + 'stat_six' => [ + 'label' => 'Ventas en los últimos 30 días', + 'increase' => 'Aumento del :percentage% desde :total el periodo anterior', + 'decrease' => 'Disminución del :percentage% desde :total el periodo anterior', + 'neutral' => 'Sin cambios en comparación con el periodo anterior', + ], + ], + 'order_totals_chart' => [ + 'heading' => 'Totales de pedidos del último año', + 'series_one' => [ + 'label' => 'Este Periodo', + ], + 'series_two' => [ + 'label' => 'Periodo Anterior', + ], + 'yaxis' => [ + 'label' => 'Ingresos :currency', + ], + ], + 'order_sales_chart' => [ + 'heading' => 'Informe de Pedidos / Ventas', + 'series_one' => [ + 'label' => 'Pedidos', + ], + 'series_two' => [ + 'label' => 'Ingresos', + ], + 'yaxis' => [ + 'series_one' => [ + 'label' => '# Pedidos', + ], + 'series_two' => [ + 'label' => 'Valor Total', + ], + ], + ], + 'average_order_value' => [ + 'heading' => 'Valor Promedio del Pedido', + ], + 'new_returning_customers' => [ + 'heading' => 'Nuevos vs Clientes Recurrentes', + 'series_one' => [ + 'label' => 'Nuevos Clientes', + ], + 'series_two' => [ + 'label' => 'Clientes Recurrentes', + ], + ], + 'popular_products' => [ + 'heading' => 'Más vendidos (últimos 12 meses)', + 'description' => 'Estas cifras se basan en el número de veces que un producto aparece en un pedido, no en la cantidad pedida.', + ], + 'latest_orders' => [ + 'heading' => 'Últimos pedidos', + ], + ], + ], + 'customer' => [ + 'stats_overview' => [ + 'total_orders' => [ + 'label' => 'Total de pedidos', + ], + 'avg_spend' => [ + 'label' => 'Gasto Promedio', + ], + 'total_spend' => [ + 'label' => 'Gasto Total', + ], + ], + ], + 'variant_switcher' => [ + 'label' => 'Cambiar Variante', + 'table' => [ + 'sku' => [ + 'label' => 'SKU', + ], + 'values' => [ + 'label' => 'Valores', + ], + ], + ], +]; diff --git a/packages/core/resources/lang/es/base.php b/packages/core/resources/lang/es/base.php new file mode 100644 index 0000000000..526e2863ca --- /dev/null +++ b/packages/core/resources/lang/es/base.php @@ -0,0 +1,9 @@ + [ + 'collection-titles' => [ + 'images' => 'Imágenes', + ], + ], +]; diff --git a/packages/core/resources/lang/es/exceptions.php b/packages/core/resources/lang/es/exceptions.php new file mode 100644 index 0000000000..a0732874e7 --- /dev/null +++ b/packages/core/resources/lang/es/exceptions.php @@ -0,0 +1,21 @@ + 'El modelo ":class" no implementa la interfaz comprable.', + 'cart_line_id_mismatch' => 'Esta línea del carrito no pertenece a este carrito.', + 'invalid_cart_line_quantity' => 'Se esperaba que la cantidad fuera al menos "1", se encontró ":quantity".', + 'maximum_cart_line_quantity' => 'La cantidad no puede exceder :quantity.', + 'carts.invalid_action' => 'La acción del carrito no es válida.', + 'carts.shipping_missing' => 'Se requiere una dirección de envío.', + 'carts.billing_missing' => 'Se requiere una dirección de facturación.', + 'carts.billing_incomplete' => 'La dirección de facturación está incompleta.', + 'carts.order_exists' => 'Ya existe un pedido para este carrito.', + 'carts.shipping_option_missing' => 'Opción de envío faltante.', + 'missing_currency_price' => 'No existe un precio para la moneda ":currency".', + 'minimum_quantity' => 'Debes agregar un mínimo de :quantity artículos.', + 'quantity_increment' => 'La cantidad :quantity debe ser en incrementos de :increment.', + 'fieldtype_missing' => 'El FieldType ":class" no existe.', + 'invalid_fieldtype' => 'La clase ":class" no implementa la interfaz FieldType.', + 'discounts.invalid_type' => 'La colección solo debe contener ":expected", se encontró ":actual".', + 'disallow_multiple_cart_orders' => 'Los carritos solo pueden tener un pedido asociado.', +]; diff --git a/packages/table-rate-shipping/resources/lang/es/plugin.php b/packages/table-rate-shipping/resources/lang/es/plugin.php new file mode 100644 index 0000000000..67e90b2b92 --- /dev/null +++ b/packages/table-rate-shipping/resources/lang/es/plugin.php @@ -0,0 +1,7 @@ + [ + 'group' => 'Envío', + ], +]; diff --git a/packages/table-rate-shipping/resources/lang/es/relationmanagers.php b/packages/table-rate-shipping/resources/lang/es/relationmanagers.php new file mode 100644 index 0000000000..8a25486a86 --- /dev/null +++ b/packages/table-rate-shipping/resources/lang/es/relationmanagers.php @@ -0,0 +1,77 @@ + [ + 'customer_groups' => [ + 'description' => "Asocia grupos de clientes a este método de envío para determinar su disponibilidad.", + ], + ], + 'shipping_rates' => [ + 'title_plural' => 'Tarifas de Envío', + 'actions' => [ + 'create' => [ + 'label' => 'Crear Tarifa de Envío', + ], + ], + 'notices' => [ + 'prices_incl_tax' => 'Todos los precios incluyen impuestos, que se tendrán en cuenta al calcular el gasto mínimo.', + 'prices_excl_tax' => 'Todos los precios excluyen impuestos, el gasto mínimo se basará en el subtotal del carrito.', + ], + 'form' => [ + 'shipping_method_id' => [ + 'label' => 'Método de Envío', + ], + 'price' => [ + 'label' => 'Precio', + ], + 'prices' => [ + 'label' => 'Desglose de Precios', + 'repeater' => [ + 'customer_group_id' => [ + 'label' => 'Grupo de Clientes', + 'placeholder' => 'Cualquiera', + ], + 'currency_id' => [ + 'label' => 'Moneda', + ], + 'min_quantity' => [ + 'label' => 'Gasto Mín.', + ], + 'price' => [ + 'label' => 'Precio', + ], + ], + ], + ], + 'table' => [ + 'shipping_method' => [ + 'label' => 'Método de Envío', + ], + 'price' => [ + 'label' => 'Precio', + ], + 'price_breaks_count' => [ + 'label' => 'Desglose de Precios', + ], + ], + ], + 'exclusions' => [ + 'title_plural' => 'Exclusiones de Envío', + 'form' => [ + 'purchasable' => [ + 'label' => 'Producto', + ], + ], + 'actions' => [ + 'create' => [ + 'label' => 'Agregar lista de exclusión de envío', + ], + 'attach' => [ + 'label' => 'Agregar lista de exclusión', + ], + 'detach' => [ + 'label' => 'Eliminar', + ], + ], + ], +]; diff --git a/packages/table-rate-shipping/resources/lang/es/shippingexclusionlist.php b/packages/table-rate-shipping/resources/lang/es/shippingexclusionlist.php new file mode 100644 index 0000000000..47a1e13f82 --- /dev/null +++ b/packages/table-rate-shipping/resources/lang/es/shippingexclusionlist.php @@ -0,0 +1,19 @@ + 'Lista de Exclusión de Envío', + 'label_plural' => 'Listas de Exclusión de Envío', + 'form' => [ + 'name' => [ + 'label' => 'Nombre', + ], + ], + 'table' => [ + 'name' => [ + 'label' => 'Nombre', + ], + 'exclusions_count' => [ + 'label' => 'N° Productos', + ], + ], +]; diff --git a/packages/table-rate-shipping/resources/lang/es/shippingmethod.php b/packages/table-rate-shipping/resources/lang/es/shippingmethod.php new file mode 100644 index 0000000000..b77269d1b7 --- /dev/null +++ b/packages/table-rate-shipping/resources/lang/es/shippingmethod.php @@ -0,0 +1,58 @@ + 'Métodos de Envío', + 'label' => 'Método de Envío', + 'form' => [ + 'name' => [ + 'label' => 'Nombre', + ], + 'description' => [ + 'label' => 'Descripción', + ], + 'code' => [ + 'label' => 'Código', + ], + 'cutoff' => [ + 'label' => 'Corte', + ], + 'charge_by' => [ + 'label' => 'Cargar Por', + 'options' => [ + 'cart_total' => 'Total del Carrito', + 'weight' => 'Peso', + ], + ], + 'driver' => [ + 'label' => 'Tipo', + 'options' => [ + 'ship-by' => 'Estándar', + 'collection' => 'Recogida', + ], + ], + 'stock_available' => [ + 'label' => 'El stock de todos los artículos del carrito debe estar disponible', + ], + ], + 'table' => [ + 'name' => [ + 'label' => 'Nombre', + ], + 'code' => [ + 'label' => 'Código', + ], + 'driver' => [ + 'label' => 'Tipo', + 'options' => [ + 'ship-by' => 'Estándar', + 'collection' => 'Recogida', + ], + ], + ], + 'pages' => [ + 'availability' => [ + 'label' => 'Disponibilidad', + 'customer_groups' => 'Este método de envío no está disponible actualmente para todos los grupos de clientes.', + ], + ], +]; diff --git a/packages/table-rate-shipping/resources/lang/es/shippingzone.php b/packages/table-rate-shipping/resources/lang/es/shippingzone.php new file mode 100644 index 0000000000..8fd52fa774 --- /dev/null +++ b/packages/table-rate-shipping/resources/lang/es/shippingzone.php @@ -0,0 +1,50 @@ + 'Zona de Envío', + 'label_plural' => 'Zonas de Envío', + 'form' => [ + 'unrestricted' => [ + 'content' => 'Esta zona de envío no tiene restricciones y estará disponible para todos los clientes al momento de pagar.', + ], + 'name' => [ + 'label' => 'Nombre', + ], + 'type' => [ + 'label' => 'Tipo', + 'options' => [ + 'unrestricted' => 'Sin Restricciones', + 'countries' => 'Limitar a Países', + 'states' => 'Limitar a Estados / Provincias', + 'postcodes' => 'Limitar a Códigos Postales', + ], + ], + 'country' => [ + 'label' => 'País', + ], + 'states' => [ + 'label' => 'Estados', + ], + 'countries' => [ + 'label' => 'Países', + ], + 'postcodes' => [ + 'label' => 'Códigos Postales', + 'helper' => 'Lista cada código postal en una nueva línea. Soporta comodines como NW*', + ], + ], + 'table' => [ + 'name' => [ + 'label' => 'Nombre', + ], + 'type' => [ + 'label' => 'Tipo', + 'options' => [ + 'unrestricted' => 'Sin Restricciones', + 'countries' => 'Limitar a Países', + 'states' => 'Limitar a Estados / Provincias', + 'postcodes' => 'Limitar a Códigos Postales', + ], + ], + ], +]; From d09621cabdeaee16c514ff3182abc6fa008605ee Mon Sep 17 00:00:00 2001 From: Ahrjen Date: Tue, 19 Nov 2024 23:48:32 +0100 Subject: [PATCH 30/35] Add Dutch translations (#1960) This pull request adds the Dutch translations of the files in the lang repo's in admin and core --------- Co-authored-by: Glenn Jacobs --- packages/admin/resources/lang/nl/actions.php | 46 +++ packages/admin/resources/lang/nl/activity.php | 29 ++ packages/admin/resources/lang/nl/address.php | 93 +++++ .../admin/resources/lang/nl/attribute.php | 55 +++ .../resources/lang/nl/attributegroup.php | 46 +++ packages/admin/resources/lang/nl/auth.php | 32 ++ packages/admin/resources/lang/nl/brand.php | 72 ++++ packages/admin/resources/lang/nl/channel.php | 39 +++ .../admin/resources/lang/nl/collection.php | 45 +++ .../resources/lang/nl/collectiongroup.php | 37 ++ .../admin/resources/lang/nl/components.php | 109 ++++++ packages/admin/resources/lang/nl/currency.php | 51 +++ packages/admin/resources/lang/nl/customer.php | 63 ++++ .../admin/resources/lang/nl/customergroup.php | 40 +++ packages/admin/resources/lang/nl/discount.php | 324 ++++++++++++++++++ .../admin/resources/lang/nl/fieldtypes.php | 72 ++++ packages/admin/resources/lang/nl/global.php | 12 + packages/admin/resources/lang/nl/language.php | 33 ++ packages/admin/resources/lang/nl/order.php | 293 ++++++++++++++++ packages/admin/resources/lang/nl/product.php | 121 +++++++ .../admin/resources/lang/nl/productoption.php | 124 +++++++ .../admin/resources/lang/nl/producttype.php | 52 +++ .../resources/lang/nl/productvariant.php | 105 ++++++ .../resources/lang/nl/relationmanagers.php | 262 ++++++++++++++ packages/admin/resources/lang/nl/staff.php | 81 +++++ packages/admin/resources/lang/nl/tag.php | 21 ++ packages/admin/resources/lang/nl/taxclass.php | 27 ++ packages/admin/resources/lang/nl/taxrate.php | 33 ++ packages/admin/resources/lang/nl/taxzone.php | 69 ++++ packages/admin/resources/lang/nl/user.php | 29 ++ packages/admin/resources/lang/nl/widgets.php | 119 +++++++ packages/core/resources/lang/nl/base.php | 9 + .../core/resources/lang/nl/exceptions.php | 21 ++ 33 files changed, 2564 insertions(+) create mode 100644 packages/admin/resources/lang/nl/actions.php create mode 100644 packages/admin/resources/lang/nl/activity.php create mode 100644 packages/admin/resources/lang/nl/address.php create mode 100644 packages/admin/resources/lang/nl/attribute.php create mode 100644 packages/admin/resources/lang/nl/attributegroup.php create mode 100644 packages/admin/resources/lang/nl/auth.php create mode 100644 packages/admin/resources/lang/nl/brand.php create mode 100644 packages/admin/resources/lang/nl/channel.php create mode 100644 packages/admin/resources/lang/nl/collection.php create mode 100644 packages/admin/resources/lang/nl/collectiongroup.php create mode 100644 packages/admin/resources/lang/nl/components.php create mode 100644 packages/admin/resources/lang/nl/currency.php create mode 100644 packages/admin/resources/lang/nl/customer.php create mode 100644 packages/admin/resources/lang/nl/customergroup.php create mode 100644 packages/admin/resources/lang/nl/discount.php create mode 100644 packages/admin/resources/lang/nl/fieldtypes.php create mode 100644 packages/admin/resources/lang/nl/global.php create mode 100644 packages/admin/resources/lang/nl/language.php create mode 100644 packages/admin/resources/lang/nl/order.php create mode 100644 packages/admin/resources/lang/nl/product.php create mode 100644 packages/admin/resources/lang/nl/productoption.php create mode 100644 packages/admin/resources/lang/nl/producttype.php create mode 100644 packages/admin/resources/lang/nl/productvariant.php create mode 100644 packages/admin/resources/lang/nl/relationmanagers.php create mode 100644 packages/admin/resources/lang/nl/staff.php create mode 100644 packages/admin/resources/lang/nl/tag.php create mode 100644 packages/admin/resources/lang/nl/taxclass.php create mode 100644 packages/admin/resources/lang/nl/taxrate.php create mode 100644 packages/admin/resources/lang/nl/taxzone.php create mode 100644 packages/admin/resources/lang/nl/user.php create mode 100644 packages/admin/resources/lang/nl/widgets.php create mode 100644 packages/core/resources/lang/nl/base.php create mode 100644 packages/core/resources/lang/nl/exceptions.php diff --git a/packages/admin/resources/lang/nl/actions.php b/packages/admin/resources/lang/nl/actions.php new file mode 100644 index 0000000000..c7d1a3783f --- /dev/null +++ b/packages/admin/resources/lang/nl/actions.php @@ -0,0 +1,46 @@ + [ + 'create_root' => [ + 'label' => 'Maak Hoofdcategorie', + ], + 'create_child' => [ + 'label' => 'Maak Subcategorie', + ], + 'move' => [ + 'label' => 'Verplaats Categorie', + ], + 'delete' => [ + 'label' => 'Verwijderen', + ], + ], + 'orders' => [ + 'update_status' => [ + 'label' => 'Status Bijwerken', + 'wizard' => [ + 'step_one' => [ + 'label' => 'Status', + ], + 'step_two' => [ + 'label' => 'Mailers & Meldingen', + 'no_mailers' => 'Er zijn geen mailers beschikbaar voor deze status.', + ], + 'step_three' => [ + 'label' => 'Voorbeeld & Opslaan', + 'no_mailers' => 'Er zijn geen mailers gekozen voor voorbeeld.', + ], + ], + 'notification' => [ + 'label' => 'Orderstatus bijgewerkt', + ], + 'billing_email' => [ + 'label' => 'Facturatie E-mail', + ], + 'shipping_email' => [ + 'label' => 'Verzend E-mail', + ], + ], + + ], +]; diff --git a/packages/admin/resources/lang/nl/activity.php b/packages/admin/resources/lang/nl/activity.php new file mode 100644 index 0000000000..3b181fcef9 --- /dev/null +++ b/packages/admin/resources/lang/nl/activity.php @@ -0,0 +1,29 @@ + 'Activiteit', + + 'plural_label' => 'Activiteiten', + + 'table' => [ + 'subject' => 'Onderwerp', + 'description' => 'Beschrijving', + 'log' => 'Logboek', + 'logged_at' => 'Gelogd Op', + 'event' => 'Gebeurtenis', + 'logged_from' => 'Gelogd Vanaf', + 'logged_until' => 'Gelogd Tot', + ], + + 'form' => [ + 'causer_type' => 'Veroorzaker Type', + 'causer_id' => 'Veroorzaker Id', + 'subject_type' => 'Onderwerp Type', + 'subject_id' => 'Onderwerp Id', + 'description' => 'Beschrijving', + 'attributes' => 'Attributen', + 'old' => 'Oud', + ], + +]; diff --git a/packages/admin/resources/lang/nl/address.php b/packages/admin/resources/lang/nl/address.php new file mode 100644 index 0000000000..8a64008810 --- /dev/null +++ b/packages/admin/resources/lang/nl/address.php @@ -0,0 +1,93 @@ + 'Adres', + + 'plural_label' => 'Adressen', + + 'table' => [ + 'title' => [ + 'label' => 'Titel', + ], + 'first_name' => [ + 'label' => 'Voornaam', + ], + 'last_name' => [ + 'label' => 'Achternaam', + ], + 'company_name' => [ + 'label' => 'Bedrijfsnaam', + ], + 'line_one' => [ + 'label' => 'Adres', + ], + 'line_two' => [ + 'label' => 'Adresregel Twee', + ], + 'line_three' => [ + 'label' => 'Adresregel Drie', + ], + 'city' => [ + 'label' => 'Stad', + ], + 'country_id' => [ + 'label' => 'Land', + ], + 'state' => [ + 'label' => 'Provincie', + ], + 'postcode' => [ + 'label' => 'Postcode', + ], + 'contact_email' => [ + 'label' => 'Contact E-mail', + ], + 'contact_phone' => [ + 'label' => 'Contact Telefoon', + ], + ], + + 'form' => [ + 'title' => [ + 'label' => 'Titel', + ], + 'first_name' => [ + 'label' => 'Voornaam', + ], + 'last_name' => [ + 'label' => 'Achternaam', + ], + 'company_name' => [ + 'label' => 'Bedrijfsnaam', + ], + 'line_one' => [ + 'label' => 'Adresregel Een', + ], + 'line_two' => [ + 'label' => 'Adresregel Twee', + ], + 'line_three' => [ + 'label' => 'Adresregel Drie', + ], + 'city' => [ + 'label' => 'Stad', + ], + 'country_id' => [ + 'label' => 'Land', + ], + 'state' => [ + 'label' => 'Provincie', + ], + 'postcode' => [ + 'label' => 'Postcode', + ], + 'contact_email' => [ + 'label' => 'Contact E-mail', + ], + 'contact_phone' => [ + 'label' => 'Contact Telefoon', + ], + ], + +]; diff --git a/packages/admin/resources/lang/nl/attribute.php b/packages/admin/resources/lang/nl/attribute.php new file mode 100644 index 0000000000..9ac83854d6 --- /dev/null +++ b/packages/admin/resources/lang/nl/attribute.php @@ -0,0 +1,55 @@ + 'Attribuut', + + 'plural_label' => 'Attributen', + + 'table' => [ + 'name' => [ + 'label' => 'Naam', + ], + 'description' => [ + 'label' => 'Beschrijving', + ], + 'handle' => [ + 'label' => 'Handvat', + ], + 'type' => [ + 'label' => 'Type', + ], + ], + + 'form' => [ + 'attributable_type' => [ + 'label' => 'Type', + ], + 'name' => [ + 'label' => 'Naam', + ], + 'description' => [ + 'label' => 'Beschrijving', + 'helper' => 'Gebruik om de helptekst onder de invoer weer te geven', + ], + 'handle' => [ + 'label' => 'Handvat', + ], + 'searchable' => [ + 'label' => 'Doorzoekbaar', + ], + 'filterable' => [ + 'label' => 'Filterbaar', + ], + 'required' => [ + 'label' => 'Verplicht', + ], + 'type' => [ + 'label' => 'Type', + ], + 'validation_rules' => [ + 'label' => 'Validatieregels', + 'helper' => 'Regels voor attribuutveld, voorbeeld: min:1|max:10|...', + ], + ], +]; diff --git a/packages/admin/resources/lang/nl/attributegroup.php b/packages/admin/resources/lang/nl/attributegroup.php new file mode 100644 index 0000000000..a23a2e3113 --- /dev/null +++ b/packages/admin/resources/lang/nl/attributegroup.php @@ -0,0 +1,46 @@ + 'Attribuutgroep', + + 'plural_label' => 'Attribuutgroepen', + + 'table' => [ + 'attributable_type' => [ + 'label' => 'Type', + ], + 'name' => [ + 'label' => 'Naam', + ], + 'handle' => [ + 'label' => 'Handvat', + ], + 'position' => [ + 'label' => 'Positie', + ], + ], + + 'form' => [ + 'attributable_type' => [ + 'label' => 'Type', + ], + 'name' => [ + 'label' => 'Naam', + ], + 'handle' => [ + 'label' => 'Handvat', + ], + 'position' => [ + 'label' => 'Positie', + ], + ], + + 'action' => [ + 'delete' => [ + 'notification' => [ + 'error_protected' => 'Deze attribuutgroep kan niet worden verwijderd omdat er attributen aan zijn gekoppeld.', + ], + ], + ], +]; diff --git a/packages/admin/resources/lang/nl/auth.php b/packages/admin/resources/lang/nl/auth.php new file mode 100644 index 0000000000..77df920a5f --- /dev/null +++ b/packages/admin/resources/lang/nl/auth.php @@ -0,0 +1,32 @@ + 'Beheerder', + 'roles.admin.description' => 'Beheerder met volledige toegang', + 'roles.staff.label' => 'Personeel', + 'roles.staff.description' => 'Personeel met fundamentele toegang', + /** + * Permissions. + */ + 'permissions.settings.label' => 'Instellingen', + 'permissions.settings.description' => 'Geeft toegang tot het instellingengebied van de hub', + 'permissions.settings:core.label' => 'Kerninstellingen', + 'permissions.settings:core.description' => 'Toegang tot fundamentele winkelinstellingen, zoals kanalen, talen, valuta, enz.', + 'permissions.settings:manage-staff.label' => 'Beheer Personeel', + 'permissions.settings:manage-staff.description' => 'Sta het personeelslid toe om ander personeel te bewerken', + 'permissions.settings:manage-attributes.label' => 'Beheer Attributen', + 'permissions.settings:manage-attributes.description' => 'Sta het personeelslid toe om extra attributen te bewerken en te maken', + 'permissions.catalog:manage-products.label' => 'Beheer Producten', + 'permissions.catalog:manage-products.description' => 'Sta het personeelslid toe om producten, producttypen en merken te bewerken', + 'permissions.catalog:manage-collections.label' => 'Beheer Collecties', + 'permissions.catalog:manage-collections.description' => 'Sta het personeelslid toe om collecties en hun groepen te bewerken', + 'permissions.sales:manage-orders.label' => 'Beheer Bestellingen', + 'permissions.sales:manage-orders.description' => 'Sta het personeelslid toe om bestellingen te beheren', + 'permissions.sales:manage-customers.label' => 'Beheer Klanten', + 'permissions.sales:manage-customers.description' => 'Sta het personeelslid toe om klanten te beheren', + 'permissions.sales:manage-discounts.label' => 'Beheer Kortingen', + 'permissions.sales:manage-discounts.description' => 'Sta het personeelslid toe om kortingen te beheren', +]; diff --git a/packages/admin/resources/lang/nl/brand.php b/packages/admin/resources/lang/nl/brand.php new file mode 100644 index 0000000000..75cd5cd220 --- /dev/null +++ b/packages/admin/resources/lang/nl/brand.php @@ -0,0 +1,72 @@ + 'Merk', + + 'plural_label' => 'Merken', + + 'table' => [ + 'name' => [ + 'label' => 'Naam', + ], + 'products_count' => [ + 'label' => 'Aantal Producten', + ], + ], + + 'form' => [ + 'name' => [ + 'label' => 'Naam', + ], + ], + + 'action' => [ + 'delete' => [ + 'notification' => [ + 'error_protected' => 'Dit merk kan niet worden verwijderd omdat er producten aan zijn gekoppeld.', + ], + ], + ], + 'pages' => [ + 'products' => [ + 'label' => 'Producten', + 'actions' => [ + 'attach' => [ + 'label' => 'Koppel een product', + 'form' => [ + 'record_id' => [ + 'label' => 'Product', + ], + ], + 'notification' => [ + 'success' => 'Product gekoppeld aan merk', + ], + ], + 'detach' => [ + 'notification' => [ + 'success' => 'Product ontkoppeld.', + ], + ], + ], + ], + 'collections' => [ + 'label' => 'Collecties', + 'table' => [ + 'header_actions' => [ + 'attach' => [ + 'record_select' => [ + 'placeholder' => 'Selecteer een collectie', + ], + ], + ], + ], + 'actions' => [ + 'attach' => [ + 'label' => 'Koppel een collectie', + ], + ], + ], + ], + +]; diff --git a/packages/admin/resources/lang/nl/channel.php b/packages/admin/resources/lang/nl/channel.php new file mode 100644 index 0000000000..ade258936a --- /dev/null +++ b/packages/admin/resources/lang/nl/channel.php @@ -0,0 +1,39 @@ + 'Kanaal', + + 'plural_label' => 'Kanalen', + + 'table' => [ + 'name' => [ + 'label' => 'Naam', + ], + 'handle' => [ + 'label' => 'Handvat', + ], + 'url' => [ + 'label' => 'URL', + ], + 'default' => [ + 'label' => 'Standaard', + ], + ], + + 'form' => [ + 'name' => [ + 'label' => 'Naam', + ], + 'handle' => [ + 'label' => 'Handvat', + ], + 'url' => [ + 'label' => 'URL', + ], + 'default' => [ + 'label' => 'Standaard', + ], + ], + +]; diff --git a/packages/admin/resources/lang/nl/collection.php b/packages/admin/resources/lang/nl/collection.php new file mode 100644 index 0000000000..4b98132e17 --- /dev/null +++ b/packages/admin/resources/lang/nl/collection.php @@ -0,0 +1,45 @@ + 'Collectie', + + 'plural_label' => 'Collecties', + + 'form' => [ + 'name' => [ + 'label' => 'Naam', + ], + ], + + 'pages' => [ + 'children' => [ + 'label' => 'Subcollecties', + 'actions' => [ + 'create_child' => [ + 'label' => 'Maak Subcollectie', + ], + ], + 'table' => [ + 'children_count' => [ + 'label' => 'Aantal Kinderen', + ], + 'name' => [ + 'label' => 'Naam', + ], + ], + ], + 'edit' => [ + 'label' => 'Basisinformatie', + ], + 'products' => [ + 'label' => 'Producten', + 'actions' => [ + 'attach' => [ + 'label' => 'Product Toevoegen', + ], + ], + ], + ], + +]; diff --git a/packages/admin/resources/lang/nl/collectiongroup.php b/packages/admin/resources/lang/nl/collectiongroup.php new file mode 100644 index 0000000000..64a617597c --- /dev/null +++ b/packages/admin/resources/lang/nl/collectiongroup.php @@ -0,0 +1,37 @@ + 'Collectiegroep', + + 'plural_label' => 'Collectiegroepen', + + 'table' => [ + 'name' => [ + 'label' => 'Naam', + ], + 'handle' => [ + 'label' => 'Handvat', + ], + 'collections_count' => [ + 'label' => 'Aantal Collecties', + ], + ], + + 'form' => [ + 'name' => [ + 'label' => 'Naam', + ], + 'handle' => [ + 'label' => 'Handvat', + ], + ], + + 'action' => [ + 'delete' => [ + 'notification' => [ + 'error_protected' => 'Deze collectiegroep kan niet worden verwijderd omdat er collecties aan zijn gekoppeld.', + ], + ], + ], +]; diff --git a/packages/admin/resources/lang/nl/components.php b/packages/admin/resources/lang/nl/components.php new file mode 100644 index 0000000000..aa742c853b --- /dev/null +++ b/packages/admin/resources/lang/nl/components.php @@ -0,0 +1,109 @@ + [ + 'notification' => [ + 'updated' => 'Tags bijgewerkt', + ], + ], + + 'activity-log' => [ + 'input' => [ + 'placeholder' => 'Voeg een opmerking toe', + ], + + 'action' => [ + 'add-comment' => 'Voeg opmerking toe', + ], + + 'system' => 'Systeem', + + 'partials' => [ + 'orders' => [ + 'order_created' => 'Bestelling aangemaakt', + + 'status_change' => 'Status bijgewerkt', + + 'capture' => 'Betaling van :amount op kaart eindigend op :last_four', + + 'authorized' => 'Geautoriseerd bedrag van :amount op kaart eindigend op :last_four', + + 'refund' => 'Terugbetaling van :amount op kaart eindigend op :last_four', + + 'address' => ':type bijgewerkt', + + 'billingAddress' => 'Factuuradres', + + 'shippingAddress' => 'Verzendadres', + ], + + 'update' => [ + 'updated' => ':model bijgewerkt', + ], + + 'create' => [ + 'created' => ':model aangemaakt', + ], + + 'tags' => [ + 'updated' => 'Tags bijgewerkt', + 'added' => 'Toegevoegd', + 'removed' => 'Verwijderd', + ], + ], + + 'notification' => [ + 'comment_added' => 'Opmerking toegevoegd', + ], + ], + + 'forms' => [ + 'youtube' => [ + 'helperText' => 'Voer de ID van de YouTube-video in. bijv. dQw4w9WgXcQ', + ], + ], + + 'collection-tree-view' => [ + 'actions' => [ + 'move' => [ + 'form' => [ + 'target_id' => [ + 'label' => 'Bovenliggende collectie', + ], + ], + ], + ], + 'notifications' => [ + 'collections-reordered' => [ + 'success' => 'Collecties opnieuw gerangschikt', + ], + 'node-expanded' => [ + 'danger' => 'Kan collecties niet laden', + ], + 'delete' => [ + 'danger' => 'Kan collectie niet verwijderen', + ], + ], + ], + + 'product-options-list' => [ + 'add-option' => [ + 'label' => 'Optie toevoegen', + ], + 'delete-option' => [ + 'label' => 'Optie verwijderen', + ], + 'remove-shared-option' => [ + 'label' => 'Gedeelde optie verwijderen', + ], + 'add-value' => [ + 'label' => 'Nog een waarde toevoegen', + ], + 'name' => [ + 'label' => 'Naam', + ], + 'values' => [ + 'label' => 'Waarden', + ], + ], +]; diff --git a/packages/admin/resources/lang/nl/currency.php b/packages/admin/resources/lang/nl/currency.php new file mode 100644 index 0000000000..1f903244b1 --- /dev/null +++ b/packages/admin/resources/lang/nl/currency.php @@ -0,0 +1,51 @@ + 'Valuta', + + 'plural_label' => 'Valuta\'s', + + 'table' => [ + 'name' => [ + 'label' => 'Naam', + ], + 'code' => [ + 'label' => 'Code', + ], + 'exchange_rate' => [ + 'label' => 'Wisselkoers', + ], + 'decimal_places' => [ + 'label' => 'Decimalen', + ], + 'enabled' => [ + 'label' => 'Ingeschakeld', + ], + 'default' => [ + 'label' => 'Standaard', + ], + ], + + 'form' => [ + 'name' => [ + 'label' => 'Naam', + ], + 'code' => [ + 'label' => 'Code', + ], + 'exchange_rate' => [ + 'label' => 'Wisselkoers', + ], + 'decimal_places' => [ + 'label' => 'Decimalen', + ], + 'enabled' => [ + 'label' => 'Ingeschakeld', + ], + 'default' => [ + 'label' => 'Standaard', + ], + ], + +]; diff --git a/packages/admin/resources/lang/nl/customer.php b/packages/admin/resources/lang/nl/customer.php new file mode 100644 index 0000000000..b7411131cc --- /dev/null +++ b/packages/admin/resources/lang/nl/customer.php @@ -0,0 +1,63 @@ + 'Klant', + + 'plural_label' => 'Klanten', + + 'table' => [ + 'full_name' => [ + 'label' => 'Naam', + ], + 'first_name' => [ + 'label' => 'Voornaam', + ], + 'last_name' => [ + 'label' => 'Achternaam', + ], + 'title' => [ + 'label' => 'Titel', + ], + 'company_name' => [ + 'label' => 'Bedrijfsnaam', + ], + 'vat_no' => [ + 'label' => 'BTW Nr.', + ], + 'account_reference' => [ + 'label' => 'Account Referentie', + ], + 'new' => [ + 'label' => 'Nieuw', + ], + 'returning' => [ + 'label' => 'Terugkerend', + ], + ], + + 'form' => [ + 'title' => [ + 'label' => 'Titel', + ], + 'first_name' => [ + 'label' => 'Voornaam', + ], + 'last_name' => [ + 'label' => 'Achternaam', + ], + 'company_name' => [ + 'label' => 'Bedrijfsnaam', + ], + 'account_ref' => [ + 'label' => 'Account Referentie', + ], + 'vat_no' => [ + 'label' => 'BTW Nr.', + ], + 'customer_groups' => [ + 'label' => 'Klantengroepen', + ], + ], + +]; diff --git a/packages/admin/resources/lang/nl/customergroup.php b/packages/admin/resources/lang/nl/customergroup.php new file mode 100644 index 0000000000..4b98637373 --- /dev/null +++ b/packages/admin/resources/lang/nl/customergroup.php @@ -0,0 +1,40 @@ + 'Klantengroep', + + 'plural_label' => 'Klantengroepen', + + 'table' => [ + 'name' => [ + 'label' => 'Naam', + ], + 'handle' => [ + 'label' => 'Handvat', + ], + 'default' => [ + 'label' => 'Standaard', + ], + ], + + 'form' => [ + 'name' => [ + 'label' => 'Naam', + ], + 'handle' => [ + 'label' => 'Handvat', + ], + 'default' => [ + 'label' => 'Standaard', + ], + ], + + 'action' => [ + 'delete' => [ + 'notification' => [ + 'error_protected' => 'Deze klantengroep kan niet worden verwijderd omdat er klanten aan zijn gekoppeld.', + ], + ], + ], +]; diff --git a/packages/admin/resources/lang/nl/discount.php b/packages/admin/resources/lang/nl/discount.php new file mode 100644 index 0000000000..675d4b10c4 --- /dev/null +++ b/packages/admin/resources/lang/nl/discount.php @@ -0,0 +1,324 @@ + 'Kortingen', + 'label' => 'Korting', + 'form' => [ + 'conditions' => [ + 'heading' => 'Voorwaarden', + ], + 'buy_x_get_y' => [ + 'heading' => 'Koop X Krijg Y', + ], + 'amount_off' => [ + 'heading' => 'Bedrag Korting', + ], + 'name' => [ + 'label' => 'Naam', + ], + 'handle' => [ + 'label' => 'Handle', + ], + 'starts_at' => [ + 'label' => 'Startdatum', + ], + 'ends_at' => [ + 'label' => 'Einddatum', + ], + 'priority' => [ + 'label' => 'Prioriteit', + 'helper_text' => 'Kortingen met een hogere prioriteit worden eerst toegepast.', + 'options' => [ + 'low' => [ + 'label' => 'Laag', + ], + 'medium' => [ + 'label' => 'Middel', + ], + 'high' => [ + 'label' => 'Hoog', + ], + ], + ], + 'stop' => [ + 'label' => 'Stop andere kortingen na deze toe te passen', + ], + 'coupon' => [ + 'label' => 'Coupon', + 'helper_text' => 'Voer de vereiste coupon in voor de korting, als deze leeg is, wordt deze automatisch toegepast.', + ], + 'max_uses' => [ + 'label' => 'Maximaal gebruik', + 'helper_text' => 'Laat leeg voor onbeperkt gebruik.', + ], + 'max_uses_per_user' => [ + 'label' => 'Maximaal gebruik per gebruiker', + 'helper_text' => 'Laat leeg voor onbeperkt gebruik.', + ], + 'minimum_cart_amount' => [ + 'label' => 'Minimale Winkelwagenbedrag', + ], + 'min_qty' => [ + 'label' => 'Producthoeveelheid', + 'helper_text' => 'Stel in hoeveel kwalificerende producten nodig zijn voor de korting.', + ], + 'reward_qty' => [ + 'label' => 'Aantal gratis items', + 'helper_text' => 'Hoeveel van elk item worden afgeprijsd.', + ], + 'max_reward_qty' => [ + 'label' => 'Maximale beloningshoeveelheid', + 'helper_text' => 'Het maximale aantal producten dat kan worden afgeprijsd, ongeacht de criteria.', + ], + 'automatic_rewards' => [ + 'label' => 'Automatisch beloningen toevoegen', + 'helper_text' => 'Schakel in om beloningsproducten toe te voegen wanneer deze niet in de winkelwagen aanwezig zijn.', + ], + ], + 'table' => [ + 'name' => [ + 'label' => 'Naam', + ], + 'status' => [ + 'label' => 'Status', + \Lunar\Models\Discount::ACTIVE => [ + 'label' => 'Actief', + ], + \Lunar\Models\Discount::PENDING => [ + 'label' => 'In afwachting', + ], + \Lunar\Models\Discount::EXPIRED => [ + 'label' => 'Verlopen', + ], + \Lunar\Models\Discount::SCHEDULED => [ + 'label' => 'Gepland', + ], + ], + 'type' => [ + 'label' => 'Type', + ], + 'starts_at' => [ + 'label' => 'Startdatum', + ], + 'ends_at' => [ + 'label' => 'Einddatum', + ], + ], + 'pages' => [ + 'availability' => [ + 'label' => 'Beschikbaarheid', + ], + 'limitations' => [ + 'label' => 'Beperkingen', + ], + ], + 'relationmanagers' => [ + 'collections' => [ + 'title' => 'Collecties', + 'description' => 'Selecteer welke collecties beperkt moeten worden tot deze korting.', + 'actions' => [ + 'attach' => [ + 'label' => 'Collectie Toevoegen', + ], + ], + 'table' => [ + 'name' => [ + 'label' => 'Naam', + ], + 'type' => [ + 'label' => 'Type', + 'limitation' => [ + 'label' => 'Beperking', + ], + 'exclusion' => [ + 'label' => 'Uitsluiting', + ], + ], + ], + 'form' => [ + 'type' => [ + 'options' => [ + 'limitation' => [ + 'label' => 'Beperking', + ], + 'exclusion' => [ + 'label' => 'Uitsluiting', + ], + ], + ], + ], + ], + 'brands' => [ + 'title' => 'Merken', + 'description' => 'Selecteer welke merken beperkt moeten worden tot deze korting.', + 'actions' => [ + 'attach' => [ + 'label' => 'Merk Toevoegen', + ], + ], + 'table' => [ + 'name' => [ + 'label' => 'Naam', + ], + 'type' => [ + 'label' => 'Type', + 'limitation' => [ + 'label' => 'Beperking', + ], + 'exclusion' => [ + 'label' => 'Uitsluiting', + ], + ], + ], + 'form' => [ + 'type' => [ + 'options' => [ + 'limitation' => [ + 'label' => 'Beperking', + ], + 'exclusion' => [ + 'label' => 'Uitsluiting', + ], + ], + ], + ], + ], + 'products' => [ + 'title' => 'Producten', + 'description' => 'Selecteer welke producten beperkt moeten worden tot deze korting.', + 'actions' => [ + 'attach' => [ + 'label' => 'Product Toevoegen', + ], + ], + 'table' => [ + 'name' => [ + 'label' => 'Naam', + ], + 'type' => [ + 'label' => 'Type', + 'limitation' => [ + 'label' => 'Beperking', + ], + 'exclusion' => [ + 'label' => 'Uitsluiting', + ], + ], + ], + 'form' => [ + 'type' => [ + 'options' => [ + 'limitation' => [ + 'label' => 'Beperking', + ], + 'exclusion' => [ + 'label' => 'Uitsluiting', + ], + ], + ], + ], + ], + 'rewards' => [ + 'title' => 'Productbeloningen', + 'description' => 'Selecteer welke producten worden afgeprijsd als ze in de winkelwagen zitten en aan de bovenstaande voorwaarden voldoen.', + 'actions' => [ + 'attach' => [ + 'label' => 'Product Toevoegen', + ], + ], + 'table' => [ + 'name' => [ + 'label' => 'Naam', + ], + 'type' => [ + 'label' => 'Type', + 'limitation' => [ + 'label' => 'Beperking', + ], + 'exclusion' => [ + 'label' => 'Uitsluiting', + ], + ], + ], + 'form' => [ + 'type' => [ + 'options' => [ + 'limitation' => [ + 'label' => 'Beperking', + ], + 'exclusion' => [ + 'label' => 'Uitsluiting', + ], + ], + ], + ], + ], + 'conditions' => [ + 'title' => 'Productvoorwaarden', + 'description' => 'Selecteer de producten die nodig zijn voor de korting.', + 'actions' => [ + 'attach' => [ + 'label' => 'Product Toevoegen', + ], + ], + 'table' => [ + 'name' => [ + 'label' => 'Naam', + ], + 'type' => [ + 'label' => 'Type', + 'limitation' => [ + 'label' => 'Beperking', + ], + 'exclusion' => [ + 'label' => 'Uitsluiting', + ], + ], + ], + 'form' => [ + 'type' => [ + 'options' => [ + 'limitation' => [ + 'label' => 'Beperking', + ], + 'exclusion' => [ + 'label' => 'Uitsluiting', + ], + ], + ], + ], + ], + 'productvariants' => [ + 'title' => 'Productvarianten', + 'description' => 'Selecteer welke productvarianten beperkt moeten worden tot deze korting.', + 'actions' => [ + 'attach' => [ + 'label' => 'Productvariant Toevoegen', + ], + ], + 'table' => [ + 'name' => [ + 'label' => 'Naam', + ], + 'sku' => [ + 'label' => 'SKU', + ], + 'values' => [ + 'label' => 'Optie(s)', + ], + ], + 'form' => [ + 'type' => [ + 'options' => [ + 'limitation' => [ + 'label' => 'Beperking', + ], + 'exclusion' => [ + 'label' => 'Uitsluiting', + ], + ], + ], + ], + ], + ], +]; diff --git a/packages/admin/resources/lang/nl/fieldtypes.php b/packages/admin/resources/lang/nl/fieldtypes.php new file mode 100644 index 0000000000..4b36c2846f --- /dev/null +++ b/packages/admin/resources/lang/nl/fieldtypes.php @@ -0,0 +1,72 @@ + [ + 'label' => 'Keuzelijst', + 'form' => [ + 'lookups' => [ + 'label' => 'Opzoekingen', + 'key_label' => 'Label', + 'value_label' => 'Waarde', + ], + ], + ], + 'listfield' => [ + 'label' => 'Lijstveld', + ], + 'text' => [ + 'label' => 'Tekst', + 'form' => [ + 'richtext' => [ + 'label' => 'Rich Text', + ], + ], + ], + 'translatedtext' => [ + 'label' => 'Vertaald Tekst', + 'form' => [ + 'richtext' => [ + 'label' => 'Rich Text', + ], + 'locales' => 'Talen', + ], + ], + 'toggle' => [ + 'label' => 'Schakelaar', + ], + 'youtube' => [ + 'label' => 'YouTube', + ], + 'vimeo' => [ + 'label' => 'Vimeo', + ], + 'number' => [ + 'label' => 'Nummer', + 'form' => [ + 'min' => [ + 'label' => 'Min.', + ], + 'max' => [ + 'label' => 'Max.', + ], + ], + ], + 'file' => [ + 'label' => 'Bestand', + 'form' => [ + 'file_types' => [ + 'label' => 'Toegestane Bestandstypen', + 'placeholder' => 'Nieuwe MIME', + ], + 'multiple' => [ + 'label' => 'Meerdere Bestanden Toestaan', + ], + 'min_files' => [ + 'label' => 'Min. Bestanden', + ], + 'max_files' => [ + 'label' => 'Max. Bestanden', + ], + ], + ], +]; diff --git a/packages/admin/resources/lang/nl/global.php b/packages/admin/resources/lang/nl/global.php new file mode 100644 index 0000000000..a98f7688da --- /dev/null +++ b/packages/admin/resources/lang/nl/global.php @@ -0,0 +1,12 @@ + [ + 'catalog' => 'Catalogus', + 'sales' => 'Verkoop', + 'reports' => 'Rapporten', + 'settings' => 'Instellingen', + ], + +]; diff --git a/packages/admin/resources/lang/nl/language.php b/packages/admin/resources/lang/nl/language.php new file mode 100644 index 0000000000..58803b8877 --- /dev/null +++ b/packages/admin/resources/lang/nl/language.php @@ -0,0 +1,33 @@ + 'Taal', + + 'plural_label' => 'Talen', + + 'table' => [ + 'name' => [ + 'label' => 'Naam', + ], + 'code' => [ + 'label' => 'Code', + ], + 'default' => [ + 'label' => 'Standaard', + ], + ], + + 'form' => [ + 'name' => [ + 'label' => 'Naam', + ], + 'code' => [ + 'label' => 'Code', + ], + 'default' => [ + 'label' => 'Standaard', + ], + ], + +]; diff --git a/packages/admin/resources/lang/nl/order.php b/packages/admin/resources/lang/nl/order.php new file mode 100644 index 0000000000..aa2ba2a11f --- /dev/null +++ b/packages/admin/resources/lang/nl/order.php @@ -0,0 +1,293 @@ + 'Bestelling', + + 'plural_label' => 'Bestellingen', + + 'breadcrumb' => [ + 'manage' => 'Beheren', + ], + + 'transactions' => [ + 'capture' => 'Geïncasseerd', + 'intent' => 'Voorgenomen', + 'refund' => 'Terugbetaald', + 'failed' => 'Mislukt', + ], + + 'table' => [ + 'status' => [ + 'label' => 'Status', + ], + 'reference' => [ + 'label' => 'Referentie', + ], + 'customer_reference' => [ + 'label' => 'Klantreferentie', + ], + 'customer' => [ + 'label' => 'Klant', + ], + 'tags' => [ + 'label' => 'Tags', + ], + 'postcode' => [ + 'label' => 'Postcode', + ], + 'email' => [ + 'label' => 'E-mail', + 'copy_message' => 'E-mailadres gekopieerd', + ], + 'phone' => [ + 'label' => 'Telefoon', + ], + 'total' => [ + 'label' => 'Totaal', + ], + 'date' => [ + 'label' => 'Datum', + ], + 'new_customer' => [ + 'label' => 'Klanttype', + ], + 'placed_after' => [ + 'label' => 'Geplaatst na', + ], + 'placed_before' => [ + 'label' => 'Geplaatst voor', + ], + ], + + 'form' => [ + 'address' => [ + 'first_name' => [ + 'label' => 'Voornaam', + ], + 'last_name' => [ + 'label' => 'Achternaam', + ], + 'line_one' => [ + 'label' => 'Adresregel 1', + ], + 'line_two' => [ + 'label' => 'Adresregel 2', + ], + 'line_three' => [ + 'label' => 'Adresregel 3', + ], + 'company_name' => [ + 'label' => 'Bedrijfsnaam', + ], + 'contact_phone' => [ + 'label' => 'Telefoon', + ], + 'contact_email' => [ + 'label' => 'E-mailadres', + ], + 'city' => [ + 'label' => 'Stad', + ], + 'state' => [ + 'label' => 'Staat / Provincie', + ], + 'postcode' => [ + 'label' => 'Postcode', + ], + 'country_id' => [ + 'label' => 'Land', + ], + ], + + 'reference' => [ + 'label' => 'Referentie', + ], + 'status' => [ + 'label' => 'Status', + ], + 'transaction' => [ + 'label' => 'Transactie', + ], + 'amount' => [ + 'label' => 'Bedrag', + + 'hint' => [ + 'less_than_total' => "Je staat op het punt een bedrag te incasseren dat minder is dan de totale transactiewaarde", + ], + ], + + 'notes' => [ + 'label' => 'Notities', + ], + 'confirm' => [ + 'label' => 'Bevestigen', + + 'alert' => 'Bevestiging vereist', + + 'hint' => [ + 'capture' => 'Bevestig alstublieft dat u deze betaling wilt incasseren', + 'refund' => 'Bevestig alstublieft dat u dit bedrag wilt terugbetalen.', + ], + ], + ], + + 'infolist' => [ + 'notes' => [ + 'label' => 'Notities', + 'placeholder' => 'Geen notities bij deze bestelling', + ], + 'delivery_instructions' => [ + 'label' => 'Leveringsinstructies', + ], + 'shipping_total' => [ + 'label' => 'Verzendkosten Totaal', + ], + 'paid' => [ + 'label' => 'Betaald', + ], + 'refund' => [ + 'label' => 'Terugbetaling', + ], + 'unit_price' => [ + 'label' => 'Eenheidsprijs', + ], + 'quantity' => [ + 'label' => 'Aantal', + ], + 'sub_total' => [ + 'label' => 'Subtotaal', + ], + 'discount_total' => [ + 'label' => 'Korting Totaal', + ], + 'total' => [ + 'label' => 'Totaal', + ], + 'current_stock_level' => [ + 'message' => 'Huidig Voorraadniveau: :count', + ], + 'purchase_stock_level' => [ + 'message' => 'op het moment van bestelling: :count', + ], + 'status' => [ + 'label' => 'Status', + ], + 'reference' => [ + 'label' => 'Referentie', + ], + 'customer_reference' => [ + 'label' => 'Klantreferentie', + ], + 'channel' => [ + 'label' => 'Kanaal', + ], + 'date_created' => [ + 'label' => 'Aanmaakdatum', + ], + 'date_placed' => [ + 'label' => 'Plaatsingsdatum', + ], + 'new_returning' => [ + 'label' => 'Nieuw / Terugkerend', + ], + 'new_customer' => [ + 'label' => 'Nieuwe Klant', + ], + 'returning_customer' => [ + 'label' => 'Terugkerende Klant', + ], + 'shipping_address' => [ + 'label' => 'Verzendadres', + ], + 'billing_address' => [ + 'label' => 'Factuuradres', + ], + 'address_not_set' => [ + 'label' => 'Geen adres ingesteld', + ], + 'billing_matches_shipping' => [ + 'label' => 'Zelfde als verzendadres', + ], + 'additional_info' => [ + 'label' => 'Aanvullende informatie', + ], + 'no_additional_info' => [ + 'label' => 'Geen aanvullende informatie', + ], + 'tags' => [ + 'label' => 'Tags', + ], + 'timeline' => [ + 'label' => 'Tijdlijn', + ], + 'transactions' => [ + 'label' => 'Transacties', + 'placeholder' => 'Geen transacties', + ], + 'alert' => [ + 'requires_capture' => 'Deze bestelling moet nog worden geïncasseerd.', + 'partially_refunded' => 'Deze bestelling is gedeeltelijk terugbetaald.', + 'refunded' => 'Deze bestelling is terugbetaald.', + ], + ], + + 'action' => [ + 'bulk_update_status' => [ + 'label' => 'Status Bijwerken', + 'notification' => 'Bestellingsstatus bijgewerkt', + ], + 'update_status' => [ + 'new_status' => [ + 'label' => 'Nieuwe status', + ], + 'additional_content' => [ + 'label' => 'Aanvullende inhoud', + ], + 'additional_email_recipient' => [ + 'label' => 'Aanvullende e-mailontvanger', + 'placeholder' => 'optioneel', + ], + ], + 'download_order_pdf' => [ + 'label' => 'PDF Downloaden', + 'notification' => 'Bestelling PDF downloaden', + ], + 'edit_address' => [ + 'label' => 'Bewerken', + + 'notification' => [ + 'error' => 'Fout', + + 'billing_address' => [ + 'saved' => 'Factuuradres opgeslagen', + ], + + 'shipping_address' => [ + 'saved' => 'Verzendadres opgeslagen', + ], + ], + ], + 'edit_tags' => [ + 'label' => 'Bewerken', + ], + 'capture_payment' => [ + 'label' => 'Betaling Incasseren', + + 'notification' => [ + 'error' => 'Er was een probleem met het incasseren', + 'success' => 'Incasseren succesvol', + ], + ], + 'refund_payment' => [ + 'label' => 'Terugbetaling', + + 'notification' => [ + 'error' => 'Er was een probleem met de terugbetaling', + 'success' => 'Terugbetaling succesvol', + ], + ], + ], + +]; + diff --git a/packages/admin/resources/lang/nl/product.php b/packages/admin/resources/lang/nl/product.php new file mode 100644 index 0000000000..1720034b0f --- /dev/null +++ b/packages/admin/resources/lang/nl/product.php @@ -0,0 +1,121 @@ + 'Product', + + 'plural_label' => 'Producten', + + 'status' => [ + 'unpublished' => [ + 'content' => 'Momenteel in conceptstatus, dit product is verborgen op alle kanalen en klantgroepen.', + ], + 'availability' => [ + 'customer_groups' => 'Dit product is momenteel niet beschikbaar voor alle klantgroepen.', + 'channels' => 'Dit product is momenteel niet beschikbaar voor alle kanalen.', + ], + ], + + 'table' => [ + 'status' => [ + 'label' => 'Status', + 'states' => [ + 'deleted' => 'Verwijderd', + 'draft' => 'Concept', + 'published' => 'Gepubliceerd', + ], + ], + 'name' => [ + 'label' => 'Naam', + ], + 'brand' => [ + 'label' => 'Merk', + ], + 'sku' => [ + 'label' => 'SKU', + ], + 'stock' => [ + 'label' => 'Voorraad', + ], + 'producttype' => [ + 'label' => 'Producttype', + ], + ], + + 'actions' => [ + 'edit_status' => [ + 'label' => 'Status Bijwerken', + 'heading' => 'Status Bijwerken', + ], + ], + + 'form' => [ + 'name' => [ + 'label' => 'Naam', + ], + 'brand' => [ + 'label' => 'Merk', + ], + 'sku' => [ + 'label' => 'SKU', + ], + 'producttype' => [ + 'label' => 'Producttype', + ], + 'status' => [ + 'label' => 'Status', + 'options' => [ + 'published' => [ + 'label' => 'Gepubliceerd', + 'description' => 'Dit product zal beschikbaar zijn voor alle ingeschakelde klantgroepen en kanalen', + ], + 'draft' => [ + 'label' => 'Concept', + 'description' => 'Dit product zal verborgen zijn op alle kanalen en klantgroepen', + ], + ], + ], + 'tags' => [ + 'label' => 'Tags', + ], + 'collections' => [ + 'label' => 'Collecties', + ], + ], + + 'pages' => [ + 'availability' => [ + 'label' => 'Beschikbaarheid', + ], + 'identifiers' => [ + 'label' => 'Product Identificatoren', + ], + 'inventory' => [ + 'label' => 'Voorraad', + ], + 'pricing' => [ + 'form' => [ + 'tax_class_id' => [ + 'label' => 'Belastingklasse', + ], + 'tax_ref' => [ + 'label' => 'Belastingreferentie', + 'helper_text' => 'Optioneel, voor integratie met systemen van derden.', + ], + ], + ], + 'shipping' => [ + 'label' => 'Verzending', + ], + 'variants' => [ + 'label' => 'Varianten', + ], + 'collections' => [ + 'label' => 'Collecties', + ], + 'associations' => [ + 'label' => 'Productassociaties', + ], + ], + +]; diff --git a/packages/admin/resources/lang/nl/productoption.php b/packages/admin/resources/lang/nl/productoption.php new file mode 100644 index 0000000000..d99beca27e --- /dev/null +++ b/packages/admin/resources/lang/nl/productoption.php @@ -0,0 +1,124 @@ + 'Productoptie', + + 'plural_label' => 'Productopties', + + 'table' => [ + 'name' => [ + 'label' => 'Naam', + ], + 'label' => [ + 'label' => 'Label', + ], + 'handle' => [ + 'label' => 'Handvat', + ], + 'shared' => [ + 'label' => 'Gedeeld', + ], + ], + + 'form' => [ + 'name' => [ + 'label' => 'Naam', + ], + 'label' => [ + 'label' => 'Label', + ], + 'handle' => [ + 'label' => 'Handvat', + ], + ], + + 'widgets' => [ + 'product-options' => [ + 'notifications' => [ + 'save-variants' => [ + 'success' => [ + 'title' => 'Productvarianten opgeslagen', + ], + ], + ], + 'actions' => [ + 'cancel' => [ + 'label' => 'Annuleren', + ], + 'save-options' => [ + 'label' => 'Opties opslaan', + ], + 'add-shared-option' => [ + 'label' => 'Gedeelde optie toevoegen', + 'form' => [ + 'product_option' => [ + 'label' => 'Productoptie', + ], + 'no_shared_components' => [ + 'label' => 'Er zijn geen gedeelde opties beschikbaar.', + ], + ], + ], + 'add-restricted-option' => [ + 'label' => 'Optie toevoegen', + ], + ], + 'options-list' => [ + 'empty' => [ + 'heading' => 'Er zijn geen productopties geconfigureerd', + 'description' => 'Voeg een gedeelde of beperkte productoptie toe om enkele varianten te genereren.', + ], + ], + 'options-table' => [ + 'title' => 'Productopties', + 'configure-options' => [ + 'label' => 'Opties configureren', + ], + 'table' => [ + 'option' => [ + 'label' => 'Optie', + ], + 'values' => [ + 'label' => 'Waarden', + ], + ], + ], + 'variants-table' => [ + 'title' => 'Productvarianten', + 'actions' => [ + 'create' => [ + 'label' => 'Variant maken', + ], + 'edit' => [ + 'label' => 'Bewerken', + ], + 'delete' => [ + 'label' => 'Verwijderen', + ], + ], + 'empty' => [ + 'heading' => 'Geen varianten geconfigureerd', + ], + 'table' => [ + 'new' => [ + 'label' => 'NIEUW', + ], + 'option' => [ + 'label' => 'Optie', + ], + 'sku' => [ + 'label' => 'SKU', + ], + 'price' => [ + 'label' => 'Prijs', + ], + 'stock' => [ + 'label' => 'Voorraad', + ], + ], + ], + ], + ], + +]; diff --git a/packages/admin/resources/lang/nl/producttype.php b/packages/admin/resources/lang/nl/producttype.php new file mode 100644 index 0000000000..2f674d3a30 --- /dev/null +++ b/packages/admin/resources/lang/nl/producttype.php @@ -0,0 +1,52 @@ + 'Producttype', + + 'plural_label' => 'Producttypen', + + 'table' => [ + 'name' => [ + 'label' => 'Naam', + ], + 'products_count' => [ + 'label' => 'Aantal producten', + ], + 'product_attributes_count' => [ + 'label' => 'Productattributen', + ], + 'variant_attributes_count' => [ + 'label' => 'Variantattributen', + ], + ], + + 'tabs' => [ + 'product_attributes' => [ + 'label' => 'Productattributen', + ], + 'variant_attributes' => [ + 'label' => 'Variantattributen', + ], + ], + + 'form' => [ + 'name' => [ + 'label' => 'Naam', + ], + ], + + 'attributes' => [ + 'no_groups' => 'Er zijn geen attributengroepen beschikbaar.', + 'no_attributes' => 'Er zijn geen attributen beschikbaar.', + ], + + 'action' => [ + 'delete' => [ + 'notification' => [ + 'error_protected' => 'Dit producttype kan niet worden verwijderd omdat er producten aan zijn gekoppeld.', + ], + ], + ], + +]; diff --git a/packages/admin/resources/lang/nl/productvariant.php b/packages/admin/resources/lang/nl/productvariant.php new file mode 100644 index 0000000000..468a51f04e --- /dev/null +++ b/packages/admin/resources/lang/nl/productvariant.php @@ -0,0 +1,105 @@ + 'Productvariant', + 'plural_label' => 'Productvarianten', + 'pages' => [ + 'edit' => [ + 'title' => 'Basisinformatie', + ], + 'media' => [ + 'title' => 'Media', + 'form' => [ + 'no_selection' => [ + 'label' => 'U heeft momenteel geen afbeelding geselecteerd voor deze variant.', + ], + 'no_media_available' => [ + 'label' => 'Er is momenteel geen media beschikbaar voor dit product.', + ], + 'images' => [ + 'label' => 'Primaire Afbeelding', + 'helper_text' => 'Selecteer de productafbeelding die deze variant vertegenwoordigt.', + ], + ], + ], + 'identifiers' => [ + 'title' => 'Identificatoren', + ], + 'inventory' => [ + 'title' => 'Voorraad', + ], + 'shipping' => [ + 'title' => 'Verzending', + ], + ], + 'form' => [ + 'sku' => [ + 'label' => 'Artikelnummer (SKU)', + ], + 'gtin' => [ + 'label' => 'Globaal Handelsartikelnummer (GTIN)', + ], + 'mpn' => [ + 'label' => 'Fabrikant Onderdeelnummer (MPN)', + ], + 'ean' => [ + 'label' => 'UPC/EAN', + ], + 'stock' => [ + 'label' => 'Op Voorraad', + ], + 'backorder' => [ + 'label' => 'In Nabestelling', + ], + 'purchasable' => [ + 'label' => 'Koopbaarheid', + 'options' => [ + 'always' => 'Altijd', + 'in_stock' => 'Op Voorraad', + 'in_stock_or_on_backorder' => 'Op Voorraad of In Nabestelling', + ], + ], + 'unit_quantity' => [ + 'label' => 'Eenheidsaantal', + 'helper_text' => 'Hoeveel individuele items vormen 1 eenheid.', + ], + 'min_quantity' => [ + 'label' => 'Minimale Hoeveelheid', + 'helper_text' => 'De minimale hoeveelheid van een productvariant die in één aankoop kan worden gekocht.', + ], + 'quantity_increment' => [ + 'label' => 'Hoeveelheidsverhoging', + 'helper_text' => 'De productvariant moet in veelvouden van deze hoeveelheid worden gekocht.', + ], + 'tax_class_id' => [ + 'label' => 'Belastingklasse', + ], + 'shippable' => [ + 'label' => 'Verzendbaar', + ], + 'length_value' => [ + 'label' => 'Lengte', + ], + 'length_unit' => [ + 'label' => 'Lengte-eenheid', + ], + 'width_value' => [ + 'label' => 'Breedte', + ], + 'width_unit' => [ + 'label' => 'Breedte-eenheid', + ], + 'height_value' => [ + 'label' => 'Hoogte', + ], + 'height_unit' => [ + 'label' => 'Hoogte-eenheid', + ], + 'weight_value' => [ + 'label' => 'Gewicht', + ], + 'weight_unit' => [ + 'label' => 'Gewichtseenheid', + ], + ], +]; diff --git a/packages/admin/resources/lang/nl/relationmanagers.php b/packages/admin/resources/lang/nl/relationmanagers.php new file mode 100644 index 0000000000..f982eead63 --- /dev/null +++ b/packages/admin/resources/lang/nl/relationmanagers.php @@ -0,0 +1,262 @@ + [ + 'actions' => [ + 'attach' => [ + 'label' => 'Klantengroep Koppelen', + ], + ], + 'form' => [ + 'name' => [ + 'label' => 'Naam', + ], + 'enabled' => [ + 'label' => 'Ingeschakeld', + ], + 'starts_at' => [ + 'label' => 'Startdatum', + ], + 'ends_at' => [ + 'label' => 'Einddatum', + ], + 'visible' => [ + 'label' => 'Zichtbaar', + ], + 'purchasable' => [ + 'label' => 'Koopbaar', + ], + ], + 'table' => [ + 'description' => 'Koppel klantengroepen aan dit :type om de beschikbaarheid te bepalen.', + 'name' => [ + 'label' => 'Naam', + ], + 'enabled' => [ + 'label' => 'Ingeschakeld', + ], + 'starts_at' => [ + 'label' => 'Startdatum', + ], + 'ends_at' => [ + 'label' => 'Einddatum', + ], + 'visible' => [ + 'label' => 'Zichtbaar', + ], + 'purchasable' => [ + 'label' => 'Koopbaar', + ], + ], + ], + 'channels' => [ + 'actions' => [ + 'attach' => [ + 'label' => 'Nog een Kanaal Inplannen', + ], + ], + 'form' => [ + 'enabled' => [ + 'label' => 'Ingeschakeld', + 'helper_text_false' => 'Dit kanaal wordt niet ingeschakeld, zelfs als er een startdatum aanwezig is.', + ], + 'starts_at' => [ + 'label' => 'Startdatum', + 'helper_text' => 'Laat leeg om beschikbaar te zijn vanaf elke datum.', + ], + 'ends_at' => [ + 'label' => 'Einddatum', + 'helper_text' => 'Laat leeg om onbeperkt beschikbaar te zijn.', + ], + ], + 'table' => [ + 'description' => 'Bepaal welke kanalen zijn ingeschakeld en plan de beschikbaarheid.', + 'name' => [ + 'label' => 'Naam', + ], + 'enabled' => [ + 'label' => 'Ingeschakeld', + ], + 'starts_at' => [ + 'label' => 'Startdatum', + ], + 'ends_at' => [ + 'label' => 'Einddatum', + ], + ], + ], + 'medias' => [ + 'title' => 'Media', + 'title_plural' => 'Media', + 'actions' => [ + 'create' => [ + 'label' => 'Media Aanmaken', + ], + 'view' => [ + 'label' => 'Bekijken', + ], + ], + 'form' => [ + 'name' => [ + 'label' => 'Naam', + ], + 'media' => [ + 'label' => 'Afbeelding', + ], + 'primary' => [ + 'label' => 'Primair', + ], + ], + 'table' => [ + 'image' => [ + 'label' => 'Afbeelding', + ], + 'file' => [ + 'label' => 'Bestand', + ], + 'name' => [ + 'label' => 'Naam', + ], + 'primary' => [ + 'label' => 'Primair', + ], + ], + ], + 'urls' => [ + 'title' => 'URL', + 'title_plural' => 'URLs', + 'actions' => [ + 'create' => [ + 'label' => 'URL Aanmaken', + ], + ], + 'filters' => [ + 'language_id' => [ + 'label' => 'Taal', + ], + ], + 'form' => [ + 'slug' => [ + 'label' => 'Slug', + ], + 'default' => [ + 'label' => 'Standaard', + ], + 'language' => [ + 'label' => 'Taal', + ], + ], + 'table' => [ + 'slug' => [ + 'label' => 'Slug', + ], + 'default' => [ + 'label' => 'Standaard', + ], + 'language' => [ + 'label' => 'Taal', + ], + ], + ], + 'customer_group_pricing' => [ + 'title' => 'Klantengroep Prijzen', + 'title_plural' => 'Klantengroep Prijzen', + 'table' => [ + 'heading' => 'Klantengroep Prijzen', + 'description' => 'Koppel prijs aan klantengroepen om de productprijs te bepalen.', + 'empty_state' => [ + 'label' => 'Er bestaan geen klantengroep prijzen.', + 'description' => 'Maak een klantengroep prijs om te beginnen.', + ], + 'actions' => [ + 'create' => [ + 'label' => 'Klantengroep Prijs Toevoegen', + 'modal' => [ + 'heading' => 'Klantengroep Prijs Aanmaken', + ], + ], + ], + ], + ], + 'pricing' => [ + 'title' => 'Prijzen', + 'title_plural' => 'Prijzen', + 'tab_name' => 'Prijsbreuken', + 'table' => [ + 'heading' => 'Prijsbreuken', + 'description' => 'Verlaag de prijs wanneer een klant in grotere hoeveelheden koopt.', + 'empty_state' => [ + 'label' => 'Er bestaan geen prijsbreuken.', + ], + 'actions' => [ + 'create' => [ + 'label' => 'Prijsbreuk Toevoegen', + ], + ], + 'price' => [ + 'label' => 'Prijs', + ], + 'customer_group' => [ + 'label' => 'Klantengroep', + 'placeholder' => 'Alle Klantengroepen', + ], + 'min_quantity' => [ + 'label' => 'Minimale Hoeveelheid', + ], + 'currency' => [ + 'label' => 'Valuta', + ], + ], + 'form' => [ + 'price' => [ + 'label' => 'Prijs', + 'helper_text' => 'De aankoopprijs, voor kortingen.', + ], + 'customer_group_id' => [ + 'label' => 'Klantengroep', + 'placeholder' => 'Alle Klantengroepen', + 'helper_text' => 'Selecteer welke klantengroep deze prijs van toepassing is.', + ], + 'min_quantity' => [ + 'label' => 'Minimale Hoeveelheid', + 'helper_text' => 'Selecteer de minimale hoeveelheid waarvoor deze prijs beschikbaar is.', + 'validation' => [ + 'unique' => 'Klantengroep en Minimale Hoeveelheid moeten uniek zijn.', + ], + ], + 'currency_id' => [ + 'label' => 'Valuta', + 'helper_text' => 'Selecteer de valuta voor deze prijs.', + ], + 'compare_price' => [ + 'label' => 'Vergelijkingsprijs', + 'helper_text' => 'De oorspronkelijke prijs of adviesprijs, ter vergelijking met de aankoopprijs.', + ], + 'basePrices' => [ + 'title' => 'Prijzen', + 'form' => [ + 'price' => [ + 'label' => 'Prijs', + 'helper_text' => 'De aankoopprijs, voor kortingen.', + ], + 'compare_price' => [ + 'label' => 'Vergelijkingsprijs', + 'helper_text' => 'De oorspronkelijke prijs of adviesprijs, ter vergelijking met de aankoopprijs.', + ], + ], + 'tooltip' => 'Automatisch gegenereerd op basis van wisselkoersen.', + ], + ], + ], + 'tax_rate_amounts' => [ + 'table' => [ + 'description' => '', + 'percentage' => [ + 'label' => 'Percentage', + ], + 'tax_class' => [ + 'label' => 'Belastingklasse', + ], + ], + ], +]; diff --git a/packages/admin/resources/lang/nl/staff.php b/packages/admin/resources/lang/nl/staff.php new file mode 100644 index 0000000000..bf9add60b6 --- /dev/null +++ b/packages/admin/resources/lang/nl/staff.php @@ -0,0 +1,81 @@ + 'Personeel', + + 'plural_label' => 'Personeel', + + 'table' => [ + 'firstname' => [ + 'label' => 'Voornaam', + ], + 'lastname' => [ + 'label' => 'Achternaam', + ], + 'email' => [ + 'label' => 'E-mail', + ], + 'admin' => [ + 'badge' => 'Super Admin', + ], + ], + + 'form' => [ + 'firstname' => [ + 'label' => 'Voornaam', + ], + 'lastname' => [ + 'label' => 'Achternaam', + ], + 'email' => [ + 'label' => 'E-mail', + ], + 'password' => [ + 'label' => 'Wachtwoord', + 'hint' => 'Wachtwoord resetten', + ], + 'admin' => [ + 'label' => 'Super Admin', + 'helper' => 'Super admin rollen kunnen niet worden gewijzigd in de hub.', + ], + 'roles' => [ + 'label' => 'Rollen', + 'helper' => ':roles hebben volledige toegang', + ], + 'permissions' => [ + 'label' => 'Machtigingen', + ], + 'role' => [ + 'label' => 'Rolnaam', + ], + ], + + 'action' => [ + 'acl' => [ + 'label' => 'Toegangscontrole', + ], + 'add-role' => [ + 'label' => 'Rol toevoegen', + ], + 'delete-role' => [ + 'label' => 'Rol verwijderen', + 'heading' => 'Rol verwijderen: :role', + ], + ], + + 'acl' => [ + 'title' => 'Toegangscontrole', + 'tooltip' => [ + 'roles-included' => 'Machtiging is inbegrepen in de volgende rollen', + ], + 'notification' => [ + 'updated' => 'Bijgewerkt', + 'error' => 'Fout', + 'no-role' => 'Rol niet geregistreerd in Lunar', + 'no-permission' => 'Machtiging niet geregistreerd in Lunar', + 'no-role-permission' => 'Rol en Machtiging niet geregistreerd in Lunar', + ], + ], + +]; diff --git a/packages/admin/resources/lang/nl/tag.php b/packages/admin/resources/lang/nl/tag.php new file mode 100644 index 0000000000..ece834d9d7 --- /dev/null +++ b/packages/admin/resources/lang/nl/tag.php @@ -0,0 +1,21 @@ + 'Label', + + 'plural_label' => 'Labels', + + 'table' => [ + 'value' => [ + 'label' => 'Waarde', + ], + ], + + 'form' => [ + 'value' => [ + 'label' => 'Waarde', + ], + ], + +]; diff --git a/packages/admin/resources/lang/nl/taxclass.php b/packages/admin/resources/lang/nl/taxclass.php new file mode 100644 index 0000000000..506e5962b0 --- /dev/null +++ b/packages/admin/resources/lang/nl/taxclass.php @@ -0,0 +1,27 @@ + 'Belastingklasse', + + 'plural_label' => 'Belastingklassen', + + 'table' => [ + 'name' => [ + 'label' => 'Naam', + ], + 'default' => [ + 'label' => 'Standaard', + ], + ], + + 'form' => [ + 'name' => [ + 'label' => 'Naam', + ], + 'default' => [ + 'label' => 'Standaard', + ], + ], + +]; diff --git a/packages/admin/resources/lang/nl/taxrate.php b/packages/admin/resources/lang/nl/taxrate.php new file mode 100644 index 0000000000..dbd6e7cd3d --- /dev/null +++ b/packages/admin/resources/lang/nl/taxrate.php @@ -0,0 +1,33 @@ + 'Belastingtarief', + + 'plural_label' => 'Belastingtarieven', + + 'table' => [ + 'name' => [ + 'label' => 'Naam', + ], + 'tax_zone' => [ + 'label' => 'Belastingzone', + ], + 'priority' => [ + 'label' => 'Prioriteit', + ], + ], + + 'form' => [ + 'name' => [ + 'label' => 'Naam', + ], + 'priority' => [ + 'label' => 'Prioriteit', + ], + 'tax_zone_id' => [ + 'label' => 'Belastingzone', + ], + ], + +]; diff --git a/packages/admin/resources/lang/nl/taxzone.php b/packages/admin/resources/lang/nl/taxzone.php new file mode 100644 index 0000000000..d1aabe7b7d --- /dev/null +++ b/packages/admin/resources/lang/nl/taxzone.php @@ -0,0 +1,69 @@ + 'Belastingzone', + + 'plural_label' => 'Belastingzones', + + 'table' => [ + 'name' => [ + 'label' => 'Naam', + ], + 'zone_type' => [ + 'label' => 'Zonetype', + ], + 'active' => [ + 'label' => 'Actief', + ], + 'default' => [ + 'label' => 'Standaard', + ], + ], + + 'form' => [ + 'name' => [ + 'label' => 'Naam', + ], + 'zone_type' => [ + 'label' => 'Zonetype', + 'options' => [ + 'country' => 'Beperk tot Landen', + 'states' => 'Beperk tot Staten', + 'postcodes' => 'Beperk tot Postcodes', + ], + ], + 'price_display' => [ + 'label' => 'Prijsweergave', + 'options' => [ + 'include_tax' => 'Inclusief Belasting', + 'exclude_tax' => 'Exclusief Belasting', + ], + ], + 'active' => [ + 'label' => 'Actief', + ], + 'default' => [ + 'label' => 'Standaard', + ], + + 'zone_countries' => [ + 'label' => 'Landen', + ], + + 'zone_country' => [ + 'label' => 'Land', + ], + + 'zone_states' => [ + 'label' => 'Staten', + ], + + 'zone_postcodes' => [ + 'label' => 'Postcodes', + 'helper' => 'Plaats elke postcode op een nieuwe regel. Ondersteunt wildcards zoals NW*', + ], + + ], + +]; diff --git a/packages/admin/resources/lang/nl/user.php b/packages/admin/resources/lang/nl/user.php new file mode 100644 index 0000000000..ffe06b5994 --- /dev/null +++ b/packages/admin/resources/lang/nl/user.php @@ -0,0 +1,29 @@ + 'Gebruiker', + + 'plural_label' => 'Gebruikers', + + 'table' => [ + 'name' => [ + 'label' => 'Naam', + ], + 'email' => [ + 'label' => 'E-mail', + ], + ], + + 'form' => [ + 'email' => [ + 'label' => 'E-mail', + ], + 'password' => [ + 'label' => 'Nieuw Wachtwoord', + ], + 'password_confirmation' => [ + 'label' => 'Bevestig Nieuw Wachtwoord', + ], + ], +]; diff --git a/packages/admin/resources/lang/nl/widgets.php b/packages/admin/resources/lang/nl/widgets.php new file mode 100644 index 0000000000..6ee4f9d56f --- /dev/null +++ b/packages/admin/resources/lang/nl/widgets.php @@ -0,0 +1,119 @@ + [ + 'orders' => [ + 'order_stats_overview' => [ + 'stat_one' => [ + 'label' => 'Bestellingen vandaag', + 'increase' => ':percentage% toename ten opzichte van :count gisteren', + 'decrease' => ':percentage% afname ten opzichte van :count gisteren', + 'neutral' => 'Geen verandering ten opzichte van gisteren', + ], + 'stat_two' => [ + 'label' => 'Bestellingen afgelopen 7 dagen', + 'increase' => ':percentage% toename ten opzichte van :count vorige periode', + 'decrease' => ':percentage% afname ten opzichte van :count vorige periode', + 'neutral' => 'Geen verandering ten opzichte van vorige periode', + ], + 'stat_three' => [ + 'label' => 'Bestellingen afgelopen 30 dagen', + 'increase' => ':percentage% toename ten opzichte van :count vorige periode', + 'decrease' => ':percentage% afname ten opzichte van :count vorige periode', + 'neutral' => 'Geen verandering ten opzichte van vorige periode', + ], + 'stat_four' => [ + 'label' => 'Verkopen vandaag', + 'increase' => ':percentage% toename ten opzichte van :total gisteren', + 'decrease' => ':percentage% afname ten opzichte van :total gisteren', + 'neutral' => 'Geen verandering ten opzichte van gisteren', + ], + 'stat_five' => [ + 'label' => 'Verkopen afgelopen 7 dagen', + 'increase' => ':percentage% toename ten opzichte van :total vorige periode', + 'decrease' => ':percentage% afname ten opzichte van :total vorige periode', + 'neutral' => 'Geen verandering ten opzichte van vorige periode', + ], + 'stat_six' => [ + 'label' => 'Verkopen afgelopen 30 dagen', + 'increase' => ':percentage% toename ten opzichte van :total vorige periode', + 'decrease' => ':percentage% afname ten opzichte van :total vorige periode', + 'neutral' => 'Geen verandering ten opzichte van vorige periode', + ], + ], + 'order_totals_chart' => [ + 'heading' => 'Bestellingstotalen van het afgelopen jaar', + 'series_one' => [ + 'label' => 'Deze Periode', + ], + 'series_two' => [ + 'label' => 'Vorige Periode', + ], + 'yaxis' => [ + 'label' => 'Omzet :currency', + ], + ], + 'order_sales_chart' => [ + 'heading' => 'Bestellingen / Verkooprapport', + 'series_one' => [ + 'label' => 'Bestellingen', + ], + 'series_two' => [ + 'label' => 'Omzet', + ], + 'yaxis' => [ + 'series_one' => [ + 'label' => '# Bestellingen', + ], + 'series_two' => [ + 'label' => 'Totale Waarde', + ], + ], + ], + 'average_order_value' => [ + 'heading' => 'Gemiddelde Bestelwaarde', + ], + 'new_returning_customers' => [ + 'heading' => 'Nieuwe vs Terugkerende Klanten', + 'series_one' => [ + 'label' => 'Nieuwe Klanten', + ], + 'series_two' => [ + 'label' => 'Terugkerende Klanten', + ], + ], + 'popular_products' => [ + 'heading' => 'Bestverkochte producten (laatste 12 maanden)', + 'description' => 'Deze cijfers zijn gebaseerd op het aantal keren dat een product in een bestelling voorkomt, niet op de bestelde hoeveelheid.', + ], + 'latest_orders' => [ + 'heading' => 'Laatste bestellingen', + ], + ], + ], + 'customer' => [ + 'stats_overview' => [ + 'total_orders' => [ + 'label' => 'Totaal aantal bestellingen', + ], + 'avg_spend' => [ + 'label' => 'Gem. Uitgave', + ], + 'total_spend' => [ + 'label' => 'Totale Uitgave', + ], + ], + ], + 'variant_switcher' => [ + 'label' => 'Variant Wisselen', + 'table' => [ + 'sku' => [ + 'label' => 'SKU', + ], + 'values' => [ + 'label' => 'Waarden', + ], + ], + ], +]; + diff --git a/packages/core/resources/lang/nl/base.php b/packages/core/resources/lang/nl/base.php new file mode 100644 index 0000000000..9f681208d9 --- /dev/null +++ b/packages/core/resources/lang/nl/base.php @@ -0,0 +1,9 @@ + [ + 'collection-titles' => [ + 'images' => 'Afbeeldingen', + ], + ], +]; diff --git a/packages/core/resources/lang/nl/exceptions.php b/packages/core/resources/lang/nl/exceptions.php new file mode 100644 index 0000000000..3ca3a30950 --- /dev/null +++ b/packages/core/resources/lang/nl/exceptions.php @@ -0,0 +1,21 @@ + 'Het ":class" model implementeert de koopbare interface niet.', + 'cart_line_id_mismatch' => 'Deze winkelwagenregel behoort niet tot deze winkelwagen', + 'invalid_cart_line_quantity' => 'Verwachte hoeveelheid is minimaal "1", ":quantity" gevonden.', + 'maximum_cart_line_quantity' => 'Hoeveelheid mag niet meer zijn dan :quantity.', + 'carts.invalid_action' => 'De winkelwagenactie was ongeldig', + 'carts.shipping_missing' => 'Een verzendadres is vereist', + 'carts.billing_missing' => 'Een factuuradres is vereist', + 'carts.billing_incomplete' => 'Het factuuradres is onvolledig', + 'carts.order_exists' => 'Er bestaat al een bestelling voor deze winkelwagen', + 'carts.shipping_option_missing' => 'Ontbrekende verzendoptie', + 'missing_currency_price' => 'Er bestaat geen prijs voor valuta ":currency"', + 'minimum_quantity' => 'U moet minimaal :quantity items toevoegen.', + 'quantity_increment' => 'Hoeveelheid :quantity moet in stappen van :increment zijn', + 'fieldtype_missing' => 'FieldType ":class" bestaat niet', + 'invalid_fieldtype' => 'Klasse ":class" implementeert de FieldType interface niet.', + 'discounts.invalid_type' => 'Collectie moet alleen ":expected" bevatten, gevonden ":actual"', + 'disallow_multiple_cart_orders' => 'Winkelwagens kunnen slechts één bestelling hebben.', +]; From 7f6ced9feb7bce9051ae017379c6ffefe77aa51a Mon Sep 17 00:00:00 2001 From: Aaron lawrence <91675986+AaronNeonDigital@users.noreply.github.com> Date: Tue, 19 Nov 2024 23:14:05 +0000 Subject: [PATCH 31/35] Fix type declaration on toggle field type (#1982) This PR fixes the type declaration of `Lunar\FieldTypes\Toggle` to allow `boolean|string` types. Currently it is set to just `string`. --------- Co-authored-by: Author Co-authored-by: Glenn Jacobs --- packages/admin/resources/lang/es/order.php | 2 +- packages/admin/resources/lang/nl/order.php | 3 +-- packages/admin/resources/lang/nl/widgets.php | 1 - packages/core/src/FieldTypes/Toggle.php | 2 +- .../resources/lang/es/relationmanagers.php | 2 +- .../core/Unit/FieldTypes/ToggleFieldTest.php | 24 +++++++++++++++++++ 6 files changed, 28 insertions(+), 6 deletions(-) create mode 100644 tests/core/Unit/FieldTypes/ToggleFieldTest.php diff --git a/packages/admin/resources/lang/es/order.php b/packages/admin/resources/lang/es/order.php index 9a27272e40..2aee39a6da 100644 --- a/packages/admin/resources/lang/es/order.php +++ b/packages/admin/resources/lang/es/order.php @@ -113,7 +113,7 @@ 'label' => 'Cantidad', 'hint' => [ - 'less_than_total' => "Está a punto de capturar un monto menor al valor total de la transacción", + 'less_than_total' => 'Está a punto de capturar un monto menor al valor total de la transacción', ], ], diff --git a/packages/admin/resources/lang/nl/order.php b/packages/admin/resources/lang/nl/order.php index aa2ba2a11f..311cce8d89 100644 --- a/packages/admin/resources/lang/nl/order.php +++ b/packages/admin/resources/lang/nl/order.php @@ -113,7 +113,7 @@ 'label' => 'Bedrag', 'hint' => [ - 'less_than_total' => "Je staat op het punt een bedrag te incasseren dat minder is dan de totale transactiewaarde", + 'less_than_total' => 'Je staat op het punt een bedrag te incasseren dat minder is dan de totale transactiewaarde', ], ], @@ -290,4 +290,3 @@ ], ]; - diff --git a/packages/admin/resources/lang/nl/widgets.php b/packages/admin/resources/lang/nl/widgets.php index 6ee4f9d56f..fcfa019967 100644 --- a/packages/admin/resources/lang/nl/widgets.php +++ b/packages/admin/resources/lang/nl/widgets.php @@ -116,4 +116,3 @@ ], ], ]; - diff --git a/packages/core/src/FieldTypes/Toggle.php b/packages/core/src/FieldTypes/Toggle.php index a229b16071..9949210133 100644 --- a/packages/core/src/FieldTypes/Toggle.php +++ b/packages/core/src/FieldTypes/Toggle.php @@ -26,7 +26,7 @@ public function jsonSerialize(): mixed /** * Create a new instance of Toggle field type. * - * @param string $value + * @param bool|string $value */ public function __construct($value = false) { diff --git a/packages/table-rate-shipping/resources/lang/es/relationmanagers.php b/packages/table-rate-shipping/resources/lang/es/relationmanagers.php index 8a25486a86..5b4d6c6015 100644 --- a/packages/table-rate-shipping/resources/lang/es/relationmanagers.php +++ b/packages/table-rate-shipping/resources/lang/es/relationmanagers.php @@ -3,7 +3,7 @@ return [ 'shipping_methods' => [ 'customer_groups' => [ - 'description' => "Asocia grupos de clientes a este método de envío para determinar su disponibilidad.", + 'description' => 'Asocia grupos de clientes a este método de envío para determinar su disponibilidad.', ], ], 'shipping_rates' => [ diff --git a/tests/core/Unit/FieldTypes/ToggleFieldTest.php b/tests/core/Unit/FieldTypes/ToggleFieldTest.php new file mode 100644 index 0000000000..629196cc25 --- /dev/null +++ b/tests/core/Unit/FieldTypes/ToggleFieldTest.php @@ -0,0 +1,24 @@ +setValue(false); + + expect($field->getValue())->toEqual(false); +}); + +test('can set value in constructor', function () { + $field = new Toggle(true); + + expect($field->getValue())->toEqual(true); +}); + +test('check it does not allow array', function () { + $this->expectException(FieldTypeException::class); + + new Toggle(['foo']); +}); From 9fb098ff06cf293386316ae11031b44d370b0af3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferdi=20=C3=9CNAL?= Date: Wed, 20 Nov 2024 02:18:52 +0300 Subject: [PATCH 32/35] fix: removed $navigationLabel static property for localization. (#1977) Hello, First of all, thank you for providing us this product for free. I am doing localisation work with this PR I opened. When I translate the language files into Turkish, localisation does not work properly because the `protected static ?string $navigationLabel` property in the `\Lunar\Admin\Filament\Resources\CollectionGroupResource` class is static. I think the `$navigationLabel` property should be removed to fix this. Before removal Turkish: image English image --- After removal Turkish: image English: image Co-authored-by: Glenn Jacobs --- .../admin/src/Filament/Resources/CollectionGroupResource.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/admin/src/Filament/Resources/CollectionGroupResource.php b/packages/admin/src/Filament/Resources/CollectionGroupResource.php index d96f76427d..d506b2184c 100644 --- a/packages/admin/src/Filament/Resources/CollectionGroupResource.php +++ b/packages/admin/src/Filament/Resources/CollectionGroupResource.php @@ -21,8 +21,6 @@ class CollectionGroupResource extends BaseResource protected static ?int $navigationSort = 3; - protected static ?string $navigationLabel = 'Collections'; - public static function getLabel(): string { return __('lunarpanel::collectiongroup.label'); From cc1c927cb02bd84664e5efb16eccacc702272c82 Mon Sep 17 00:00:00 2001 From: halmanza <53095432+halmanza@users.noreply.github.com> Date: Tue, 19 Nov 2024 16:20:50 -0700 Subject: [PATCH 33/35] Add description for setting minimum-stability to be set to dev for local development (#1963) ## Description Updates documentation for the `local-development.md` to include `minimum-stability` should be set to `dev` in `composer.json`. - Error displayed when not setting `minimum-stability` option to `dev` ```sh Root composer.json requires lunarphp/lunar , it is satisfiable by lunarphp/lunar[0.1.1, ..., 0.8.1] from composer repo (https://repo.packagist.org/) but lunarphp/lunar[1.x-dev] from path repo (packages/) has higher repository priority. The packages from the higher priority repository do not match your minimum-stability and are therefore not installable. That repository is canonical so the lower priority repo's packages are not installable. See https://getcomposer.org/repoprio for details and assistance. ```` Co-authored-by: halmanza --- docs/core/local-development.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/core/local-development.md b/docs/core/local-development.md index f3cf643e91..c5ec42339e 100644 --- a/docs/core/local-development.md +++ b/docs/core/local-development.md @@ -45,6 +45,11 @@ Update your `composer.json` file similar to the following. } ```` +Ensure minimum stability is set for development +```json + "minimum-stability": "dev", +```` + Run `composer update` from your Laravel application's root directory and fingers crossed you're all up and running,. ```sh From 613e597eb40dff46d6dbb80e4c18bb41bab7c226 Mon Sep 17 00:00:00 2001 From: Lionel Guichard Date: Wed, 20 Nov 2024 00:28:48 +0100 Subject: [PATCH 34/35] Fix doc schedule the product for customer groups (#1950) --- docs/core/reference/products.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/core/reference/products.md b/docs/core/reference/products.md index 252ce776e2..94e663f2cb 100644 --- a/docs/core/reference/products.md +++ b/docs/core/reference/products.md @@ -35,13 +35,13 @@ group, or you can state which dates they should be active for (as long as the cu ```php // Will schedule for this product to be enabled in 14 days for this customer group. -$product->schedule($customerGroup, now()->addDays(14)); +$product->scheduleCustomerGroup($customerGroup, now()->addDays(14)); // Schedule the product to be enabled straight away -$product->schedule($customerGroup); +$product->scheduleCustomerGroup($customerGroup); // The schedule method will accept an array or collection of customer groups. -$product->schedule(CustomerGroup::get()); +$product->scheduleCustomerGroup(CustomerGroup::get()); ``` ### Retrieving products for a customer group From fd3008b9ba95c16318d6be7c34f3ccf881eb4bfe Mon Sep 17 00:00:00 2001 From: Ryan Mitchell Date: Tue, 19 Nov 2024 23:31:22 +0000 Subject: [PATCH 35/35] Allow extending of page edit record forms (#1938) This PR adds the ability to extend base edit record pages. Our use case is the ability to add to the inventory pages, which is why I've applied this to them. --------- Co-authored-by: Author --- .../Pages/ManageProductInventory.php | 2 +- .../Pages/ManageVariantInventory.php | 2 +- .../src/Support/Pages/BaseCreateRecord.php | 1 + .../admin/src/Support/Pages/BaseEditRecord.php | 1 + .../Support/Pages/Concerns/ExtendsForms.php | 18 ++++++++++++++++++ 5 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 packages/admin/src/Support/Pages/Concerns/ExtendsForms.php diff --git a/packages/admin/src/Filament/Resources/ProductResource/Pages/ManageProductInventory.php b/packages/admin/src/Filament/Resources/ProductResource/Pages/ManageProductInventory.php index 900356b578..da6d6ef1ff 100644 --- a/packages/admin/src/Filament/Resources/ProductResource/Pages/ManageProductInventory.php +++ b/packages/admin/src/Filament/Resources/ProductResource/Pages/ManageProductInventory.php @@ -92,7 +92,7 @@ protected function getFormActions(): array ]; } - public function form(Form $form): Form + public function getDefaultForm(Form $form): Form { return (new ManageVariantInventory)->form($form)->statePath(''); } diff --git a/packages/admin/src/Filament/Resources/ProductVariantResource/Pages/ManageVariantInventory.php b/packages/admin/src/Filament/Resources/ProductVariantResource/Pages/ManageVariantInventory.php index 3dec22cadd..72aac2712d 100644 --- a/packages/admin/src/Filament/Resources/ProductVariantResource/Pages/ManageVariantInventory.php +++ b/packages/admin/src/Filament/Resources/ProductVariantResource/Pages/ManageVariantInventory.php @@ -61,7 +61,7 @@ protected function getDefaultHeaderActions(): array ]; } - public function form(Form $form): Form + public function getDefaultForm(Form $form): Form { return $form->schema([ Section::make()->schema([ diff --git a/packages/admin/src/Support/Pages/BaseCreateRecord.php b/packages/admin/src/Support/Pages/BaseCreateRecord.php index 4a0b803d8e..0c5e414618 100644 --- a/packages/admin/src/Support/Pages/BaseCreateRecord.php +++ b/packages/admin/src/Support/Pages/BaseCreateRecord.php @@ -9,6 +9,7 @@ abstract class BaseCreateRecord extends CreateRecord { use Concerns\ExtendsFooterWidgets; use Concerns\ExtendsFormActions; + use Concerns\ExtendsForms; use Concerns\ExtendsHeaderActions; use Concerns\ExtendsHeaderWidgets; use Concerns\ExtendsHeadings; diff --git a/packages/admin/src/Support/Pages/BaseEditRecord.php b/packages/admin/src/Support/Pages/BaseEditRecord.php index f63f3de97c..4e43fbed8a 100644 --- a/packages/admin/src/Support/Pages/BaseEditRecord.php +++ b/packages/admin/src/Support/Pages/BaseEditRecord.php @@ -9,6 +9,7 @@ abstract class BaseEditRecord extends EditRecord { use Concerns\ExtendsFooterWidgets; use Concerns\ExtendsFormActions; + use Concerns\ExtendsForms; use Concerns\ExtendsHeaderActions; use Concerns\ExtendsHeaderWidgets; use Concerns\ExtendsHeadings; diff --git a/packages/admin/src/Support/Pages/Concerns/ExtendsForms.php b/packages/admin/src/Support/Pages/Concerns/ExtendsForms.php new file mode 100644 index 0000000000..d699471537 --- /dev/null +++ b/packages/admin/src/Support/Pages/Concerns/ExtendsForms.php @@ -0,0 +1,18 @@ +getDefaultForm($form)); + } + + public function getDefaultForm(Form $form): Form + { + return $form; + } +}