Banner Logo

Be a part of the family: Connect, Receive Support,
Contribute, and Reap Abundant Rewards!

Hide Commission in Order details error

WCMp Vendor Membership

Resolved
Viewing 3 reply threads
  • Author
    Posts
    • #114630
      cardex107
      Participant

      Hello!

      Was resolved in https://multivendorx.com/support-forum/topic/hide-commission-in-order-details/#post-92817, but the file https://docs.google.com/document/d/1d0QFalbTL6rxo2gQB4JQMl7DM54SIMtq2v3stl_HuxQ/edit?usp=sharing doesn’t works anymore.

      Please I need remove the commission from the email.

      Thanks for your help!

    • #114873

      Hi,
      To remove commission column from vendor received mail(Template override) :
      – create a blank vendor-new-order.php file in your active theme, like, yourtheme/dc-product-vendor/emails/vendor-new-order.php

      add below code into this file

      <?php
      /**
       * The template for displaying demo plugin content.
       *
       * Override this template by copying it to yourtheme/dc-product-vendor/emails/vendor-new-order.php
       *
       * @author 		WC Marketplace
       * @package 	dc-product-vendor/Templates
       * @version   0.0.1
       */
      if (!defined('ABSPATH'))
          exit; // Exit if accessed directly 
      global $WCMp;
      $vendor = get_wcmp_vendor(absint($vendor_id));
      do_action( 'woocommerce_email_header', $email_heading, $email );
      $text_align = is_rtl() ? 'right' : 'left';
      ?>
      
      <p><?php printf(esc_html__('A new order was received and marked as %s from %s. Their order is as follows:', 'dc-woocommerce-multi-vendor'), $order->get_status( 'edit' ), $order->get_billing_first_name() . ' ' . $order->get_billing_last_name()); ?></p>
      
      <?php do_action('woocommerce_email_before_order_table', $order, true, false); ?>
      <table cellspacing="0" cellpadding="6" style="width: 100%; border: 1px solid #eee;" border="1" bordercolor="#eee">
          <thead>
              <tr>
                  <?php do_action('wcmp_before_vendor_order_table_header', $order, $vendor->term_id); ?>
                  <th scope="col" style="text-align:<?php echo $text_align; ?>; border: 1px solid #eee;"><?php _e('Product', 'dc-woocommerce-multi-vendor'); ?></th>
                  <th scope="col" style="text-align:<?php echo $text_align; ?>; border: 1px solid #eee;"><?php _e('Quantity', 'dc-woocommerce-multi-vendor'); ?></th>
                  <?php do_action('wcmp_after_vendor_order_table_header', $order, $vendor->term_id); ?>
              </tr>
          </thead>
          <tbody>
          <?php
          $vendor_items = $order->get_items( 'line_item' );
          foreach ($vendor_items as $item_id => $item) {
              $product = $item->get_product();
              $_product = apply_filters('wcmp_woocommerce_order_item_product', $product, $item);
              ?>
              <tr class="">
                  <?php do_action('wcmp_before_vendor_order_item_table', $item, $order, $vendor_id, $is_ship); ?>
                  <td scope="col" style="text-align:left; border: 1px solid #eee;" class="product-name">
                      <?php
                      if ($_product && !$_product->is_visible()) {
                          echo apply_filters('wcmp_woocommerce_order_item_name', $item->get_name(), $item);
                      } else {
                          echo apply_filters('woocommerce_order_item_name', sprintf('<a href="%s">%s</a>', get_permalink($item->get_product_id()), $item->get_name()), $item);
                      }
                      wc_display_item_meta($item);
                      ?>
                  </td>
                  <td scope="col" style="text-align:left; border: 1px solid #eee;">   
                      <?php
                      echo $item->get_quantity();
                      ?>
                  </td>
                  <?php do_action('wcmp_after_vendor_order_item_table', $item, $order, $vendor_id, $is_ship); ?>
              </tr>
              <?php
          }?>
          </tbody>
      </table>
      <?php
      if (apply_filters('show_cust_order_calulations_field', true, $vendor->id)) {
          ?>
          <table cellspacing="0" cellpadding="6" style="width: 100%; border: 1px solid #eee;" border="1" bordercolor="#eee">
              <?php
              $totals = $vendor->wcmp_vendor_get_order_item_totals($order, $vendor->term_id);
              if ($totals) {
                  foreach ($totals as $total_key => $total) {
                      ?><tr>
                          <th scope="row" colspan="2" style="text-align:left; border: 1px solid #eee;"><?php echo $total['label']; ?></th>
                          <td style="text-align:<?php echo $text_align; ?>; border: 1px solid #eee;"><?php echo $total['value']; ?></td>
                      </tr><?php
                  }
              }
              if ( $order->get_customer_note() ) {
                  ?>
                  <tr>
                      <th class="td" scope="row" colspan="2" style="text-align:<?php echo esc_attr( $text_align ); ?>;"><?php esc_html_e( 'Note:', 'woocommerce' ); ?></th>
                      <td class="td" style="text-align:<?php echo esc_attr( $text_align ); ?>;"><?php echo wp_kses_post( nl2br( wptexturize( $order->get_customer_note() ) ) ); ?></td>
                  </tr>
                  <?php
              }
              ?>
          </table>
          <?php
          }
          if (apply_filters('show_cust_address_field', true, $vendor->id) || apply_filters( 'is_vendor_can_see_customer_details', true, $vendor->id, $order ) ) {
          ?>
          <h2><?php _e('Customer Details', 'dc-woocommerce-multi-vendor'); ?></h2>
          <?php if ($order->get_billing_email()) { ?>
              <p><strong><?php _e('Customer Name:', 'dc-woocommerce-multi-vendor'); ?></strong> <?php echo $order->get_billing_first_name() . ' ' . $order->get_billing_last_name(); ?></p>
              <p><strong><?php _e('Email:', 'dc-woocommerce-multi-vendor'); ?></strong> <?php echo $order->get_billing_email(); ?></p>
          <?php } ?>
          <?php if ($order->get_billing_phone()) { ?>
              <p><strong><?php _e('Telephone:', 'dc-woocommerce-multi-vendor'); ?></strong> <?php echo $order->get_billing_phone(); ?></p>
          <?php
              }
          }
          ?>
          <table id="addresses" cellspacing="0" cellpadding="0" style="width: 100%; vertical-align: top; margin-bottom: 40px; padding:0;" border="0">
      	<tr>
                  <?php if (apply_filters('show_cust_billing_address_field', true, $vendor->id)) { ?>
                  <td style="text-align:<?php echo $text_align; ?>; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif; border:0; padding:0;" valign="top" width="50%">
                      <h2><?php _e( 'Billing Address', 'dc-woocommerce-multi-vendor' ); ?></h2>
                      <address class="address">
                          <?php echo ( $address = $order->get_formatted_billing_address() ) ? $address : esc_html__( 'N/A', 'woocommerce' ); ?>
                      </address>
                  </td>
                  <?php } ?>
                  <?php if ( apply_filters('show_cust_shipping_address_field', true, $vendor->id) && ! wc_ship_to_billing_address_only() && $order->needs_shipping_address() && ( $shipping = $order->get_formatted_shipping_address() ) ) : ?>
                      <td style="text-align:<?php echo $text_align; ?>; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif; padding:0;" valign="top" width="50%">
                              <h2><?php _e('Shipping Address', 'dc-woocommerce-multi-vendor'); ?></h2>
                              <address class="address"><?php echo $shipping; ?></address>
                      </td>
                  <?php endif; ?>
      	</tr>
          </table>
      
      <?php do_action('wcmp_email_footer'); ?>
      Copy

      Regards,

      • #115447
        cardex107
        Participant

        Hello! thanks for your help @abhirup, works very good the email template.

    • #115436
      This reply has been marked as private.
    • #116032

      Thank you, based on your confirmation we are marking this thread closed.

Viewing 3 reply threads

The topic ‘Hide Commission in Order details error’ is closed to new replies.