| 1 |
<?php |
| 2 |
/** |
| 3 |
* Module: Tip. |
| 4 |
* |
| 5 |
* @package Orderable/Classes |
| 6 |
*/ |
| 7 |
|
| 8 |
defined( 'ABSPATH' ) || exit; |
| 9 |
|
| 10 |
/** |
| 11 |
* Tip module class. |
| 12 |
*/ |
| 13 |
class Orderable_Tip { |
| 14 |
/** |
| 15 |
* Init. |
| 16 |
*/ |
| 17 |
public static function run() { |
| 18 |
add_filter( 'wpsf_register_settings_orderable', array( __CLASS__, 'register_settings' ) ); |
| 19 |
} |
| 20 |
|
| 21 |
/** |
| 22 |
* Register settings. |
| 23 |
* |
| 24 |
* @param array $settings Settings. |
| 25 |
* |
| 26 |
* @return array |
| 27 |
*/ |
| 28 |
public static function register_settings( $settings = array() ) { |
| 29 |
$settings['tabs'][] = array( |
| 30 |
'id' => 'tip', |
| 31 |
'title' => __( 'Tip Settings', 'orderable' ), |
| 32 |
'priority' => 20, |
| 33 |
); |
| 34 |
|
| 35 |
$settings['sections'][] = array( |
| 36 |
'tab_id' => 'tip', |
| 37 |
'section_id' => 'general', |
| 38 |
'section_title' => __( 'Tip Settings', 'orderable' ), |
| 39 |
'section_description' => '', |
| 40 |
'section_order' => 0, |
| 41 |
'fields' => array( |
| 42 |
array( |
| 43 |
'id' => 'pro', |
| 44 |
'title' => __( 'Enable Tipping', 'orderable' ), |
| 45 |
'subtitle' => __( 'Show tipping options at checkout.', 'orderable' ), |
| 46 |
'type' => 'custom', |
| 47 |
'output' => Orderable_Helpers::get_pro_button( 'tip' ), |
| 48 |
), |
| 49 |
), |
| 50 |
); |
| 51 |
|
| 52 |
return $settings; |
| 53 |
} |
| 54 |
} |
| 55 |
|