Site logo

Archived topic

Klarna Checkout hangs/freezes on payment with GP child theme active

3 replies · Started by Sebastian on February 23, 2023

Viewing posts 1–4 of 4

Hi!

I have set up a staging environment for this new site to find out what is causing the payment process to freeze.
So I found out that something in my child theme seems to be the cause of the problem. When switching back to the parent GP theme, everything is working just fine.

What could be the cause of this behavior?

My functions.php contains the following:


<?php
/**
 * GeneratePress child theme functions and definitions.
 *
 * Add your custom PHP in this file.
 * Only edit this file if you have direct access to it on your server (to fix errors if they happen).
 */

 /*
*********************
* ACTIONS
*********************
*/

//  All included script files
function itc_included_files() {
  wp_enqueue_style('itc-main-styles', get_theme_file_uri('/build/assets/css/main.css'), array(), '1.0', 'all');
  wp_enqueue_style('itc-fontawesome', 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css');
  wp_enqueue_script('itc-google-map', 'https://maps.googleapis.com/maps/api/js?key=the_api_key_hidden_right_here', array(), '1.0', false);
  wp_enqueue_script('itc-main-js', get_stylesheet_directory_uri() . '/build/assets/js/main.js', array('jquery'), '1.0', true);
}

add_action( 'wp_enqueue_scripts', 'itc_included_files' );

// Setting the Google Map API for ACF
function itc_acf_init() {
  acf_update_setting('google_api_key', 'the_api_key_hidden_right_here');
}
add_action('acf/init', 'itc_acf_init');

// Customize login screen - Make sure to separate this stylesheet from the main one in Codekit!

function itc_login_styles() {
    wp_enqueue_style( 'custom-login', get_stylesheet_directory_uri() . '/build/assets/css/itc-custom-login.css' );
}
add_action('login_enqueue_scripts', 'itc_login_styles');

/*
*********************
* FILTERS
*********************
*/

// Customize Login Screen

add_filter('login_headerurl', 'itc_header_url');
function itc_header_url() {
  return esc_url(site_url('/'));
}

/*
*********************
* EVERYTHING ELSE
*********************
*/

Thank you!!

Hi Sebastian,

An easy approach to debug this would be to remove the set of codes one at a time while testing the checkout payment freezing issue correspondingly.

Try that out first and see how it goes and which specific code is causing the issue.

Thank you Fernando! That's a good advice. After having to deal with this for a few days now I was getting rather exhausted, not to say confused.

I followed your advice and noticed almost immediately that I had a faulty js file left from my local dev environment that caused the issue!

Like always, I walk away from here with an answer and one experience richer :)

You're welcome, Sebastian! :)

This archived topic is closed to new replies.