Support » Plugin: Checkout Fields Manager for WooCommerce » Custom Fields No Longer In Emails

  • Resolved jakeasba

    (@jakeasba)


    * WooCommerce Checkout Manager Version 4.5.7
    * WooCommerce 3.7.1
    * WordPress 5.2.4

    No errors that I’ve noticed.

    Prior to today, my notification emails for new orders included all of the custom fields from WooCommerce Checkout Manager, but now the custom fields are not included in the emails. Only thing I can think of is that WordPress could have been automatically updated today.

    Any insight?

Viewing 15 replies - 16 through 30 (of 36 total)
  • Thanks, a couple of <br/><br/> did the trick.

    Cheers

    That code didn’t work for me after putting it in functions.php.
    Also order notes no longer showing in the order overview within WooCommerce at all.

    Plugin Author quadlayers

    (@quadlayers)

    @wigster make sure you’re in 4.6.0

    Hello, i added your code but i cant figure out where i can activate it or do some changes? I dont get, what i have to do now. Can u help me out?

    thank you for this code snippet.

    This is a must have feature.. please consider make it available in next version.

    Damn, guys, please add a link to this thread in your changelog as we went nuts trying to figure out why the custom fields weren’t being sent in the emails.

    Why offering custom fields if you won’t allow to send them in the order emails?
    Why continue updating this plugin, at all?
    Sorry guys, this change made me really angry. Hope you can understand.
    Communication is an important part in plugin development to improve connection with your users.

    @stonesthrow11: what alternative plugin have you found? please share.

    Thanks…

    Besides, I’ve uploaded your plugin fix and it throws errors when activated.
    Can you please share it as a downloadable file on pastebin or google drive?

    hny

    (@honeyloudlr)

    Hello. The fix you provided is not working.

    Can you please share the code? We need the custom fields appearing on the emails.

    Thank you!

    A change like this should really be communicated from the get go. Having the additional fields not show in the email makes the plugin really quite useless.

    All sites with this plugin running now don’t receive all the additional info from the fields in the email and the admin/shop manager has to login to view the orders in the Dashboard… not ideal at all.

    Thank you for giving us the above code to make it work, but this is really just a temporary fix that I really hope you add back in.

    • This reply was modified 1 year, 8 months ago by MagineM.

    The solution code you provide to add the additional fields in email, is not working on my website using v4.7.1 of WooCommerce Checkout Manager and showing a lot of errors.

    Cette extension a généré 7269 caractères de sortie inattendus lors de son activation. Si vous remarquez des messages « headers already sent », des problèmes avec vos flux de syndication ou d’autres soucis, essayez de désactiver ou de supprimer cette extension.

    Also this sound like a temporary solution which may not be running well for a long time and may cause various problem with the next futur updates of WooCommerce Checkout Manager.

    I’ve to admit that having the additional fields not shown in the orders email makes the plugin really quite useless, it’s a huge loss.
    It’s a major part of this plugin, now missing.
    Too bad because the improvements in the other parts (new back-office etc) seems to be really good.

    Replacement code does not work in functions.php. Can I get some help on this?
    Thanks!!

    hny

    (@honeyloudlr)

    Hi Guys. Instead of adding it on functions.php please try uploading it as a plugin. You can download it here. https://drive.google.com/open?id=1oDcabXljjwwgTq2aD8BpGoYnmH0sbrRk I modified the code a bit and it’s working on my end. Thanks!

    Thanks!!!

    How do you upload as a plugin?

    Thanks @quadlayers, the code worked for me, I added the spaces and font weights to match the initial format.

    function wooccm_order_receipt_checkout_details($order, $sent_to_admin, $plain_text = '') {
    
    	if (class_exists('WOOCCM')) {
    
    		$billing_defaults = WOOCCM()->billing->get_defaults();
    		$shipping_defaults = WOOCCM()->shipping->get_defaults();
    		$additional_defaults = WOOCCM()->additional->get_defaults();
    
    		$billing = WOOCCM()->billing->get_fields();
    		$shipping = WOOCCM()->shipping->get_fields();
    		$additional = WOOCCM()->additional->get_fields();
    
    		if (!empty($billing)) {
    
    			foreach ($billing as $btn) {
    
    				if (!in_array($btn['name'], $billing_defaults)) {
    
    					if (( get_post_meta($order->get_id(), sprintf('_%s', $btn['key']), true) !== '' ) &&
    					    !empty($btn['label']) &&
    					    $btn['type'] !== 'heading' &&
    					    $btn['type'] !== 'multiselect' &&
    					    $btn['type'] !== 'file' &&
    					    $btn['type'] !== 'multicheckbox'
    					) {
    						echo '<strong>' . $btn['label'] . ':</strong> ' . nl2br(get_post_meta($order->get_id(), sprintf('_%s', $btn['key']), true));
    						echo "<br/>";
    					} elseif (
    						!empty($btn['label']) &&
    						$btn['type'] == 'heading' &&
    						$btn['type'] !== 'multiselect' &&
    						$btn['type'] !== 'file' &&
    						$btn['type'] !== 'multicheckbox'
    					) {
    						echo $btn['label'];
    						echo "<br/>";
    					} elseif (
    						( get_post_meta($order->get_id(), sprintf('_%s', $btn['key']), true) !== '' ) &&
    						!empty($btn['label']) &&
    						$btn['type'] !== 'heading' &&
    						$btn['type'] !== 'file' &&
    						(
    							$btn['type'] == 'multiselect' || $btn['type'] == 'multicheckbox'
    						)
    					) {
    						$value = get_post_meta($order->get_id(), sprintf('_%s', $btn['key']), true);
    						$strings = maybe_unserialize($value);
    						echo '<strong>' . $btn['label'] . ':</strong> ';
    						if (!empty($strings)) {
    							if (is_array($strings)) {
    								$iww = 0;
    								$len = count($strings);
    								foreach ($strings as $key) {
    									if ($iww == $len - 1) {
    										echo $key;
    									} else {
    										echo $key . ', ';
    									}
    									$iww++;
    								}
    							} else {
    								echo $strings;
    							}
    						} else {
    							echo '-';
    						}
    						echo "<br/>";
    					}
    				}
    			}
    		}
    
    		if (!empty($shipping)) {
    
    			foreach ($shipping as $btn) {
    
    				if (!in_array($btn['name'], $shipping_defaults)) {
    
    					if (( get_post_meta($order->get_id(), sprintf('_%s', $btn['key']), true) !== '' ) &&
    					    !empty($btn['label']) &&
    					    $btn['type'] !== 'heading' &&
    					    $btn['type'] !== 'multiselect' &&
    					    $btn['type'] !== 'file' &&
    					    $btn['type'] !== 'multicheckbox'
    					) {
    						echo '<strong>' . $btn['label'] . ':</strong> ' . nl2br(get_post_meta($order->get_id(), sprintf('_%s', $btn['key']), true));
    						echo "<br/>";
    					} elseif (
    						!empty($btn['label']) &&
    						$btn['type'] == 'heading' &&
    						$btn['type'] !== 'multiselect' &&
    						$btn['type'] !== 'file' &&
    						$btn['type'] !== 'multicheckbox'
    					) {
    						echo '<h2 style="color:#96588a; display:block; font-family:&quot;Helvetica Neue&quot;,Helvetica,Roboto,Arial,sans-serif; font-size:18px; font-weight:bold; line-height:130%; margin:18px 0; text-align:left">' . $btn['label'] . '</h2>';
    					} elseif (
    						( get_post_meta($order->get_id(), sprintf('_%s', $btn['key']), true) !== '' ) &&
    						!empty($btn['label']) &&
    						$btn['type'] !== 'heading' &&
    						$btn['type'] !== 'file' &&
    						(
    							$btn['type'] == 'multiselect' || $btn['type'] == 'multicheckbox'
    						)
    					) {
    						$value = get_post_meta($order->get_id(), sprintf('_%s', $btn['key']), true);
    						$strings = maybe_unserialize($value);
    						echo '<strong>' . $btn['label'] . ':</strong> ';
    						if (!empty($strings)) {
    							if (is_array($strings)) {
    								$iww = 0;
    								$len = count($strings);
    								foreach ($strings as $key) {
    									if ($iww == $len - 1) {
    										echo $key;
    									} else {
    										echo $key . ', ';
    									}
    									$iww++;
    								}
    							} else {
    								echo $strings;
    							}
    						} else {
    							echo '-';
    						}
    						echo "<br/>";
    					}
    				}
    			}
    			echo "<br/>";
    		}
    
    		if (!empty($additional)) {
    
    			foreach ($additional as $btn) {
    
    				if (!in_array($btn['name'], $additional_defaults)) {
    
    					if (( get_post_meta($order->get_id(), sprintf('_%s', $btn['key']), true) !== '' ) &&
    					    !empty($btn['label']) &&
    					    $btn['type'] !== 'heading' &&
    					    $btn['type'] !== 'multiselect' &&
    					    $btn['type'] !== 'file' &&
    					    $btn['type'] !== 'multicheckbox'
    					) {
    						echo '<strong>' . $btn['label'] . ':</strong> ' . nl2br(get_post_meta($order->get_id(), sprintf('_%s', $btn['key']), true));
    						echo "<br/>";
    					} elseif (
    						!empty($btn['label']) &&
    						$btn['type'] == 'heading' &&
    						$btn['type'] !== 'multiselect' &&
    						$btn['type'] !== 'file' &&
    						$btn['type'] !== 'multicheckbox'
    					) {
    						echo $btn['label'];
    						echo "<br/>";
    					} elseif (
    						( get_post_meta($order->get_id(), sprintf('_%s', $btn['key']), true) !== '' ) &&
    						!empty($btn['label']) &&
    						$btn['type'] !== 'heading' &&
    						$btn['type'] !== 'file' &&
    						(
    							$btn['type'] == 'multiselect' || $btn['type'] == 'multicheckbox'
    						)
    					) {
    						$value = get_post_meta($order->get_id(), sprintf('_%s', $btn['key']), true);
    						$strings = maybe_unserialize($value);
    						echo '<strong>' . $btn['label'] . ':</strong> ';
    						if (!empty($strings)) {
    							if (is_array($strings)) {
    								$iww = 0;
    								$len = count($strings);
    								foreach ($strings as $key) {
    									if ($iww == $len - 1) {
    										echo $key;
    									} else {
    										echo $key . ', ';
    									}
    									$iww++;
    								}
    							} else {
    								echo $strings;
    							}
    						} else {
    							echo '-';
    						}
    						echo "<br/>";
    					}
    				}
    			}
    		}
    	}
    }
    add_action('woocommerce_email_after_order_table', 'wooccm_order_receipt_checkout_details', 10, 3);
    • This reply was modified 1 year, 8 months ago by Ali Basheer.
Viewing 15 replies - 16 through 30 (of 36 total)
  • The topic ‘Custom Fields No Longer In Emails’ is closed to new replies.