Premium WordPress Themes and Support

Home Forums General WordPress Modify table of totals in the mail template Woocommerce

Tagged: 

This topic contains 4 replies, has 2 voices, and was last updated by  jorge garcía 4 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #5876

    jorge garcía
    Participant
    WP Private
    Post count: 19

    Hello, I want to modify the table of the totals of the mail template.
    This code shows the totals:

    <?php
    foreach ( $order->get_order_item_totals() as $key => $total ) {
    					?>
    <tr>
    <th scope="row"><?php echo $total['label']; ?></th>
    <td><?php echo $total['value']; ?></td>
    </tr>
    <?php

    But he shows them vertically and wanted to show them horizontally.
    Would it be possible?

    Can you help me?
    Thank you

    #5877

    Nick
    Keymaster
    WP Colonel
    Post count: 721

    I’m guessing you are talking about Woocomemerce emails.

    Look for a plugin that will do what you want before anything else, because successfully the Woo code will only work until the next update, which you will have to do the code changes again after each update.

    Also, did you ask this question at woocommerce.com and wordpress.org support forums?

    Without testing, here is my guess. Look at the line

    < ?php echo $total['value']; ?>

    Try removing the td tags and see what happens…

    #5878

    jorge garcía
    Participant
    WP Private
    Post count: 19

    Hi nick

    I’m guessing you are talking about Woocomemerce emails.

    Yes, just that

    Look for a plugin that will do what you want before anything else, because successfully the Woo code will only work until the next update, which you will have to do the code changes again after each update.

    Yes, I’m doing it with a plugin, which takes that information from the woocommerce plugin.
    And woocomerce plugin uses that code to call the total

    Also, did you ask this question at woocommerce.com and wordpress.org support forums?

    Yes, but no one has answered me

    Without testing, here is my guess. Look at the line
    < ?php echo $total[‘value’]; ?>
    Try removing the td tags and see what happens…

    If I delete the table or row, only the detail of the total appears.
    That includes, total without taxes, total with taxes, form of payment etc.

    I am investigating other ways of modifying it.
    I only found one way, which is to enter the code <?php echo $total['value']; ?> in the tr. And they appear horizontally. The order is preordained from woocommerce, but I can not find from where

    Thanks Nick

    #5879

    Nick
    Keymaster
    WP Colonel
    Post count: 721

    1. What is the file you are editing?
    2. Any screenshots what is being showing, and how you want it shown exactly?
    3. Did you look at any css solutions, or you are strictly looking at php/html?

    I will try to help you as much as I can, but I have zero experience in what you are going to accomplish, so you need to help me kick start by showing me all the research and testing you have done so far. I have a feeling that CSS might also be needed, that’s where Microthemer might come really handy.

    #5880

    jorge garcía
    Participant
    WP Private
    Post count: 19

    Hello Nick, I’m using yith-woocommerce-request-a-quote-premium to print pdf and send mails to clients.

    1. What is the file you are editing?

    In the template pdf, the products bought and the total of the purchase, the form of payment, the taxes are listed.
    In the free version the pdf is not created.

    2. Any screenshots what is being showing, and how you want it shown exactly?

    Image and video hosting by TinyPic

    The totals are vertical and what I want is to put them horizontally and order them as I am interested.

    3. Did you look at any css solutions, or you are strictly looking at php/html?

    I have not looked at the css options since they do not affect the table

    I will try to help you as much as I can, but I have zero experience in what you are going to accomplish, so you need to help me kick start by showing me all the research and testing you have done so far. I have a feeling that CSS might also be needed, that’s where Microthemer might come really handy

    No problem nick. It’s a code thing, do not modify css. All the modifications I have made in php.
    Although I’m modifying an external plugin to woocommerce, the plugin uses a woocommerce code to save the totals, it does not use its own code. The code that uses the plugin, is the same one that uses woocommerce for the templates of the mails.
    I’m trying to figure out where it gets it from and how it applies the foreach filter ($ order-> get_order_item_totals () as $ key => $ total) ”
    I’ve only found one way to put the result of the totals horizontal. Entering the code “<? Php echo $ total [‘value’];?>” Inside the tr of the table.

    thanks

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.