When to use this
By default, the PeachPay Express Checkout will lazy load, which improves the initial load time of the page. This is good for SEO and is what you most likely want for your store.
However, if you feel it takes a while for the Express Checkout window to appear after clicking the button, there's a tradeoff you can make to have it load faster, at the cost of a slightly slower initial page load.
Usage example
This can be added to a child theme's functions.php
or using any snippet plugin like Code Snippets.
/**
* Make the PeachPay Express Checkout iframe load immediately on page load
* instead of when the Express Checkout button is clicked.
**/
function pp_checkout_snippet_load_mode( $data ) {
$data["load_mode"] = "eager";
return $data;
}
add_filter( "pp_checkout_button_data", "pp_checkout_snippet_load_mode" );