-
Notifications
You must be signed in to change notification settings - Fork 367
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '0.8' into it-translation
- Loading branch information
Showing
9 changed files
with
308 additions
and
6 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
packages/admin/resources/views/partials/orders/activity/email-notification.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<div> | ||
@livewire('hub.components.orders.emil-notification', [ | ||
@livewire('hub.components.orders.email-notification', [ | ||
'log' => $log, | ||
]) | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
return [ | ||
'non_purchasable_item' => 'Das Model ":class" implementiert nicht das "Bestellbar (purchasable)" Interface.', | ||
'cart_line_id_mismatch' => 'Die Position gehört nicht zu diesem Warenkorb.', | ||
'invalid_cart_line_quantity' => 'Die Bestellmenge muss mindestens "1" sein, angegeben wurden ":quantity".', | ||
'maximum_cart_line_quantity' => 'Die Bestellmenge darf nicht mehr als ":quantity" betragen.', | ||
'carts.shipping_missing' => 'Eine Lieferadresse ist erforderlich', | ||
'carts.billing_missing' => 'Eine Rechnungsadresse ist erforderlich', | ||
'carts.billing_incomplete' => 'Die Rechnungsadresse ist unvollständig', | ||
'carts.order_exists' => 'Für diesen Warenkorb existiert bereits eine Bestellung', | ||
'carts.shipping_option_missing' => 'Eine gültige Versandart fehlt', | ||
'missing_currency_price' => 'Es existiert kein Preis für die Währung ":currency"', | ||
'fieldtype_missing' => 'Der FeldType ":class" existiert nicht', | ||
'invalid_fieldtype' => 'Die Klasse ":class" implementiert nicht das Feldtyp-Interface.', | ||
'discounts.invalid_type' => 'Die Liste der Rabatte darf nur ":expected" enthalten, gefunden wurde ":actual"', | ||
'disallow_multiple_cart_orders' => 'Ein Warenkorb kann nur zu einer Bestellung gehören.', | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
139 changes: 139 additions & 0 deletions
139
packages/core/tests/Stubs/DataTypes/TestPurchasable.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
<?php | ||
|
||
namespace Lunar\Tests\Stubs\DataTypes; | ||
|
||
use Illuminate\Support\Collection; | ||
use Lunar\Base\Purchasable; | ||
use Lunar\DataTypes\Price; | ||
use Lunar\Models\TaxClass; | ||
|
||
class TestPurchasable implements Purchasable | ||
{ | ||
public function __construct( | ||
public $name, | ||
public $description, | ||
public $identifier, | ||
public Price $price, | ||
public TaxClass $taxClass, | ||
public $taxReference = null, | ||
public $option = null, | ||
public bool $collect = false, | ||
public $meta = null | ||
) { | ||
// .. | ||
} | ||
|
||
/** | ||
* Get the price for the purchasable item. | ||
* | ||
* @return \Lunar\DataTypes\Price | ||
*/ | ||
public function getPrice() | ||
{ | ||
return $this->price; | ||
} | ||
|
||
/** | ||
* Get prices for the purchasable item. | ||
*/ | ||
public function getPrices(): Collection | ||
{ | ||
return collect([ | ||
$this->price, | ||
]); | ||
} | ||
|
||
/** | ||
* Return the purchasable unit quantity. | ||
*/ | ||
public function getUnitQuantity(): int | ||
{ | ||
return 1; | ||
} | ||
|
||
/** | ||
* Return the purchasable tax class. | ||
*/ | ||
public function getTaxClass(): TaxClass | ||
{ | ||
return $this->taxClass; | ||
} | ||
|
||
/** | ||
* Return the purchasable tax reference. | ||
* | ||
* @return string|null | ||
*/ | ||
public function getTaxReference() | ||
{ | ||
return $this->taxReference; | ||
} | ||
|
||
/** | ||
* Return what type of purchasable this is, i.e. physical,digital,shipping. | ||
* | ||
* @return string | ||
*/ | ||
public function getType() | ||
{ | ||
return 'test-purchsable'; | ||
} | ||
|
||
/** | ||
* Return the name for the purchasable. | ||
* | ||
* @return string | ||
*/ | ||
public function getName() | ||
{ | ||
return $this->name; | ||
} | ||
|
||
/** | ||
* Return the description for the purchasable. | ||
* | ||
* @return string | ||
*/ | ||
public function getDescription() | ||
{ | ||
return $this->description; | ||
} | ||
|
||
/** | ||
* Return the option for this purchasable. | ||
* | ||
* @return string|null | ||
*/ | ||
public function getOption() | ||
{ | ||
return $this->option; | ||
} | ||
|
||
/** | ||
* Return a unique string which identifies the purchasable item. | ||
* | ||
* @return string | ||
*/ | ||
public function getIdentifier() | ||
{ | ||
return $this->identifier; | ||
} | ||
|
||
/** | ||
* Returns whether the purchasable item is shippable. | ||
* | ||
* @return bool | ||
*/ | ||
public function isShippable() | ||
{ | ||
return false; | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public function getThumbnail() | ||
{ | ||
return null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<?php | ||
|
||
namespace Lunar\Tests\Unit\Base; | ||
|
||
use Illuminate\Foundation\Testing\RefreshDatabase; | ||
use Lunar\Base\ShippingModifier; | ||
use Lunar\Base\ShippingModifiers; | ||
use Lunar\Models\Cart; | ||
use Lunar\Models\Currency; | ||
use Lunar\Tests\TestCase; | ||
|
||
class ShippingModifiersTest extends TestCase | ||
{ | ||
use RefreshDatabase; | ||
|
||
private Cart $cart; | ||
|
||
private ShippingModifiers $shippingModifiers; | ||
|
||
private ShippingModifier $class; | ||
|
||
public function setUp(): void | ||
{ | ||
parent::setUp(); | ||
|
||
$currency = Currency::factory()->create([ | ||
'decimal_places' => 2, | ||
]); | ||
|
||
$this->cart = Cart::factory()->create([ | ||
'currency_id' => $currency->id, | ||
]); | ||
|
||
$this->class = new class extends ShippingModifier | ||
{ | ||
public function handle(Cart $cart) | ||
{ | ||
// | ||
} | ||
}; | ||
|
||
$this->shippingModifiers = new ShippingModifiers(); | ||
} | ||
|
||
/** @test */ | ||
public function can_add_modifier() | ||
{ | ||
$this->shippingModifiers->add($this->class::class); | ||
|
||
$this->assertCount(1, $this->shippingModifiers->getModifiers()); | ||
} | ||
|
||
|
||
public function can_remove_modifier() | ||
{ | ||
$this->shippingModifiers->remove($this->class::class); | ||
|
||
$this->assertCount(0, $this->shippingModifiers->getModifiers()); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters