|
1
|
|
|
<?php |
|
2
|
|
|
namespace Page; |
|
3
|
|
|
|
|
4
|
|
|
|
|
5
|
|
|
/** |
|
6
|
|
|
* Checkout |
|
7
|
|
|
* Selectors/references for elements related to the checkout. |
|
8
|
|
|
* |
|
9
|
|
|
* @package Page |
|
10
|
|
|
* @author Darren Ethier |
|
11
|
|
|
* @since 1.0.0 |
|
12
|
|
|
*/ |
|
13
|
|
|
class Checkout |
|
14
|
|
|
{ |
|
15
|
|
|
|
|
16
|
|
|
/** |
|
17
|
|
|
* The class selector for the next step button in the checkout. |
|
18
|
|
|
* @var string |
|
19
|
|
|
*/ |
|
20
|
|
|
const NEXT_STEP_BUTTON_SELECTOR = '.spco-next-step-btn'; |
|
21
|
|
|
|
|
22
|
|
|
|
|
23
|
|
|
const PAYMENT_METHOD_STEP_FORM = '#ee-spco-payment_options-reg-step-form'; |
|
24
|
|
|
|
|
25
|
|
|
|
|
26
|
|
|
const SELECTOR_PAYMENT_OPTIONS_CONTAINER = '#spco-available-methods-of-payment-dv'; |
|
27
|
|
|
|
|
28
|
|
|
|
|
29
|
|
|
/** |
|
30
|
|
|
* @param int $attendee_number |
|
31
|
|
|
* @param bool $admin Used to indicate whether we're retrieving the selector from the context of the admin or not. |
|
32
|
|
|
* @return string |
|
33
|
|
|
*/ |
|
34
|
|
|
public static function firstNameFieldSelectorForAttendeeNumber($attendee_number = 1, $admin = false) |
|
35
|
|
|
{ |
|
36
|
|
|
return self::fieldSelectorForAttendeeNumber('fname', $attendee_number, $admin); |
|
37
|
|
|
} |
|
38
|
|
|
|
|
39
|
|
|
|
|
40
|
|
|
/** |
|
41
|
|
|
* @param int $attendee_number |
|
42
|
|
|
* @param bool $admin Used to indicate whether we're retrieving the selector from the context of the admin or not. |
|
43
|
|
|
* @return string |
|
44
|
|
|
*/ |
|
45
|
|
|
public static function lastNameFieldSelectorForAttendeeNumber($attendee_number = 1, $admin = false) |
|
46
|
|
|
{ |
|
47
|
|
|
return self::fieldSelectorForAttendeeNumber('lname', $attendee_number, $admin); |
|
48
|
|
|
} |
|
49
|
|
|
|
|
50
|
|
|
|
|
51
|
|
|
/** |
|
52
|
|
|
* @param int $attendee_number |
|
53
|
|
|
* @param bool $admin Used to indicate whether we're retrieving the selector from the context of the admin or not. |
|
54
|
|
|
* @return string |
|
55
|
|
|
*/ |
|
56
|
|
|
public static function emailFieldSelectorForAttendeeNumber($attendee_number = 1, $admin = false) |
|
57
|
|
|
{ |
|
58
|
|
|
return self::fieldSelectorForAttendeeNumber('email', $attendee_number, $admin); |
|
59
|
|
|
} |
|
60
|
|
|
|
|
61
|
|
|
/** |
|
62
|
|
|
* @param string $field_name |
|
63
|
|
|
* @param int $attendee_number |
|
64
|
|
|
* @param bool $admin Used to indicate whether we're retrieving the selector from the context of the admin or not. |
|
65
|
|
|
* @return string |
|
66
|
|
|
*/ |
|
67
|
|
|
public static function fieldSelectorForAttendeeNumber($field_name, $attendee_number = 1, $admin = false) |
|
68
|
|
|
{ |
|
69
|
|
|
return $admin |
|
70
|
|
|
? "//fieldset[starts-with(@id, 'ee-registration-$attendee_number')]//input[contains(@class, 'ee-reg-qstn-$field_name')]" |
|
71
|
|
|
: "//div[starts-with(@id, 'spco-attendee-panel-dv-$attendee_number')]//input[contains(@class, 'ee-reg-qstn-$field_name')]"; |
|
72
|
|
|
} |
|
73
|
|
|
|
|
74
|
|
|
|
|
75
|
|
|
/** |
|
76
|
|
|
* @param string $payment_method_slug Slug for the payment method. |
|
77
|
|
|
* @return string |
|
78
|
|
|
*/ |
|
79
|
|
|
public static function fieldSelectorForPaymentOption($payment_method_slug) |
|
80
|
|
|
{ |
|
81
|
|
|
return "#ee-available-payment-method-inputs-{$payment_method_slug}"; |
|
82
|
|
|
} |
|
83
|
|
|
} |
|
84
|
|
|
|