Skip to content

Commit

Permalink
Fix after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
boherm committed Feb 7, 2024
1 parent bc09904 commit c4f68ae
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 10 deletions.
2 changes: 2 additions & 0 deletions src/Adapter/Cart/CommandHandler/BulkDeleteCartHandler.php
Expand Up @@ -30,6 +30,7 @@

use PrestaShop\PrestaShop\Adapter\Cart\Repository\CartRepository;
use PrestaShop\PrestaShop\Adapter\Order\Repository\OrderRepository;
use PrestaShop\PrestaShop\Core\CommandBus\Attributes\AsCommandHandler;
use PrestaShop\PrestaShop\Core\Domain\Cart\Command\BulkDeleteCartCommand;
use PrestaShop\PrestaShop\Core\Domain\Cart\CommandHandler\BulkDeleteCartHandlerInterface;
use PrestaShop\PrestaShop\Core\Domain\Cart\Exception\CannotDeleteOrderedCartException;
Expand All @@ -39,6 +40,7 @@
/**
* Deletes cart in bulk action using legacy object model
*/
#[AsCommandHandler]
final class BulkDeleteCartHandler implements BulkDeleteCartHandlerInterface
{
/**
Expand Down
2 changes: 2 additions & 0 deletions src/Adapter/Cart/CommandHandler/DeleteCartHandler.php
Expand Up @@ -31,6 +31,7 @@
use PrestaShop\PrestaShop\Adapter\Cart\AbstractCartHandler;
use PrestaShop\PrestaShop\Adapter\Cart\Repository\CartRepository;
use PrestaShop\PrestaShop\Adapter\Order\Repository\OrderRepository;
use PrestaShop\PrestaShop\Core\CommandBus\Attributes\AsCommandHandler;
use PrestaShop\PrestaShop\Core\Domain\Cart\Command\DeleteCartCommand;
use PrestaShop\PrestaShop\Core\Domain\Cart\CommandHandler\DeleteCartHandlerInterface;
use PrestaShop\PrestaShop\Core\Domain\Cart\Exception\CannotDeleteCartException;
Expand All @@ -41,6 +42,7 @@
/**
* Handles deletion of cart using legacy object model
*/
#[AsCommandHandler]
final class DeleteCartHandler extends AbstractCartHandler implements DeleteCartHandlerInterface
{
/**
Expand Down
11 changes: 2 additions & 9 deletions src/Core/Domain/Cart/CartStatus.php
Expand Up @@ -28,18 +28,11 @@

namespace PrestaShop\PrestaShop\Core\Domain\Cart;

/**
/*
* Cart status
*/
class CartStatus
enum CartStatus
{
/**
* Class not supposed to be initialized
*/
private function __construct()
{
}

/**
* Cart ordered
*/
Expand Down
11 changes: 11 additions & 0 deletions src/PrestaShopBundle/Resources/config/services/adapter/cart.yml
Expand Up @@ -101,7 +101,18 @@ services:
prestashop.adapter.cart.command_handler.delete_cart_handler:
class: 'PrestaShop\PrestaShop\Adapter\Cart\CommandHandler\DeleteCartHandler'
autoconfigure: true
arguments:
- '@PrestaShop\PrestaShop\Adapter\Cart\Repository\CartRepository'
- '@PrestaShop\PrestaShop\Adapter\Order\Repository\OrderRepository'

prestashop.adapter.cart.command_handler.bulk_delete_cart_handler:
class: 'PrestaShop\PrestaShop\Adapter\Cart\CommandHandler\BulkDeleteCartHandler'
autoconfigure: true
arguments:
- '@PrestaShop\PrestaShop\Adapter\Cart\Repository\CartRepository'
- '@PrestaShop\PrestaShop\Adapter\Order\Repository\OrderRepository'

PrestaShop\PrestaShop\Adapter\Cart\Repository\CartRepository:
arguments:
- '@doctrine.dbal.default_connection'
- '%database_prefix%'
Expand Up @@ -27,7 +27,7 @@
{% block content %}
{% block carts_kpis %}
{{ render(controller(
'PrestaShopBundle:Admin\\Common:renderKpiRow',
'PrestaShopBundle\\Controller\\Admin\\CommonController:renderKpiRowAction',
{ 'kpiRow': cartsKpi }
)) }}
{% endblock %}
Expand Down
Expand Up @@ -13,6 +13,7 @@ Feature: Cart deleting in BO
And there is customer "testCustomer1" with email "pub@prestashop.com"
And there is a customer named "testCustomer2" whose email is "pub2@prestashop.com"
And there is a customer named "testCustomer3" whose email is "pub3@prestashop.com"
And the module "dummy_payment" is installed

Scenario: Delete cart not already ordered
Given I create an empty cart "dummy_cart" for customer "testCustomer1"
Expand Down

0 comments on commit c4f68ae

Please sign in to comment.