|
3 | 3 | /** |
4 | 4 | * Plugin Name: HelloAsso Payments for WooCommerce |
5 | 5 | * Description: Recevez 100% de vos paiements gratuitement. HelloAsso est la seule solution de paiement gratuite du secteur associatif. Nous sommes financés librement par la solidarité de celles et ceux qui choisissent de laisser une contribution volontaire au moment du paiement à une association. |
6 | | - * Version: 1.0.9 |
| 6 | + * Version: 1.0.10 |
7 | 7 | * Requires at least: 5.0 |
8 | 8 | * WC requires at least: 7.7 |
9 | 9 | * Requires PHP: 7.2.34 |
@@ -142,6 +142,48 @@ public function __construct() |
142 | 142 | add_action('woocommerce_update_options_payment_gateways_' . $this->id, array($this, 'process_admin_options')); |
143 | 143 | } |
144 | 144 |
|
| 145 | + public function payment_fields() |
| 146 | + { |
| 147 | + if ($this->description) { |
| 148 | + echo '<div style="display: flex; align-items: center;">'; |
| 149 | + echo '<img style="max-width: 50px; height:auto; margin-right: 16px;" src="/wp-content/plugins/helloasso-payments-for-woocommerce/assets/logo-ha.png" alt="HelloAsso Logo" />'; |
| 150 | + echo '<p>' . wp_kses_post($this->description) . '</p>'; |
| 151 | + echo '</div>'; |
| 152 | + } |
| 153 | + |
| 154 | + $multi_3_enabled = $this->get_option('multi_3_enabled') === 'yes'; |
| 155 | + $multi_12_enabled = $this->get_option('multi_12_enabled') === 'yes'; |
| 156 | + |
| 157 | + $current_day = (int) current_time('j'); |
| 158 | + $can_show_multi_payment = $current_day <= 28; |
| 159 | + |
| 160 | + if (($multi_3_enabled || $multi_12_enabled) && $can_show_multi_payment) { |
| 161 | + echo '<div id="helloasso-payment-options">'; |
| 162 | + echo '<p><strong>Choisissez votre mode de paiement:</strong></p>'; |
| 163 | + |
| 164 | + echo '<label style="display: block; margin-bottom: 8px;">'; |
| 165 | + echo '<input type="radio" name="helloasso_payment_type" value="one_time" checked="checked" style="margin-right: 5px;" />'; |
| 166 | + echo 'Paiement comptant'; |
| 167 | + echo '</label>'; |
| 168 | + |
| 169 | + if ($multi_3_enabled) { |
| 170 | + echo '<label style="display: block; margin-bottom: 8px;">'; |
| 171 | + echo '<input type="radio" name="helloasso_payment_type" value="three_times" style="margin-right: 5px;" />'; |
| 172 | + echo 'Paiement en 3 fois sans frais'; |
| 173 | + echo '</label>'; |
| 174 | + } |
| 175 | + |
| 176 | + if ($multi_12_enabled) { |
| 177 | + echo '<label style="display: block; margin-bottom: 8px;">'; |
| 178 | + echo '<input type="radio" name="helloasso_payment_type" value="twelve_times" style="margin-right: 5px;" />'; |
| 179 | + echo 'Paiement en 12 fois sans frais'; |
| 180 | + echo '</label>'; |
| 181 | + } |
| 182 | + |
| 183 | + echo '</div>'; |
| 184 | + } |
| 185 | + } |
| 186 | + |
145 | 187 | public function admin_options() |
146 | 188 | { |
147 | 189 | // Check if we have helloasso_access_token_asso in the options |
|
0 commit comments