Skip to content

Commit

Permalink
NTR: Fixed customproduct values prices (#924)
Browse files Browse the repository at this point in the history
* NTR: Fixed customproduct values prices

* NTR: fix integration tests

* NTR: update changelog

* NTR: reformat changelog

---------

Co-authored-by: Vitalij Mik <[email protected]>
  • Loading branch information
BlackScorp and Vitalij Mik authored Jan 17, 2025
1 parent dcd5360 commit 24d6636
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 17 deletions.
19 changes: 12 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,16 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

### Added

### Features
- Return over Shopware Commercial plugins is now transfered to Mollie when the Return status is set to "Done" and can be cancelled with the "Cancelled" status. Please note that the refund cannot be cancelled after two hours.
### Changes
- Minimum Supported Shopware version is now 6.4.5.0
- Add new monolog channel "mollie". You can now add custom handler and assign them to the mollie channel
### Fixes
- fixed order details in refund manager in shopware 6.4.x
- Returns for Shopware Commercial plugins are now transferred to Mollie when the return status is set to "Done" and can be canceled with the "Cancelled" status. Please note that refunds cannot be canceled after two hours.

### Changed

- The minimum supported Shopware version is now 6.4.5.0.
- Added a new Monolog channel "mollie." You can now add custom handlers and assign them to the Mollie channel.

### Fixed

- Fixed order details in the refund manager for Shopware 6.4.x.
- Resolved an issue with SwagCustomizedProducts where prices for option values are now correctly added to the order.
16 changes: 12 additions & 4 deletions src/Service/MollieApi/Builder/MollieLineItemBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,18 @@ public function buildLineItems(string $taxStatus, ?OrderLineItemCollection $line
if ($productChildren === null) {
continue;
}
$productChildren = $productChildren->filterByType(self::LINE_ITEM_TYPE_CUSTOM_PRODUCTS_OPTIONS);
foreach ($productChildren as $productChild) {
if ($productChild->getPrice() !== null && $productChild->getPrice()->getTotalPrice() > 0) {
$lineItems->add($productChild);
$options = $productChildren->filterByType(self::LINE_ITEM_TYPE_CUSTOM_PRODUCTS_OPTIONS);
foreach ($options as $option) {
$optionValues = $option->getChildren();
if ($optionValues !== null) {
foreach ($optionValues as $optionValue) {
if ($optionValue->getPrice() !== null && $optionValue->getPrice()->getTotalPrice() > 0) {
$lineItems->add($optionValue);
}
}
}
if ($option->getPrice() !== null && $option->getPrice()->getTotalPrice() > 0) {
$lineItems->add($option);
}
}
}
Expand Down
8 changes: 2 additions & 6 deletions tests/Integration/Settings/LoggerSettingsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function testSettingsCanBeReadFromDatabase(): void
$systemConfigService->set(SettingsService::SYSTEM_CONFIG_DOMAIN . '.' . LoggerSettings::KEY_LOG_FILE_DAYS, 10);
$systemConfigService->set(SettingsService::SYSTEM_CONFIG_DOMAIN . '.' . LoggerSettings::KEY_DEBUG_MODE, false);

$settingsService = new SettingsService($systemConfigService);
$settingsService = new SettingsService($this->getContainer());

$actualSettings = $settingsService->getLoggerSettings();

Expand All @@ -37,11 +37,7 @@ public function testSettingsCanBeReadFromDatabase(): void
public function testSettingsAreCachedPerSalesChannel():void
{

/**
* @var SystemConfigService $systemConfigService
*/
$systemConfigService = $this->getContainer()->get(SystemConfigService::class);
$settingsService = new SettingsService($systemConfigService);
$settingsService = new SettingsService($this->getContainer());

$expectedSettings = $settingsService->getLoggerSettings();
$actualSettings = $settingsService->getLoggerSettings();
Expand Down

0 comments on commit 24d6636

Please sign in to comment.