gorkacc
Forum Replies Created
-
The field is already saved before the order is completed. I don’t think that’s the problem.
I’ve tried with {TRIGGER_ID:post_meta:GiftName} and it’s not working ??
Don’t know what i’m doing wrong.I’m just testing the plugin because i will need a future Sensei integration and will buy the PRO version, but i need to solve this issue first.
Thanks Flavia!
I’ve tried this without success.
This is how I add the field and save it on order:
add_action('woocommerce_after_order_notes', 'cc_add_checkout_field'); function cc_add_checkout_field($checkout) { echo '<div id="gift_name_checkout_field"><h2>' . __('GiftField') . '</h2>'; woocommerce_form_field('gift_name', array( 'type' => 'text', 'class' => array('gift-name'), 'label' => __('Gift name'), 'placeholder' => __(''), ), $checkout->get_value('gift_name')); echo '</div>'; } add_action('woocommerce_checkout_update_order_meta', 'cc_checkout_field_update_order_meta'); function cc_checkout_field_update_order_meta($order_id) { if (!empty($_POST['gift_name'])) { update_post_meta($order_id, 'GiftField', sanitize_text_field($_POST['gift_name'])); } }
The field is saved successfully when the order is completed.
The trigger is launched, and on the action I try to create the user, using this field. I’ve tried with:
– {1:post_meta:GiftName}
– {1:post_meta:gift_name}with no results.
Maybe I’m forgetting to do something.
Forum: Plugins
In reply to: [WooCommerce] Allow purchase product only if 3 other products purchasedHey @laceyrod
Thank you! That solved my problem ??
Forum: Plugins
In reply to: [The Events Calendar] A non-numeric value encountered : I18n.phpSame here!