mirror of
https://github.com/Sylius/Sylius.git
synced 2026-07-14 17:10:53 +00:00
[Admin][Payment] Not displaying payments in cart state on the list
This commit is contained in:
parent
2f04aad6f5
commit
9deddd763c
5 changed files with 15 additions and 6 deletions
|
|
@ -18,6 +18,12 @@ Feature: Browsing payments
|
|||
Then I should see a single payment in the list
|
||||
And the payments of the "#00000001" order should be "New" for "amba@fatima.org"
|
||||
|
||||
@ui
|
||||
Scenario: Not seeing payments in cart state
|
||||
Given the customer added "Apple" product to the cart
|
||||
When I browse payments
|
||||
Then I should see a single payment in the list
|
||||
|
||||
@ui
|
||||
Scenario: Payments are sorted by newest as default
|
||||
Given there is an "#00000002" order with "Apple" product ordered later
|
||||
|
|
|
|||
|
|
@ -229,9 +229,10 @@ final class CartContext implements Context
|
|||
* @Given /^I (?:add|added) (this product) to the cart$/
|
||||
* @Given I added product :product to the cart
|
||||
* @Given /^I (?:have|had) (product "[^"]+") in the cart$/
|
||||
* @Given the customer added :product product to the cart
|
||||
* @When I add product :product to the cart
|
||||
*/
|
||||
public function iAddProductToTheCart(ProductInterface $product)
|
||||
public function iAddProductToTheCart(ProductInterface $product): void
|
||||
{
|
||||
$this->productShowPage->open(['slug' => $product->getSlug()]);
|
||||
$this->productShowPage->addToCart();
|
||||
|
|
|
|||
|
|
@ -26,6 +26,6 @@ default:
|
|||
- sylius.behat.context.ui.channel
|
||||
|
||||
- sylius.behat.context.ui.admin.managing_payments
|
||||
|
||||
- sylius.behat.context.ui.shop.cart
|
||||
filters:
|
||||
tags: "@managing_payments && @ui"
|
||||
|
|
|
|||
|
|
@ -5,6 +5,8 @@ sylius_grid:
|
|||
name: doctrine/orm
|
||||
options:
|
||||
class: "%sylius.model.payment.class%"
|
||||
repository:
|
||||
method: createListQueryBuilder
|
||||
sorting:
|
||||
createdAt: desc
|
||||
fields:
|
||||
|
|
|
|||
|
|
@ -20,12 +20,12 @@ use Sylius\Component\Core\Repository\PaymentRepositoryInterface;
|
|||
|
||||
class PaymentRepository extends EntityRepository implements PaymentRepositoryInterface
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function createListQueryBuilder(): QueryBuilder
|
||||
{
|
||||
return $this->createQueryBuilder('o');
|
||||
return $this->createQueryBuilder('o')
|
||||
->andWhere('o.state != :state')
|
||||
->setParameter('state', PaymentInterface::STATE_CART)
|
||||
;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue