Skip to content

Commit 76b48df

Browse files
authored
Merge pull request #57 from shopware/fix/missing-shippinglocation-in-saleschannelcontext
fix: missing shippingLocation in salesChannelContext
2 parents 5cb82ba + a98a0cf commit 76b48df

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

src/Context/SalesChannelContext/Country.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,18 @@
55
namespace Shopware\App\SDK\Context\SalesChannelContext;
66

77
use Shopware\App\SDK\Context\ArrayStruct;
8+
use Shopware\App\SDK\Context\Trait\CustomFieldsAware;
89

910
class Country extends ArrayStruct
1011
{
12+
use CustomFieldsAware;
13+
14+
public function getId(): string
15+
{
16+
\assert(is_string($this->data['id']));
17+
return $this->data['id'];
18+
}
19+
1120
public function getName(): string
1221
{
1322
\assert(is_string($this->data['name']));

src/Context/SalesChannelContext/SalesChannelContext.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,10 @@ public function getLanguageInfo(): LanguageInfo
7878
\assert(\is_array($this->data['languageInfo']));
7979
return new LanguageInfo($this->data['languageInfo']);
8080
}
81+
82+
public function getShippingLocation(): ShippingLocation
83+
{
84+
\assert(\is_array($this->data['shippingLocation']));
85+
return new ShippingLocation($this->data['shippingLocation']);
86+
}
8187
}

0 commit comments

Comments
 (0)