PluginProbe ʕ •ᴥ•ʔ
Weight Based Shipping Table Rate for WooCommerce – Flexible Shipping / 6.10.0
Weight Based Shipping Table Rate for WooCommerce – Flexible Shipping v6.10.0
6.11.0 6.10.0 6.9.1 6.9.0 6.8.1 6.8.0 6.7.4 6.7.3 6.7.2 6.7.0 4.21.7 4.22.0 4.22.1 4.23.0 4.23.1 4.23.2 4.23.3 4.24.0 4.24.1 4.24.10 4.24.11 4.24.12 4.24.13 4.24.14 4.24.15 4.24.16 4.24.17 4.24.18 4.24.19 4.24.2 4.24.4 4.24.6 4.24.7 4.24.8 4.24.9 4.25.0 4.25.1 4.25.2 4.25.4 4.25.5 4.25.6 4.25.7 4.25.8 4.3.0 4.3.1 4.4.0 4.4.1 4.5.0 4.5.1 4.6.0 4.6.1 4.7.0 4.7.1 4.7.2 4.8.0 4.8.1 4.8.3 4.8.4 4.8.5 4.9.0 5.0.0 5.0.1 5.0.2 5.0.3 5.0.4 5.0.5 5.0.6 5.0.7 5.0.8 5.0.9 5.1.0 5.1.1 5.1.2 5.1.3 5.2.0 5.3.0 5.3.1 5.3.3 5.3.4 5.3.5 6.0.0 6.1.0 6.1.1 6.1.2 6.2.0 6.2.1 6.2.2 6.2.3 6.2.4 6.3.0 trunk 6.4.0 1.4 6.4.1 1.4.1 6.4.2 1.5 6.4.3 1.6 6.4.5 1.6.1 6.5.0 1.6.2 6.5.1 1.7 6.5.2 1.8 6.5.3 1.9 6.5.4 1.9.1 6.5.5 1.9.10 6.5.6 1.9.11 6.5.7 1.9.12 6.5.8 1.9.2 6.6.0 1.9.3 6.6.1 1.9.4 6.6.2 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.0 2.0.1 2.1 2.1.1 2.1.10 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 3.0.6 3.0.7 3.1 3.1.1 3.1.10 3.1.11 3.1.12 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.10.0 3.11.0 3.11.1 3.11.2 3.11.3 3.11.4 3.12.0 3.13.0 3.14.0 3.14.1 3.14.2 3.14.3 3.14.4 3.15.0 3.16.0 3.16.1 3.16.2 3.16.3 3.16.4 3.16.5 3.2.0 3.3.1 3.3.10 3.3.11 3.3.12 3.3.13 3.3.14 3.3.2 3.3.3 3.3.4 3.3.5 3.3.6 3.3.7 3.3.8 3.3.9 3.4.0 3.5.0 3.5.1 3.6.0 3.6.1 3.6.2 3.6.3 3.6.4 3.7.0 3.8.0 3.9.0 3.9.1 3.9.10 3.9.11 3.9.12 3.9.13 3.9.15 3.9.16 3.9.17 3.9.18 3.9.19 3.9.2 3.9.20 3.9.21 3.9.3 3.9.4 3.9.5 3.9.6 3.9.7 3.9.9 4.0.0 4.0.1 4.0.10 4.0.2 4.0.3 4.0.4 4.0.5 4.0.6 4.0.7 4.0.8 4.0.9 4.1.0 4.1.1 4.1.2 4.1.3 4.1.4 4.10.0 4.10.1 4.11.0 4.11.1 4.11.2 4.11.3 4.11.4 4.11.5 4.11.6 4.11.7 4.11.8 4.11.9 4.12.0 4.13.0 4.13.1 4.13.2 4.13.3 4.14.0 4.14.1 4.14.2 4.15.0 4.16.0 4.16.1 4.16.2 4.17.0 4.18.0 4.18.1 4.18.2 4.18.3 4.18.4 4.18.5 4.18.6 4.19.0 4.19.1 4.2.0 4.20.0 4.20.1 4.20.2 4.20.3 4.21.0 4.21.1 4.21.2 4.21.3 4.21.4 4.21.5
flexible-shipping / src / WPDesk / FS / Onboarding / TableRate / PopupData.php
flexible-shipping / src / WPDesk / FS / Onboarding / TableRate Last commit date
views 2 weeks ago FinishOption.php 2 weeks ago Onboarding.php 2 weeks ago OptionAjaxUpdater.php 2 weeks ago PopupData.php 2 weeks ago Tracker.php 2 weeks ago
PopupData.php
224 lines
1 <?php
2 /**
3 * Popup Data.
4 *
5 * @package WPDesk\FS\Onboarding
6 */
7
8 namespace WPDesk\FS\Onboarding\TableRate;
9
10 /**
11 * Class PopupData
12 *
13 * @package WPDesk\FS\Onboarding
14 */
15 class PopupData {
16 /**
17 * @return array[]
18 */
19 public function get_popups(): array {
20 return [
21 $this->get_popup_data_step_1(),
22 $this->get_popup_data_step_2(),
23 $this->get_popup_data_step_3(),
24 $this->get_popup_data_step_4(),
25 ];
26 }
27
28 /**
29 * @return array
30 */
31 private function get_popup_data_step_1(): array {
32 return [
33 'id' => 'step_1',
34 'logo' => false,
35 'title' => null,
36 'step' => 1,
37 'show' => false,
38 'image' => 'steps/' . $this->get_locale() . '/step-1.gif',
39 'heading' => __( 'Choose what the rule should be based on', 'flexible-shipping' ),
40 'text' => [
41 sprintf(
42 // Translators: open and close strong tag.
43 __( '%1$sIn the \'When\' column select the condition which the rule you are about to add will be based on and calculated.%2$s', 'flexible-shipping' ),
44 '<strong>',
45 '</strong>'
46 ),
47 sprintf(
48 // Translators: open and close strong tag.
49 __( '%1$sExample 1:%2$s If the shipping cost should be calculated based on the weight of the products added to the cart — select %3$sWeight%4$s, if&nbsp;based on price — similarly select %5$sPrice%6$s.', 'flexible-shipping' ),
50 '<strong class="highlight">',
51 '</strong>',
52 '<strong>',
53 '</strong>',
54 '<strong>',
55 '</strong>'
56 ),
57 sprintf(
58 // Translators: open and close strong tag.
59 __( '%1$sExample 2:%2$s If the shipping cost should be fixed for good — select %3$sAlways%4$s.', 'flexible-shipping' ),
60 '<strong class="highlight">',
61 '</strong>',
62 '<strong>',
63 '</strong>'
64 ),
65 ],
66 'buttons' => [
67 [
68 'label' => __( 'Next step', 'flexible-shipping' ),
69 'popup' => 'step_2',
70 'classes' => 'btn-success',
71 ],
72 ],
73 ];
74 }
75
76 /**
77 * @return array
78 */
79 private function get_popup_data_step_2(): array {
80 return [
81 'id' => 'step_2',
82 'logo' => false,
83 'title' => null,
84 'step' => 2,
85 'show' => false,
86 'image' => 'steps/' . $this->get_locale() . '/step-2.gif',
87 'heading' => __( 'Define the rule’s range', 'flexible-shipping' ),
88 'text' => [
89 __( 'Enter the minimum and maximum value for the selected condition to define the range when the rule will be applied.', 'flexible-shipping' ),
90 sprintf(
91 // Translators: open and close strong tag.
92 __( '%1$sExample 1:%2$s If you want a particular shipping cost to be charged when the order’s total weight is between 1 kg and 5 kg - select %3$sWhen:%4$s Weight %5$sis from:%6$s 1 kg %7$sto:%8$s 5 kg.', 'flexible-shipping' ),
93 '<strong class="highlight">',
94 '</strong>',
95 '<strong>',
96 '</strong>',
97 '<strong>',
98 '</strong>',
99 '<strong>',
100 '</strong>'
101 ),
102 sprintf(
103 // Translators: open and close strong tag.
104 __( '%1$sExample 2:%2$s If you want a particular shipping cost to be charged only when the order’s price exceeds $100, select %3$sWhen:%4$s Price %5$sis from:%6$s $100.', 'flexible-shipping' ),
105 '<strong class="highlight">',
106 '</strong>',
107 '<strong>',
108 '</strong>',
109 '<strong>',
110 '</strong>'
111 ),
112 ],
113 'buttons' => [
114 [
115 'label' => __( 'Previous step', 'flexible-shipping' ),
116 'popup' => 'step_1',
117 'classes' => 'btn-link',
118 ],
119 [
120 'label' => __( 'Next step', 'flexible-shipping' ),
121 'popup' => 'step_3',
122 'classes' => 'btn-success',
123 ],
124 ],
125 ];
126 }
127
128 /**
129 * @return array
130 */
131 private function get_popup_data_step_3(): array {
132 return [
133 'id' => 'step_3',
134 'logo' => false,
135 'title' => null,
136 'step' => 3,
137 'show' => false,
138 'image' => 'steps/' . $this->get_locale() . '/step-3.gif',
139 'heading' => __( 'Determine the shipping cost', 'flexible-shipping' ),
140 'text' => [
141 __( 'Enter the shipping cost, which will be added to the order’s price when the condition you’ve set in the previous step is met.', 'flexible-shipping' ),
142 sprintf(
143 // Translators: open and close strong tag.
144 __( '%1$sExample 1:%2$s If the cost of the shipping method you are currently configuring should be $12, enter %3$sCost is:%4$s 12.', 'flexible-shipping' ),
145 '<strong class="highlight">',
146 '</strong>',
147 '<strong>',
148 '</strong>'
149 ),
150 ],
151 'buttons' => [
152 [
153 'label' => __( 'Previous step', 'flexible-shipping' ),
154 'popup' => 'step_2',
155 'classes' => 'btn-link',
156 ],
157 [
158 'label' => __( 'Next step', 'flexible-shipping' ),
159 'popup' => 'step_4',
160 'classes' => 'btn-success',
161 ],
162 ],
163 ];
164 }
165
166 /**
167 * @return array
168 */
169 private function get_popup_data_step_4(): array {
170 return [
171 'id' => 'step_4',
172 'logo' => false,
173 'title' => null,
174 'step' => 4,
175 'show' => false,
176 'image' => 'steps/' . $this->get_locale() . '/step-4.gif',
177 'heading' => __( 'Add more and combine the rules!', 'flexible-shipping' ),
178 'text' => [
179 sprintf(
180 // Translators: open and close strong tag.
181 __( 'Configure even the most advanced shipping scenarios by adding and combining the shipping cost calculation rules. Precisely define how the shipping cost should be calculated or import and adapt one of our %1$sready-to-use scenarios%2$s to your needs. Read the %3$sFlexible Shipping plugin documentation%4$s and discover its endless possibilities!', 'flexible-shipping' ),
182 sprintf(
183 '<a href="%s" target="_blank">',
184 // Translators: open and close strong tag.
185 esc_url( __( 'https://octol.io/onboarding-sc', 'flexible-shipping' ) )
186 ),
187 '</a>',
188 sprintf(
189 '<a href="%s" target="_blank">',
190 // Translators: open and close strong tag.
191 esc_url( __( 'https://octol.io/onboarding-docs', 'flexible-shipping' ) )
192 ),
193 '</a>'
194 ),
195 ],
196 'buttons' => [
197 [
198 'label' => __( 'Previous step', 'flexible-shipping' ),
199 'popup' => 'step_3',
200 'classes' => 'btn-link',
201 ],
202 [
203 'label' => __( 'Proceed to adding the rules', 'flexible-shipping' ),
204 'action' => 'finish',
205 'classes' => 'btn-success',
206 ],
207 ],
208 ];
209 }
210
211 /**
212 * @return string
213 */
214 private function get_locale(): string {
215 $locale = get_user_locale();
216
217 if ( 'pl_PL' === $locale ) {
218 return $locale;
219 }
220
221 return 'en_US';
222 }
223 }
224