Embedded checkouts in WooCommerce

  1. Home
  2. /
  3. Krokedil general support info
  4. /
  5. Embedded checkouts in WooCommerce

Embedded checkouts in WooCommerce

The Krokedil plugins with embedded, or iframe-based, checkouts are Avarda Checkout, Briqpay, Dintero Checkout, Klarna Checkout, Nexi Checkout, Walley Checkout, Payson Checkout, Wasa Kredit Checkout and Qliro One.

While Klarna Payments strictly speaking is not an embedded checkout, some info in this article can still be applied.


Keep the standard WooCommerce checkout fields available


When using an embedded checkout you need to have all the standard checkout fields in the WooCommerce checkout available.

For all address fields in the embedded checkout to be saved correctly in WooCommerce, the same fields need to be available in the standard WooCommerce checkout form. If you have made changes to this setup it can cause that address data from the order is not correctly saved to the order in WooCommerce.

One example of this could be, but is not limited to, that you have set Company name to Hidden in the WooCommerce settings under the Appearance section of WordPress. If you then accept B2B purchases with your embedded checkout, the field for Company name can not be saved to the WooCommerce order since this field does not exist. 

The result being that this information is missing in your WooCommerce store. If you for instance print your shipping labels from WooCommerce, or use this data as a basis for a third party service, the Company name will not be included.


Make the checkout address field “State” not required


There are some countries where WooCommerce have the checkout field State set as required, but the embedded checkout does not include this field for that country. This can cause an error where the order isn’t created at all in WooCommerce.

With this filter you can make the State field optional to avoid a checkout error in the communication with your payment provider when you have an embedded checkout.

add_filter( 'woocommerce_billing_fields', 'myprefix_billing_state_unrequired', 10, 1 );
 
add_filter( 'woocommerce_shipping_fields', 'myprefix_shipping_state_unrequired', 10, 1 );
 
 
 
function myprefix_billing_state_unrequired( $address_fields ) {
 
                $address_fields['billing_state']['required'] = false;
 
                return $address_fields;
 
}
 
 
 
function myprefix_shipping_state_unrequired( $address_fields ) {
 
                $address_fields['shipping_state']['required'] = false;
 
                return $address_fields;
 
}