更换新订单后,出现内部服务器错误。帮我找出问题所在。/* 我修复了代码,但错误仍然存在,顺便说一句,如果我删除了至少一个 do_action,它会立即发出内部错误。*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
echo "= " . $email_heading . " =\n\n";
echo $order->get_formatted_billing_full_name() . "\n";
if ( $order->get_billing_address_2() ) {
echo $order->get_billing_address_1() . " " . $order->get_billing_address_2() . "\n";
} else {
echo $order->get_billing_address_1() . "\n";
}
echo $order->get_billing_phone() . "\n";
echo "---\n";
if ( $order->get_customer_note() ) {
echo "Комментарий\t " . wptexturize( $order->get_customer_note() ) . "\n";
echo "---\n";
do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email );
echo "---\n";
foreach ( $totals as $total ) {
if ($total['label'] == "Payment method") echo "Форма оплаты: " . "\t " . $total['value'] . "\n";
}
foreach ( $totals as $total ) {
if ($total['label'] == "Subtotal") echo "Сумма заказа: " . "\t " . $total['value'] . "\n";
}
foreach ( $totals as $total ) {
if ($total['label'] == "Shipping") echo "Доставка: " . "\t " . $total['value'] . "\n";
}
foreach ( $totals as $total ) {
if ($total['label'] == "Total") echo "Итого: " . "\t " . $total['value'] . "\n";
}
echo "---\n";
echo "Site.by";
至少 2 个语法错误。排队
“\n”之前没有点。
排队
额外的分号。
2017年在外面。停止使用记事本。给自己设置一个正常的开发环境,它会让你避免这样的错误。
错误出现在 php 代码中。谢谢大家。