All Collections
Express Checkout
Adding custom styles and scripts to the Express Checkout window
Adding custom styles and scripts to the Express Checkout window

You can include custom CSS and JS files to style and change the behavior inside the Express Checkout iframe with a PHP snippet.

Vikrant Sant avatar
Written by Vikrant Sant
Updated over a week ago

Overview

Sometimes, you may want to change the look or behavior of something inside the Express Checkout window. You can do so by including additional CSS and JS files using the hooks below.

For short snippets of JS, you can also use the built-in snippet editor in the advanced settings for the Express Checkout.

How to add custom styles and scripts

Use the WordPress hook pp_checkout_enqueue_scripts to add custom CSS and JS files to be included in the Express Checkout iframe using wp_enqueue_script for JS or wp_enqueue_style for CSS.

Example for JS

function add_custom_script_to_express_checkout() {
$version = date( "ymd-Gis", filemtime( plugin_dir_path( __FILE__ ) . 'js/custom.js' ) );
wp_enqueue_script( "custom_js", plugin_url( "js/custom.js", __FILE__ ), array(), $version );
}

add_action( "pp_checkout_enqueue_scripts", "add_custom_script_to_express_checkout" );
Did this answer your question?