• Resolved stonylake

    (@stonylake)


    If a user select a specific option (select-box input) or enter a specific text (text input) and order this item, I want to take a specific action.

    For example: If a customer enters ‘foo’ in text_input filed with name ‘alert_field’ add this product to cart and complete the order. Then I want to inform someone via mail.

    I thougt I do this in ‘woocommerce_checkout_create_order’ checking for if ‘alert_field’ == ‘foo’ and then simply send mail out.

    How can I access PPOM fields in ‘woocommerce_checkout_create_order’?

    Thanks for help

Viewing 1 replies (of 1 total)
  • Hi @stonylake,

    if you see action codex:
    do_action( 'woocommerce_checkout_create_order', $order, $data );

    try $data if this has all fields, i think it should have meta data attached with order.

    And other way to get PPOM fields from Order Item is following:
    $ppom_fields_post = wc_get_order_item_meta( $item->get_id(), '_ppom_fields');

Viewing 1 replies (of 1 total)
  • The topic ‘Take action if a field has a specific value’ is closed to new replies.