| 1 |
<?php |
| 2 |
/** |
| 3 |
* Agree to Terms Checkout |
| 4 |
* |
| 5 |
* @package Merchant |
| 6 |
*/ |
| 7 |
|
| 8 |
if ( ! defined( 'ABSPATH' ) ) { |
| 9 |
exit; // Exit if accessed directly |
| 10 |
} |
| 11 |
|
| 12 |
$before_fields = array(); |
| 13 |
if ( merchant_is_checkout_block_layout() ) { |
| 14 |
$before_fields = array( |
| 15 |
'type' => 'warning', |
| 16 |
'content' => sprintf( |
| 17 |
/* Translators: 1. docs link */ |
| 18 |
__( 'Your checkout page is being rendered through the new WooCommerce checkout block. You must edit the checkout page to use the classic checkout shortcode instead. Check <a href="%1$s" target="_blank">this documentation</a> to learn more.', 'merchant' ), |
| 19 |
'https://docs.athemes.com/article/how-to-switch-cart-checkout-blocks-to-the-classic-shortcodes/' |
| 20 |
), |
| 21 |
); |
| 22 |
} |
| 23 |
|
| 24 |
/** |
| 25 |
* Settings |
| 26 |
*/ |
| 27 |
Merchant_Admin_Options::create( array( |
| 28 |
'title' => esc_html__( 'Settings', 'merchant' ), |
| 29 |
'module' => 'agree-to-terms-checkbox', |
| 30 |
'fields' => array( |
| 31 |
|
| 32 |
$before_fields, |
| 33 |
|
| 34 |
array( |
| 35 |
'id' => 'label', |
| 36 |
'type' => 'text', |
| 37 |
'title' => esc_html__( 'Label', 'merchant' ), |
| 38 |
'default' => esc_html__( 'I agree with the', 'merchant' ), |
| 39 |
), |
| 40 |
|
| 41 |
array( |
| 42 |
'id' => 'text', |
| 43 |
'type' => 'text', |
| 44 |
'title' => esc_html__( 'Terms and conditions text', 'merchant' ), |
| 45 |
'default' => esc_html__( 'Terms & Conditions', 'merchant' ), |
| 46 |
), |
| 47 |
|
| 48 |
array( |
| 49 |
'id' => 'link', |
| 50 |
'type' => 'text', |
| 51 |
'title' => esc_html__( 'Terms and conditions link', 'merchant' ), |
| 52 |
'default' => get_privacy_policy_url(), |
| 53 |
), |
| 54 |
|
| 55 |
), |
| 56 |
) ); |
| 57 |
|