Z
Z
zeaovede2022-02-28 04:11:39
WordPress
zeaovede, 2022-02-28 04:11:39

Why is the order data not sent by email?

I display order details via email template

<table class="v1td" style="width: 100%; font-family: Roboto, Arial, sans-serif; margin-bottom: 15px; border: 1px solid #969595; color: #636363" cellspacing="0" cellpadding="6" border="1">
<?php
 $cart_object = WC()->cart;
//    print_r($cart_object);
    $posted = false;
    foreach($cart_object->cart_contents as $key => $value) {
      if(!$posted) {
            $data = $value['data']->get_description();
            $dat = preg_split("(<br>|<br >|</br>|<br/>|\n)", $data);
            foreach($dat as $v) {
                $d = explode(':', $v);
               if(!$d[0] OR !$d[1])
                   continue;
                echo '
                       <tbody>
                       <tr class="v1boost-attribute-option">
                       <td style="font-weight: bold; padding: 8px; width: 300px">
                           '.$d[0].':
                       </td>
                       <td style="padding: 8px" class="v1boost-attribute-value">
                           '.$d[1].'
                        </td>
                        </tr>
                        </tbody>';
            }
            $posted = true;
        }
    }
?>
</table>

I ran into a problem that data comes through manual payment, but not through the payment system. The letter itself is received, the details of the order for which the code above is responsible, they are not displayed

Manual payment
621c21ef57acc349586166.png
Payment
621c218d1d6d9993954182.png

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question