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