
Hello,
I just created custom field type for my woocomemrce website. it’s showed woocommerce checkout page. When customer added product into the cart, than they can see the cart item list by select filed.Now it’s display the cart item list but when i place the order , the back-end order disappeared!!!
Note :
1. I used this field inside the Repeater Field.
2. follow this resource for creating new field : https://github.com/AdvancedCustomFields/acf-field-type-template
3. Value not send with woocommerce Order Email
4. Valuse not saved in ‘Order Backend’ panel,
I used this code for display the cart item value :
function render_field( $field ) {
echo ‘<select name=”‘ . $field[‘key’] . ‘”>’;
$items =WC()->cart->get_cart();
foreach($items as $item => $values) {
$_product = $values[‘data’]->post;
$price = get_post_meta($values[‘product_id’] , ‘_price’, true);
echo “<option value=”.$values[‘product_id’].”>”.$_product->post_title.”-“.$price.”</option>”;
}
echo ‘</select>’;
}
Note : $items =WC()->cart->get_cart(); this line create conflict with Woocommece Order Backend.
Attached Screenshot :
Frontend : http://prntscr.com/ho856i
Order Backend : http://prntscr.com/ho867u
ACF Field : http://prntscr.com/ho85nm
Thanks for your time.