Skip to content

Commit 0bdc27f

Browse files
committed
ACP2E-3973: [Cloud] Free Shipping discount not correctly removed when cart no longer meets requirements
- Fix Static Tests - Add docs to Rule fixture
1 parent eb6dafa commit 0bdc27f

File tree

1 file changed

+67
-2
lines changed
  • app/code/Magento/SalesRule/Test/Fixture

1 file changed

+67
-2
lines changed

app/code/Magento/SalesRule/Test/Fixture/Rule.php

Lines changed: 67 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2022 Adobe
4+
* All Rights Reserved.
55
*/
66
declare(strict_types=1);
77

@@ -16,6 +16,71 @@
1616
use Magento\TestFramework\Fixture\Data\ProcessorInterface;
1717
use Magento\TestFramework\Fixture\RevertibleDataFixtureInterface;
1818

19+
/**
20+
* Cart price rule fixture
21+
*
22+
* Example 1: Using array list: (base_subtotal > 1000) AND (sku in (simple1,simple3))
23+
*
24+
* ```php
25+
* #[
26+
* DataFixture(
27+
* RuleFixture::class,
28+
* [
29+
* 'discount_amount' => 25,
30+
* 'conditions' => [
31+
* [
32+
* 'attribute' => 'base_subtotal',
33+
* 'operator' => '>',
34+
* 'value' => 1000
35+
* ],
36+
* ],
37+
* 'actions' => [
38+
* [
39+
* 'attribute' => 'sku',
40+
* 'operator' => '()',
41+
* 'value' => 'simple1,simple3'
42+
* ]
43+
* ]
44+
* ],
45+
* 'rule'
46+
* )
47+
* ]
48+
* ```
49+
*
50+
* Example 2: Using associative conditions: (category_ids in (1, 2) AND attribute_set_id=default) OR (sku=simple3)
51+
*
52+
* ```php
53+
* #[
54+
* DataFixture(
55+
* RuleFixture::class,
56+
* [
57+
* 'discount_amount' => 25,
58+
* 'actions' => [
59+
* 'aggregator' => 'any',
60+
* 'conditions' => [
61+
* [
62+
* [
63+
* 'attribute' => 'category_ids',
64+
* 'operator' => '()',
65+
* 'value' => '1,2',
66+
* ],
67+
* [
68+
* 'attribute' => 'attribute_set_id',
69+
* 'value' => 'default',
70+
* ],
71+
* ],
72+
* [
73+
* 'attribute' => 'sku',
74+
* 'value' => 'simple3'
75+
* ]
76+
* ],
77+
* ],
78+
* ],
79+
* 'rule'
80+
* )
81+
* ]
82+
* ```
83+
*/
1984
class Rule implements RevertibleDataFixtureInterface
2085
{
2186
private const DEFAULT_DATA = [

0 commit comments

Comments
 (0)