J
J
Jokerrs5672022-03-19 21:11:18
WordPress
Jokerrs567, 2022-03-19 21:11:18

How to display order parameters in woocommerce admin?

Now I display the order parameters on the checkout page through the form-checkout.php template, but they do not come to the admin panel. What is the reason?

<?php
 $cart_object = WC()->cart;
//    print_r($cart_object);
    $posted = false;
    echo '<div class = "row mb-1">';
    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 '
              <div id="details-2" class="col-12 col-xl-4 col-lg-12 mb-xl-5 mb-5 ">
<div class="d-flex b-skills">
<div class="height:70px;">
                       <div class="text-bold">
                           '.$d[0].':
                       </div>
                       <div class="text-primary">
                           '.$d[1].'
                       </div>
                   </div>
                   </div>
               </div>';
            }
            $posted = true;
        }
    }
    echo '</div>';
?>

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