This repository was archived by the owner on Sep 28, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +49
-3
lines changed Expand file tree Collapse file tree 2 files changed +49
-3
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 () {
Original file line number Diff line number Diff line change 9
9
10
10
class FreeShipping extends AbstractShipping implements ShippingContract
11
11
{
12
-
13
12
const CONFIG_KEY = 'shipping_free_shipping_enabled ' ;
14
13
15
14
/**
@@ -90,7 +89,6 @@ public function amount()
90
89
return $ this ->amount ;
91
90
}
92
91
93
-
94
92
/**
95
93
* Payment Option View Path.
96
94
*
@@ -111,7 +109,6 @@ public function with()
111
109
return [];
112
110
}
113
111
114
-
115
112
/**
116
113
* Processing Amount for this Shipping Option.
117
114
*
@@ -125,4 +122,17 @@ public function process($cartProducts)
125
122
126
123
return $ this ;
127
124
}
125
+
126
+ /**
127
+ * Calculate the cost of Shipping based on Checkout Form Data.
128
+ *
129
+ * @param \Illuminate\Support\Collection $cartProducts
130
+ * @return self
131
+ */
132
+ public function calculate ($ checkoutFormData )
133
+ {
134
+ $ view = view ($ this ->view )->with ('shippingOption ' , $ this );
135
+
136
+ return $ view ->render ();
137
+ }
128
138
}
You can’t perform that action at this time.
0 commit comments