-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #939 from mollie/fix/populate-birth-on-pay-page-PI…
…WOO-521 Add birth from meta to fields in pay page PIWOO-521
- Loading branch information
Showing
3 changed files
with
38 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
src/PaymentMethods/PaymentFieldsStrategies/PaymentFieldsStrategiesTrait.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
namespace Mollie\WooCommerce\PaymentMethods\PaymentFieldsStrategies; | ||
|
||
trait PaymentFieldsStrategiesTrait | ||
{ | ||
protected function getOrderIdOnPayForOrderPage() | ||
{ | ||
global $wp; | ||
$orderId = absint($wp->query_vars['order-pay']); | ||
return wc_get_order($orderId); | ||
} | ||
|
||
protected function dateOfBirth($birthValue) | ||
{ | ||
$birthValue = $birthValue ?: ''; | ||
?> | ||
<p class="form-row form-row-wide" id="billing_birthdate_field"> | ||
<label for="<?php echo esc_attr(self::FIELD_BIRTHDATE); ?>" class=""><?php echo esc_html__('Birthdate', 'mollie-payments-for-woocommerce'); ?> | ||
</label> | ||
<span class="woocommerce-input-wrapper"> | ||
<input type="date" class="input-text " name="<?php echo esc_attr(self::FIELD_BIRTHDATE); ?>" | ||
id="<?php echo esc_attr(self::FIELD_BIRTHDATE); ?>" value="<?php echo esc_attr($birthValue); ?>" | ||
autocomplete="birthdate"></span> | ||
</p> | ||
<?php | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters