Skip to content

Commit 0a28645

Browse files
committed
Merge branch 'ntr/5.7/add-customer-group-key-to-session' into '5.6'
NTR - Add customer group key to session in product export See merge request shopware/5/product/shopware!385
2 parents 82e2cf0 + 472ebf6 commit 0a28645

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

UPGRADE-5.6.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ This changelog references changes done in Shopware 5.6 patch versions.
8888
* Changed cookie consent manager to work correctly when accepting all cookies
8989
* Renamed duplicated smarty block `frontend_listing_box_article_badges` in the files `frontend/listing/product-box/box-basic.tpl` and `frontend/listing/product-box/box-emotion.tpl`
9090
* Changed tinymce to fix issues with `readOnly` is not resetting
91+
* Changed sExport to set correct customer group in the shop context
9192

9293
## 5.6.6
9394

engine/Shopware/Core/sExport.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ public function sGetCurrency($currency)
181181
/**
182182
* @param int|string $customerGroup
183183
*
184-
* @return bool
184+
* @return bool|array
185185
*/
186186
public function sGetCustomergroup($customerGroup)
187187
{
@@ -312,6 +312,11 @@ public function sInitSettings()
312312
$currency = $repository->find($this->sCurrency['id']);
313313
$shop->setCurrency($currency);
314314
Shopware()->Container()->get('shopware.components.shop_registration_service')->registerShop($shop);
315+
316+
if ($this->sCustomergroup !== false) {
317+
Shopware()->Container()->get('session')->offsetSet('sUserGroup', $this->sCustomergroup['groupkey']);
318+
}
319+
315320
$this->contextService->initializeContext();
316321

317322
$this->shop = $shop;
@@ -1291,7 +1296,7 @@ public function sGetPaymentmean($payment)
12911296
$cache[$payment]['country_surcharge'] = [];
12921297
if (!empty($cache[$payment]['surchargestring'])) {
12931298
foreach (explode(';', $cache[$payment]['surchargestring']) as $countrySurcharge) {
1294-
list($key, $value) = explode(':', $countrySurcharge);
1299+
[$key, $value] = explode(':', $countrySurcharge);
12951300
$value = (float) str_replace(',', '.', $value);
12961301
if (!empty($value)) {
12971302
$cache[$payment]['country_surcharge'][$key] = $value;
@@ -1303,10 +1308,10 @@ public function sGetPaymentmean($payment)
13031308
}
13041309

13051310
/**
1306-
* @deprecated in 5.6, will be removed in 5.7 without replacement
1307-
*
13081311
* @param int|string|null $dispatch
13091312
* @param int|string|null $country
1313+
*
1314+
* @deprecated in 5.6, will be removed in 5.7 without replacement
13101315
*/
13111316
public function sGetDispatch($dispatch = null, $country = null)
13121317
{

0 commit comments

Comments
 (0)