项目成本显示项目总价WooCommerce

时间:2019-05-02 10:31:17

标签: php wordpress woocommerce price

我遇到一个奇怪的问题。 如果我在WooCommerce网站的后端查看了一个已下达的订单,则item-cost显示的价格与商品总价相同,而item-total乘以quantity并得出减去BTW 21%

查看此链接(对不起,我无法发布图片): https://i.ibb.co/g9k9jdL/Schermafbeelding-2019-05-02-om-12-20-33.png

  • Linea antrociet的item-total 15x15x60 = € 365,70,-
  • item-cost显示相同的价格,而item-cost = € 2,95,-

€ 365,70 = (2,95 x 150) - 76,80的项目总数。

因此,列'Kosten'需要显示2,95而不是365,70。 熟悉此错误/问题的人吗?

使用的代码段:

//Prijs op een andere plek
remove_action('woocommerce_single_product_summary', 'woocommerce_template_single_price', 10 );
add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 29 );

//Titel boven productafbeelding
remove_action('woocommerce_single_product_summary', 'woocommerce_template_single_title', 5 );
add_action( 'woocommerce_before_single_product_summary', 'woocommerce_template_single_title', 5 );

//Vorige knop op productpagina
add_action( 'woocommerce_single_product_summary', 'woocommerce_single_product_summary_button', 11);

//Product extra informatie onder productfoto
add_action( 'woocommerce_product_thumbnails', 'woocommerce_output_product_data_tabs', 40 );

//Text email met betalings
add_action( 'woocommerce_email_before_order_table', 'add_order_email_instructions', 10, 2 );

//Verwijderen straat 2
add_filter( 'woocommerce_checkout_fields' , 'custom_remove_woo_checkout_fields' );

function custom_remove_woo_checkout_fields( $fields ) 
{
    // remove billing fields
    unset($fields['billing']['billing_address_2']);

    // remove shipping fields 
    unset($fields['shipping']['shipping_address_2']);

    return $fields;
}

//Beschikbaar maken factuur administrator
function bbloomer_paypal_enable_manager( $available_gateways ) {
global $woocommerce;
if ( (isset( $available_gateways['cheque'] ) && !current_user_can('administrator')) || (isset( $available_gateways['cod'] ) && !current_user_can('administrator'))  ) 
{
    unset( $available_gateways['cheque'] );
    unset( $available_gateways['cod'] );
} 

return $available_gateways;
}

add_filter( 'woocommerce_available_payment_gateways', 'bbloomer_paypal_enable_manager' );

add_filter( 'woocommerce_get_availability', 'custom_override_get_availability', 1, 2);

0 个答案:

没有答案