core = $core;
add_action( 'woocommerce_checkout_after_order_review', array( $this, 'extend_checkout_page_form' ) );
add_action( 'woocommerce_after_checkout_form', array( $this, 'extend_checkout_page_bottom' ) );
}
/**
* Get additional HTML code for checkout form.
*/
public function extend_checkout_page_form() {
echo '';
}
/**
* Extend_checkout_page_bottom.
*
* Check and embed code for modal if needed on checkout page.
*/
public function extend_checkout_page_bottom() {
$config = $this->core->get_config_for_currency();
$config->access_mode_to_strict();
if ( $config->get_p24_payinshop() ) {
$my_account_link = get_permalink( get_option( 'woocommerce_myaccount_page_id' ) );
echo '';
$display_terms = $config->get_p24_acceptinshop();
self::echo_modal_html( $display_terms );
}
}
/**
* Get HTML code for modal
*
* @param bool $need_terms If checkbox to show terms is needed. Default to false.
*
* @return string
*/
public static function get_modal_html( $need_terms = false ) {
$terms = $need_terms ? '1' : '0';
$translation_element = self::get_translation_element();
return <<
RET;
}
/**
* Echo HTML code for modal
*
* @param bool $need_terms If checkbox to show terms is needed. Default to false.
*/
public static function echo_modal_html( $need_terms = false ) {
echo self::get_modal_html( $need_terms ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
/**
* Get input with translations.
*
* @return string
*/
public static function get_translation_element() {
$translate = array(
'name' => __( 'Imię i nazwisko', 'przelewy24' ),
'nr' => __( 'Numer karty', 'przelewy24' ),
'cvv' => __( 'CVV', 'przelewy24' ),
'dt' => __( 'Data ważności', 'przelewy24' ),
'pay' => __( 'Zapłać', 'przelewy24' ),
'3ds' => __( 'Kliknij tutaj aby kontynuować zakupy', 'przelewy24' ),
'registerCardLabel' => __( 'Zapisz kartę', 'przelewy24' ),
'description' => __( 'Zarejestruj i zapłać', 'przelewy24' ),
'termsPrefix' => __( 'Tak, przeczytałem i akceptuję', 'przelewy24' ),
'termsLinkLabel' => __( 'regulamin Przelewy24', 'przelewy24' ),
);
return <<
CODE;
}
}