optin-checkbox.php
31 lines
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * Override this template by copying it to yourtheme/hostinger-reach/optin-checkbox.php |
| 5 | */ |
| 6 | |
| 7 | namespace Hostinger\Reach; |
| 8 | |
| 9 | use Hostinger\Reach\Integrations\WooCommerce\WooCommerceIntegration; |
| 10 | |
| 11 | if ( ! defined( 'ABSPATH' ) ) { |
| 12 | exit; |
| 13 | } |
| 14 | |
| 15 | /** |
| 16 | * @var $is_opted_in bool Indicates if the user is opted in. |
| 17 | */ |
| 18 | |
| 19 | if ( ! isset( $is_opted_in ) ) { |
| 20 | $is_opted_in = false; |
| 21 | } |
| 22 | |
| 23 | ?> |
| 24 | |
| 25 | <p class="hostinger-reach-optin form-row"> |
| 26 | <label for="woocommerce-form__label woocommerce-form__label-for-checkbox checkbox"> |
| 27 | <input class="woocommerce-form__input woocommerce-form__input-checkbox input-checkbox" type="checkbox" name="hostinger_reach_optin" id="hostinger_reach_optin" <?php checked( isset( $_POST[ WooCommerceIntegration::OPTIN_KEY ] ) || $is_opted_in, true ); ?> /> |
| 28 | <span class="hostinger-reach-optin__checkbox-text"><?php _e( 'Subscribe to our Newsletter', 'hostinger-reach' ); ?></span> |
| 29 | </label> |
| 30 | </p> |
| 31 |