Compatibility With Custom Product Addon
-
Hi,
I am the developer of woocommerce custom product addons,Can you please add a code in your plugin to make compatible with ours. It’s a small change in checkout fields filter. Your old code, session variable returns null it causes fatal error in backend, while we calling
WC()->checkout->get_checkout_fields()
please add below code,`public function add_shipping_data_input( $fields ) {
$default = “”;
if ( is_checkout() ) {
$klarna_order_id = WC()->session->get( ‘kco_wc_order_id’ );
$shipping_data = get_transient( ‘kss_data_’ . $klarna_order_id );
$default = wp_json_encode( $shipping_data );
}
$fields[‘billing’][‘kco_shipping_data’] = array(
‘type’ => ‘hidden’,
‘class’ => array( ‘kco_shipping_data’ ),
‘default’ => $default,
);
return $fields;
}`
- The topic ‘Compatibility With Custom Product Addon’ is closed to new replies.