• Hey guys,

    Im editing my Processing-Template Eamil now since 9 hours.
    Im almost done with the whole html layout.
    but Im looking for specific order data in php-code style.

    I collect a bunch of them now:

    //Code For Order ID
    <?php echo $order->id; ?>
    //Code For Order Date
    <?php echo $order->order_date; ?>
    //Code For Shipping address
    <?php echo $order->shipping_address_1; ?>
    //Code For Order Items/Products
    <?php do_action( ‘woocommerce_email_order_details’, $order, $sent_to_admin, $plain_text, $email ); ?>

    I hate the design of the last code. all details are shown in such a mess..
    I want to design the detail-data by my own.

    So I need the code for:
    1.Ordered Item name
    2.Order quantity
    3.Ordered item colour
    4.Size of ordered item
    5.Unit price
    6.Total price
    7.Vat
    8.Shipping Fee
    9.And Total Price

    where can I find them?

    OR DO YOU EVEN KNOW A FREE PLUGIN, WHICH CAN HANDLE ALL THIS`?

    THANK YOU SO MUCH

    • This topic was modified 9 years, 3 months ago by apollossohn.
Viewing 2 replies - 1 through 2 (of 2 total)
  • If you know how to use action hooks then it’s pretty easy to find the details.

    In your custom email template remove the do_action for order details or rename it to something else like this :

    do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email );
    change it to
    do_action( 'my888_custom_email_order_details', $order, $sent_to_admin, $plain_text, $email );

    then using that action your will have the $order object, if you see the class-wc-order.php then you will see the object structure and from there you need to retrieve the data.

    Thread Starter apollossohn

    (@apollossohn)

    @rafsuntaskin

    At first, thank you so much.
    I think I dindt get it. Here is what i did:

    implemented <?php “do_action( ‘my888_custom_email_order_details’, $order, $sent_to_admin, $plain_text, $email );” ?> to my template. send a testmail.

    go to ftp-client. found “class-wc-order.php” in template>woocoomerce>incudes
    search for 888 to find a structure, but dindt succeed… cant still grab out the codes..

    can you try to explain it in a different way? thanks

    • This reply was modified 9 years, 3 months ago by apollossohn.
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Searching PHP-Codes for Order Info’ is closed to new replies.