Payment using PayPal express checkout doesn’t trigger checkout action
-
I’m using custom code to add meta data for certain item:
add_action( 'woocommerce_checkout_create_order_line_item', 'save_custom_posted_field_into_order', 9999, 4 );
function save_custom_posted_field_into_order( $item, $cart_item_key, $values, $order ) {
if ( ! empty( $values['free_sample'] ) ) {
$product = wc_get_product( $values['free_sample'] );
if ( !$product ) return;
$product_name = $product->get_name();
$product_sku = $product->get_sku();
$item->update_meta_data( 'ID', $values['free_sample'] );
$item->update_meta_data( 'Free sample for', $product_name );
$item->update_meta_data( 'Product sku', $product_sku );
}
}But when payment is made using PayPal express checkout button in Cart, it seems it does not trigger this function.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.