• Resolved Rahul K

    (@rahulacodez)


    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;
    }`

    • This topic was modified 3 years, 4 months ago by Rahul K.
    • This topic was modified 3 years, 4 months ago by Rahul K.
    • This topic was modified 3 years, 4 months ago by Steven Stern (sterndata).
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Compatibility With Custom Product Addon’ is closed to new replies.