File tree Expand file tree Collapse file tree 2 files changed +51
-7
lines changed Expand file tree Collapse file tree 2 files changed +51
-7
lines changed Original file line number Diff line number Diff line change
1
+
2
+ @if ($shippingOption -> enable () )
3
+ <div class =" form-check" >
4
+
5
+ <input type =" radio" name =" shipping_option"
6
+
7
+ data-title =" {{ $shippingOption -> name () } }"
8
+ data-cost =" {{ number_format ($shippingOption -> amount (),2 ) } }"
9
+ id =" {{ $shippingOption -> identifier () } }"
10
+ value =" {{ $shippingOption -> identifier () } }"
11
+
12
+ @if ($errors -> has (' shipping_option' ) )
13
+ class =" is-invalid form-check-input shipping_option_radio"
14
+ @else
15
+ class =" shipping_option_radio form-check-input"
16
+ @endif
17
+
18
+ />
19
+
20
+ <label for =" {{ $shippingOption -> identifier () } }" class =" form-check-label" >
21
+ @if (null === $shippingOption -> amount () )
22
+ {{ $shippingOption -> name () } }
23
+ @else
24
+ {{ $shippingOption -> name () . " $" . number_format ($shippingOption -> amount (),2 ) } }
25
+ @endif
26
+ </label >
27
+ @if ($errors -> has (' shipping_option' ) )
28
+ <div class =" invalid-feedback" style =" display : block " >
29
+ {{ $errors -> first (' shipping_option' ) } }
30
+ </div >
31
+ @endif
32
+
33
+ </div >
34
+
35
+ @endif
36
+
1
37
@push (' scripts' )
2
38
<script >
3
39
$ (document ).ready (function () {
6
42
});
7
43
8
44
</script >
9
- @endpush
45
+ @endpush
Original file line number Diff line number Diff line change 8
8
9
9
class FixedRate extends AbstractShipping implements ShippingContract
10
10
{
11
-
12
11
const CONFIX_FIXED_RATE_COST = 'shipping_fixed_rate_cost ' ;
13
-
14
-
12
+
15
13
const CONFIG_KEY = 'shipping_fixed_rate_shipping_enabled ' ;
16
14
17
15
/**
@@ -72,7 +70,6 @@ public function name()
72
70
*/
73
71
public function enable ()
74
72
{
75
-
76
73
$ this ->enable = Configuration::getConfiguration (self ::CONFIG_KEY );
77
74
78
75
return $ this ->enable ;
@@ -89,7 +86,6 @@ public function amount()
89
86
return $ this ->amount ;
90
87
}
91
88
92
-
93
89
/**
94
90
* Payment Option View Path.
95
91
*
@@ -110,7 +106,6 @@ public function with()
110
106
return [];
111
107
}
112
108
113
-
114
109
/**
115
110
* Processing Amount for this Shipping Option.
116
111
*
@@ -124,4 +119,17 @@ public function process($cartProducts)
124
119
125
120
return $ this ;
126
121
}
122
+
123
+ /**
124
+ * Processing Amount for this Shipping Option.
125
+ *
126
+ * @param $orderFormData
127
+ * @return self
128
+ */
129
+ public function calculate ($ orderFormData )
130
+ {
131
+ $ view = view ($ this ->view )->with ('shippingOption ' , $ this );
132
+
133
+ return $ view ->render ();
134
+ }
127
135
}
You can’t perform that action at this time.
0 commit comments