@@ -24,6 +24,7 @@ fn cart_lines_discounts_generate_run(
24
24
let has_order_discount_class = input
25
25
. discount
26
26
. discount_classes
27
+ <<<<<<< HEAD
27
28
. contains( & input:: DiscountClass :: ORDER ) ;
28
29
let has_product_discount_class = input
29
30
. discount
@@ -32,23 +33,46 @@ fn cart_lines_discounts_generate_run(
32
33
33
34
if !has_order_discount_class && !has_product_discount_class {
34
35
return Ok ( output:: CartLinesDiscountsGenerateRunResult { operations : vec ! [ ] } ) ;
36
+ =======
37
+ . contains ( & DiscountClass :: ORDER ) ;
38
+ let has_product_discount_class = input
39
+ . discount
40
+ . discount_classes
41
+ . contains ( & DiscountClass :: PRODUCT ) ;
42
+
43
+ if !has_order_discount_class && !has_product_discount_class {
44
+ return Ok ( CartLinesDiscountsGenerateRunResult { operations : vec ! [ ] } ) ;
45
+ >>>>>>> c85625f ( Update file names)
35
46
}
36
47
37
48
let mut operations = vec ! [ ] ;
38
49
39
50
// Check if the discount has the ORDER class
40
51
if has_order_discount_class {
52
+ <<<<<<< HEAD
41
53
operations. push( output:: CartOperation :: OrderDiscountsAdd (
42
54
output:: OrderDiscountsAddOperation {
43
55
selection_strategy : output:: OrderDiscountSelectionStrategy :: FIRST ,
44
56
candidates: vec![ output:: OrderDiscountCandidate {
45
57
targets: vec![ output:: OrderDiscountCandidateTarget :: OrderSubtotal (
46
58
output:: OrderSubtotalTarget {
59
+ =======
60
+ operations. push( CartOperation :: OrderDiscountsAdd (
61
+ OrderDiscountsAddOperation {
62
+ selection_strategy: OrderDiscountSelectionStrategy :: FIRST ,
63
+ candidates: vec![ OrderDiscountCandidate {
64
+ targets: vec![ OrderDiscountCandidateTarget :: OrderSubtotal (
65
+ OrderSubtotalTarget {
66
+ >>>>>>> c85625f ( Update file names)
47
67
excluded_cart_line_ids: vec![ ] ,
48
68
} ,
49
69
) ] ,
50
70
message: Some ( "10% OFF ORDER" . to_string( ) ) ,
71
+ <<<<<<< HEAD
51
72
value: output:: OrderDiscountCandidateValue :: Percentage ( output:: Percentage {
73
+ =======
74
+ value: OrderDiscountCandidateValue :: Percentage ( Percentage {
75
+ >>>>>>> c85625f ( Update file names)
52
76
value: Decimal ( 10.0 ) ,
53
77
} ) ,
54
78
conditions: None ,
@@ -60,6 +84,7 @@ fn cart_lines_discounts_generate_run(
60
84
61
85
// Check if the discount has the PRODUCT class
62
86
if has_product_discount_class {
87
+ <<<<<<< HEAD
63
88
operations. push( output:: CartOperation :: ProductDiscountsAdd (
64
89
output:: ProductDiscountsAddOperation {
65
90
selection_strategy: output:: ProductDiscountSelectionStrategy :: FIRST ,
@@ -72,6 +97,18 @@ fn cart_lines_discounts_generate_run(
72
97
) ] ,
73
98
message: Some ( "20% OFF PRODUCT" . to_string( ) ) ,
74
99
value: output:: ProductDiscountCandidateValue :: Percentage ( output:: Percentage {
100
+ =======
101
+ operations. push( CartOperation :: ProductDiscountsAdd (
102
+ ProductDiscountsAddOperation {
103
+ selection_strategy: ProductDiscountSelectionStrategy :: FIRST ,
104
+ candidates: vec![ ProductDiscountCandidate {
105
+ targets: vec![ ProductDiscountCandidateTarget :: CartLine ( CartLineTarget {
106
+ id: max_cart_line. id. clone( ) ,
107
+ quantity: None ,
108
+ } ) ] ,
109
+ message: Some ( "20% OFF PRODUCT" . to_string( ) ) ,
110
+ value: ProductDiscountCandidateValue :: Percentage ( Percentage {
111
+ >>>>>>> c85625f ( Update file names)
75
112
value: Decimal ( 20.0 ) ,
76
113
} ) ,
77
114
associated_discount_code: None ,
@@ -80,5 +117,9 @@ fn cart_lines_discounts_generate_run(
80
117
) ) ;
81
118
}
82
119
120
+ <<<<<<< HEAD
83
121
Ok ( output:: CartLinesDiscountsGenerateRunResult { operations } )
122
+ =======
123
+ Ok ( CartLinesDiscountsGenerateRunResult { operations } )
124
+ >>>>>>> c85625f ( Update file names)
84
125
}
0 commit comments