Skip to content

Commit

Permalink
NTR: revert cart service
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitalij Mik committed Mar 14, 2024
1 parent 03be2b3 commit 08482a4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Resources/config/services/services.xml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
<service id="Kiener\MolliePayments\Service\CartService" class="Kiener\MolliePayments\Service\CartService" public="true">
<argument type="service" id="Shopware\Core\Checkout\Cart\SalesChannel\CartService"/>
<argument type="service" id="Shopware\Core\System\SalesChannel\SalesChannel\SalesChannelContextSwitcher"/>
<argument type="service" id="Shopware\Core\Checkout\Cart\LineItemFactoryHandler\ProductLineItemFactory"/>
<argument type="service" id="Shopware\Core\Content\Product\Cart\ProductLineItemFactory"/>
<argument type="service" id="Kiener\MolliePayments\Compatibility\Gateway\CompatibilityGateway"/>
</service>

Expand Down
4 changes: 2 additions & 2 deletions src/Service/CartService.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Kiener\MolliePayments\Compatibility\Gateway\CompatibilityGateway;
use Kiener\MolliePayments\Compatibility\Gateway\CompatibilityGatewayInterface;
use Shopware\Core\Checkout\Cart\Cart;
use Shopware\Core\Checkout\Cart\LineItemFactoryHandler\ProductLineItemFactory;
use Shopware\Core\Content\Product\Cart\ProductLineItemFactory;
use Shopware\Core\Checkout\Cart\SalesChannel\CartService as SalesChannelCartService;
use Shopware\Core\Framework\Validation\DataBag\DataBag;
use Shopware\Core\System\SalesChannel\Context\SalesChannelContextService;
Expand Down Expand Up @@ -60,7 +60,7 @@ public function addProduct(string $productId, int $quantity, SalesChannelContext
{
$cart = $this->getCalculatedMainCart($context);

$productItem = $this->productItemFactory->create(['id'=>$productId, 'quantity' => $quantity],$context);
$productItem = $this->productItemFactory->create($productId,[ 'quantity' => $quantity]);

return $this->swCartService->add($cart, $productItem, $context);
}
Expand Down

0 comments on commit 08482a4

Please sign in to comment.