Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

Register each Klarna Method as $available_gateways

$
0
0

Replies: 0

Hey!
I’m trying to implement Klarna into our checkout with your Plugin. Our website is customized and for that we are getting the “$gateway->payment_fields();” in our payment.php in that way:

			if ( ! empty( $available_gateways ) ) {
				foreach ( $available_gateways as $gateway ) {
					if ( $gateway->has_fields() || $gateway->get_description() ) { ?>
			        <div class="bb_payment_box bb_payment_method_<?php echo esc_attr( $gateway->id ); ?>" <?php if ( ! $gateway->chosen ) : /* phpcs:ignore Squiz.ControlStructures.ControlSignature.NewlineAfterOpenBrace */ ?>style="display:none;"<?php endif; /* phpcs:ignore Squiz.ControlStructures.ControlSignature.NewlineAfterOpenBrace */ ?>>
			            <?php $gateway->payment_fields(); ?>
			        	<div class="payment_terms terms_normal">Durch den Abschluss des Kaufes, stimme ich den Nutzungsbedingungen der BeerBaller GmbH zu.</div>
			        </div>
					<?php }; 					
				}					
			}

The problem we have is that it seems to be so that your Plugin only registers “klarna_payments_pay_later” as $available_gateways. So it only echo out the payment fields for that type. If you try to select one of the other methods we get a “Uncaught InvalidContainerSelectorError: The container selector is invalid. Please, check that the used ID or CSS class name is correct and that it targets an existing DOM element.
” error.

Is there a way to register the other ones too?

Best Justus


Viewing all articles
Browse latest Browse all 59525

Trending Articles