Support

Account

Forum Replies Created

  • To display your custom field in the email template next to the quantity, you can modify the code to hook into the appropriate filter for the email template. Here’s an adjusted version of your code:
    `function email_custom_field($item_quantity, $cart_item, $cart_item_key, $order){
    $price = get_field(‘price_for’, $cart_item[‘product_id’]);
    return ($price) ?
    $item_quantity . ‘ / ‘ . $price
    :
    $item_quantity;
    }
    add_filter(‘woocommerce_order_item_quantity_html’, ’email_custom_field’, 999, 4);

    This code will display your custom field next to the quantity in DGCustomerFirst the email template. Ensure to place this code in your theme’s functions.php file or in a custom plugin.

  • Yes, it’s possible to store all repeater values as one array in the database. One approach is to serialize the repeater data into a single array before storing it in the database. This way, you’ll only have one database field storing all the repeater values for each post. When retrieving the data from the database, you can unserialize the array to access the individual values.

Viewing 2 posts - 1 through 2 (of 2 total)