Home Forums WC Vendors Free Support Emails not showing correct shipping totals

NOTICE: We've Moved to a Ticket System for Support

As of August 31, 2017 (12am EST) our support forums will be retired (read-only), and we will be moving to a support ticket system.  This will allow us to better organize and answer support requests, and provide a more personalized experience as we assist our customers.

For the time being, we will leave our forums open for reading and learning while we work on creating a more robust Knowledge Base for everyone to use.

If you are a WC Vendors Pro customer please open a support ticket here. 

If you are a WC Vendors user please open a support ticket on the Wordpress.org forums.

The information on this forum is outdated and in most instances no longer relevant. Please be sure to check our documentation for the most up to date information.

https://docs.wcvendors.com/

Thank you to all of our customers!

 

  • This topic has 5 replies, 2 voices, and was last updated 5 years ago by Anna.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #70796
    VisionaIP
    Participant

    Hi,

    I’m using WCV Pro (I just post this here because emails are free feature).
    In the emails sent to the vendor with the order of a customer, all information is right, only related to that vendor, except “Shipping” and “Total”. I can fix the Total one, it’s just summing up “Subtotal” and “Shipping” but I don’t fin the way to get the correct shipping as it’s taking the full shipping of the order, including the shipping costs associated to other vendors instead of the one associated to that vendor.
    I had similar issues with the order details in the Vendor Dashboard, but they were solved in the last update (1.4.4).

    Can you reproduce the issue and do you have any piece of code for this until you get an update with the solution?

    Thanks.

    Regards

    #70827
    Anna
    Member

    @rbarriuso
    Hello,
    Are you using the Vendor Shipping built into WC Vendors Pro, or another shipping method?
    Have you overridden any of the email templates?

    #70855
    VisionaIP
    Participant

    Hello Anna,

    Yes, I’m using Vendor Shipping.

    Yes. I’ve overridden the email templates but keeping the variables, just changing just some style and html. More concretely:

    • I’m keeping the woocomerce header: do_action( 'woocommerce_email_header', $email_heading, $email );
    • Same with footer
    • I’m using $order->get_total_shipping(); to get the shipping costs. I thought this could be the error but I’ve copied the code from your template and the results are the same.
      if ( $totals = $order->get_order_item_totals() ) {
      	$i = 0;
      	foreach ( $totals as $total ) {
      		$i++;
      		?><tr>
      			<th scope="row" colspan="2" style="text-align:left; border: 1px solid #eee; <?php if ( $i == 1 ) echo 'border-top-width: 4px;'; ?>"><?php echo $total['label']; ?></th>
      			<td style="text-align:left; border: 1px solid #eee; <?php if ( $i == 1 ) echo 'border-top-width: 4px;'; ?>"><?php echo $total['value']; ?></td>
      		</tr><?php
      	}
      }

    Please, let me know if you need the full code of the template.

    Thanks.

    Regards.

    #72647
    VisionaIP
    Participant

    Hi Anna,

    Big mistake. I was testing the emails with an Email Tester from the dashboard, so it was taking admin version of shipping. Sending real emails with your code works, so I’ll review mine and be sure it’s taking the correct variables.

    Thanks.

    Regards.

    #72653
    VisionaIP
    Participant

    For reference, solved using $order->get_order_item_totals()[shipping][value]; instead of $order->get_total_shipping();

    Regards.

    #72857
    Anna
    Member

    Thank you for sharing!

Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘WC Vendors Free Support’ is closed to new topics and replies.
This website uses cookies to ensure you get the best experience on our website.