Skip to content

Commit

Permalink
Merge branch 'ntr/5.7/add-customer-group-key-to-session' into '5.6'
Browse files Browse the repository at this point in the history
NTR - Add customer group key to session in product export

See merge request shopware/5/product/shopware!385
  • Loading branch information
shyim committed Aug 12, 2020
2 parents 82e2cf0 + 472ebf6 commit 0a28645
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions UPGRADE-5.6.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ This changelog references changes done in Shopware 5.6 patch versions.
* Changed cookie consent manager to work correctly when accepting all cookies
* 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`
* Changed tinymce to fix issues with `readOnly` is not resetting
* Changed sExport to set correct customer group in the shop context

## 5.6.6

Expand Down
13 changes: 9 additions & 4 deletions engine/Shopware/Core/sExport.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public function sGetCurrency($currency)
/**
* @param int|string $customerGroup
*
* @return bool
* @return bool|array
*/
public function sGetCustomergroup($customerGroup)
{
Expand Down Expand Up @@ -312,6 +312,11 @@ public function sInitSettings()
$currency = $repository->find($this->sCurrency['id']);
$shop->setCurrency($currency);
Shopware()->Container()->get('shopware.components.shop_registration_service')->registerShop($shop);

if ($this->sCustomergroup !== false) {
Shopware()->Container()->get('session')->offsetSet('sUserGroup', $this->sCustomergroup['groupkey']);
}

$this->contextService->initializeContext();

$this->shop = $shop;
Expand Down Expand Up @@ -1291,7 +1296,7 @@ public function sGetPaymentmean($payment)
$cache[$payment]['country_surcharge'] = [];
if (!empty($cache[$payment]['surchargestring'])) {
foreach (explode(';', $cache[$payment]['surchargestring']) as $countrySurcharge) {
list($key, $value) = explode(':', $countrySurcharge);
[$key, $value] = explode(':', $countrySurcharge);
$value = (float) str_replace(',', '.', $value);
if (!empty($value)) {
$cache[$payment]['country_surcharge'][$key] = $value;
Expand All @@ -1303,10 +1308,10 @@ public function sGetPaymentmean($payment)
}

/**
* @deprecated in 5.6, will be removed in 5.7 without replacement
*
* @param int|string|null $dispatch
* @param int|string|null $country
*
* @deprecated in 5.6, will be removed in 5.7 without replacement
*/
public function sGetDispatch($dispatch = null, $country = null)
{
Expand Down

0 comments on commit 0a28645

Please sign in to comment.