Support » Plugin: Checkout Field Manager (Checkout 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 - 1 through 15 (of 36 total)
  • Got the same issue. Following.

    Same here.

    Same issue, following

    carmelo

    (@stonesthrow11)

    Having same issue as well

    Same here

    +1

    Looking at the plugin code it seems there have been some relatively large updates. I notice there are 2 lines in particular that have been left commented out:
    /new/class-wooccm.php
    Line 40:
    //include_once( WOOCCM_PLUGIN_DIR . 'new/controller/class-wooccm-order-email-controller.php' );

    and
    /new/view/backend/pages/parts/header.php
    Line 14:
    //$sections['email'] = esc_html__('Email', 'woocommerce-checkout-manager');

    I have tried uncommenting them, but that hasn’t helped or provided any more options yet.

    • This reply was modified 2 years, 10 months ago by Alex Wigmore.

    I’m having the same problem. I have an additional textarea field called myfield1 and I don’t know how to add it back into the order email (admin-new-order.php).

    thanks

    Plugin Author quadlayers

    (@quadlayers)

    hello guys

    the emails feature are no longer supported

    the plugin was full of errors and we should take some undesired desitions to maintain it

    as you know the entire panel has been rebuilt and now the team is evaluating the next steps about these features as they should be rewritten from scratch, probably they will be included in a premium version

    however, you always can rollback to previous author versions in the advanced section

    just go to PREVIOUS VERSIONS and select 4.3.2 which is the latest version without changes

    https://wordpress.org/plugins/woocommerce-checkout-manager/advanced/

    thanks for understanding

    • This reply was modified 2 years, 10 months ago by quadlayers.
    carmelo

    (@stonesthrow11)

    If you are going to make such a major change that should have been communicated to users in some way,

    Your plugins uninstalled and a better one installed
    For other people that were using this plugin there are better ones out there than this one now that it’s major part has been removed.

    I’m very thanksfull that you took over the ownership. But this is a big problem for me =(

    This is a huge issue—in this light I will be attempting to fork this plugin and repurpose it.

    Plugin Author quadlayers

    (@quadlayers)

    we’ve rewritten the old code for you guys

    you can include this in the functions.php in your themes or upload as a plugin

    
    
    /**
     * Plugin Name: WooCommerce Checkout Manager Email Fix
     * Description: Manages WooCommerce Checkout, the advanced way.
     * Version:     1.0.0
     * Author:      QuadLayers
     * Author URI:  https://www.quadlayers.com
     */
    add_action('woocommerce_email_after_order_table', 'wooccm_order_receipt_checkout_details', 10, 3);
    
    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 $btn['label'] . ': ' . nl2br(get_post_meta($order->get_id(), sprintf('_%s', $btn['key']), true));
                echo "\n";
              } elseif (
                      !empty($btn['label']) &&
                      $btn['type'] == 'heading' &&
                      $btn['type'] !== 'multiselect' &&
                      $btn['type'] !== 'file' &&
                      $btn['type'] !== 'multicheckbox'
              ) {
                echo $btn['label'];
                echo "\n";
              } 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 $btn['label'] . ': ';
                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 "\n";
              }
            }
          }
        }
    
        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 $btn['label'] . ': ' . nl2br(get_post_meta($order->get_id(), sprintf('_%s', $btn['key']), true));
                echo "\n";
              } elseif (
                      !empty($btn['label']) &&
                      $btn['type'] == 'heading' &&
                      $btn['type'] !== 'multiselect' &&
                      $btn['type'] !== 'file' &&
                      $btn['type'] !== 'multicheckbox'
              ) {
                echo $btn['label'];
                echo "\n";
              } 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 $btn['label'] . ': ';
                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 "\n";
              }
            }
          }
        }
        
        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 $btn['label'] . ': ' . nl2br(get_post_meta($order->get_id(), sprintf('_%s', $btn['key']), true));
                echo "\n";
              } elseif (
                      !empty($btn['label']) &&
                      $btn['type'] == 'heading' &&
                      $btn['type'] !== 'multiselect' &&
                      $btn['type'] !== 'file' &&
                      $btn['type'] !== 'multicheckbox'
              ) {
                echo $btn['label'];
                echo "\n";
              } 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 $btn['label'] . ': ';
                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 "\n";
              }
            }
          }
        }
      }
    }

    That’s awesome, the code works great. Thanks!

    Is there a way to edit the code so that the layout is like it was before with a full linebreak in between the additional fields in the email?

    Plugin Author quadlayers

    (@quadlayers)

    maybe replaciung echo “\n” with echo “<br/>”

Viewing 15 replies - 1 through 15 (of 36 total)
  • The topic ‘Custom Fields No Longer In Emails’ is closed to new replies.