我沒有太多的PHP經驗,並想知道是否有人可以幫我從Woocommerce的thankyou.php模板中取消註釋幾行:https://github.com/woocommerce/woocommerce/blob/master/templates/checkout/thankyou.php。我需要刪除命令細節起始行43-77:Uncommenting Woocommerce模板
<ul class="woocommerce-order-overview woocommerce-thankyou-order-details order_details">
<li class="woocommerce-order-overview__order order">
<?php _e('Order number:', 'woocommerce'); ?>
<strong><?php echo $order->get_order_number(); ?></strong>
</li>
<li class="woocommerce-order-overview__date date">
<?php _e('Date:', 'woocommerce'); ?>
<strong><?php echo wc_format_datetime($order->get_date_created()); ?></strong>
</li>
<li class="woocommerce-order-overview__total total">
<?php _e('Total:', 'woocommerce'); ?>
<strong><?php echo $order->get_formatted_order_total(); ?></strong>
</li>
<?php if ($order->get_payment_method_title()) : ?>
<li class="woocommerce-order-overview__payment-method method">
<?php _e('Payment method:', 'woocommerce'); ?>
<strong><?php echo wp_kses_post($order->get_payment_method_title()); ?></strong>
</li>
<?php endif; ?>
</ul>
<?php endif; ?>
<?php do_action('woocommerce_thankyou_' . $order->get_payment_method(), $order->get_id()); ?>
<?php do_action('woocommerce_thankyou', $order->get_id()); ?>
感謝您的幫助!
你所說的 「取消註釋」 是什麼意思?您的代碼中沒有評論。 – schroedingersKat
我不明白是什麼問題。如果你想刪除/評論模板的一部分,你可以從原始文件中刪除/評論html(就像你已經做過的那樣)。然後你只需要把這個文件放在path-to-your-theme-folder/woocommerce/checkout/thankyou.php文件中,它就會有效(如果文件夾不存在就創建文件夾) – Kaddath
你想要的東西(部分)從你的模板中刪除?你能描述更多嗎? – Alice