Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ECP-9376] Fix checkout for configurable products when product is in low stock #62

Merged
merged 7 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions Model/CompositeConfigProvider.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

declare(strict_types=1);

namespace Adyen\Hyva\Model;

use Magento\Checkout\Model\ConfigProviderInterface;
class CompositeConfigProvider implements ConfigProviderInterface
{
private $configProviders;

public function __construct(
array $configProviders
) {
$this->configProviders = $configProviders;
}

public function getConfig()
{
$config = [];
foreach ($this->configProviders as $configProvider) {
$config = array_merge_recursive($config, $configProvider->getConfig());
}
return $config;
}
}
5 changes: 2 additions & 3 deletions Model/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
namespace Adyen\Hyva\Model;

use Exception;
use Magento\Checkout\Model\CompositeConfigProvider;
use Magento\Framework\DataObject;
use Magento\Framework\DataObjectFactory;
use Psr\Log\LoggerInterface;
Expand All @@ -16,8 +15,8 @@ class Configuration

public function __construct(
CompositeConfigProvider $configProvider,
DataObjectFactory $dataObjectFactory,
LoggerInterface $logger
DataObjectFactory $dataObjectFactory,
LoggerInterface $logger
) {
try {
if (isset($configProvider->getConfig()['payment'])) {
Expand Down
17 changes: 17 additions & 0 deletions etc/di.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,21 @@
</argument>
</arguments>
</type>

<type name="Adyen\Hyva\Model\CompositeConfigProvider">
<arguments>
<argument name="configProviders" xsi:type="array">
<item name="ccform" xsi:type="object">Magento\Payment\Model\CcGenericConfigProvider</item>
<item name="cc_card_config_provider" xsi:type="object">Magento\Payment\Model\CcConfigProvider</item>
<item name="tax_config_provider" xsi:type="object">Magento\Tax\Model\TaxConfigProvider</item>
<item name="vault_config_provider" xsi:type="object">Magento\Vault\Model\Ui\VaultConfigProvider</item>
<item name="vault_cards_config_provider" xsi:type="object">Magento\Vault\Model\Ui\TokensConfigProvider</item>
<item name="adyen_generic_config_provider" xsi:type="object">Adyen\Payment\Model\Ui\AdyenGenericConfigProvider</item>
<item name="adyen_cc_config_provider" xsi:type="object">Adyen\Payment\Model\Ui\AdyenCcConfigProvider</item>
<item name="adyen_pm_config_provider" xsi:type="object">Adyen\Payment\Model\Ui\AdyenPmConfigProvider</item>
<item name="adyen_pos_cloud_config_provider" xsi:type="object">Adyen\Payment\Model\Ui\AdyenPosCloudConfigProvider</item>
<item name="adyen_giftcard_config_provider" xsi:type="object">Adyen\Payment\Model\Ui\AdyenGiftcardConfigProvider</item>
</argument>
</arguments>
</type>
</config>
Loading