|
216 | 216 | ?> |
217 | 217 | </td> |
218 | 218 | <td><?php echo esc_html( $item->get_quantity() ); ?></td> |
219 | | - <td><?php |
220 | | - $tax_display = get_option( 'woocommerce_tax_display_cart' ); |
221 | | - if ( 'excl' === $tax_display ) { |
222 | | - echo wp_kses_post( wc_price( $item->get_subtotal() / $item->get_quantity() ) ); |
223 | | - } else { |
224 | | - echo wp_kses_post( wc_price( $item->get_subtotal_tax() / $item->get_quantity() + $item->get_subtotal() / $item->get_quantity() ) ); |
225 | | - } |
226 | | - ?></td> |
227 | | - <td><?php |
228 | | - $tax_display = get_option( 'woocommerce_tax_display_cart' ); |
229 | | - if ( 'excl' === $tax_display ) { |
230 | | - echo wp_kses_post( wc_price( $item->get_total() ) ); |
231 | | - } else { |
232 | | - echo wp_kses_post( wc_price( $item->get_total() + $item->get_total_tax() ) ); |
233 | | - } |
234 | | - ?></td> |
| 219 | + <td><?php echo \is_object( $product ) && method_exists( $product, 'get_price' ) ? wp_kses_post( wc_price( $product->get_price() ) ) : ''; ?></td> |
| 220 | + <td><?php echo wp_kses_post( wc_price( $item->get_total() ) ); ?></td> |
235 | 221 | </tr> |
236 | 222 | <?php } ?> |
237 | 223 | </tbody> |
238 | 224 | <tfoot> |
| 225 | + <tr> |
| 226 | + <th colspan="3"><?php esc_html_e( 'Subtotal', 'woocommerce' ); ?></th> |
| 227 | + <td><?php echo wp_kses_post( wc_price( $order->get_subtotal() ) ); ?></td> |
| 228 | + </tr> |
239 | 229 | <?php if ( $order->get_shipping_total() > 0 ) { ?> |
240 | 230 | <tr> |
241 | 231 | <th colspan="3"><?php esc_html_e( 'Shipping', 'woocommerce' ); ?></th> |
242 | | - <td><?php |
243 | | - if ( 'excl' === $tax_display ) { |
244 | | - echo wp_kses_post( wc_price( $order->get_shipping_total() ) ); |
245 | | - } else { |
246 | | - echo wp_kses_post( wc_price( $order->get_shipping_total() + $order->get_shipping_tax() ) ); |
247 | | - } |
248 | | - ?></td> |
| 232 | + <td><?php echo wp_kses_post( wc_price( $order->get_shipping_total() ) ); ?></td> |
249 | 233 | </tr> |
250 | 234 | <?php } ?> |
251 | 235 | <?php foreach ( $order->get_fees() as $fee ) { ?> |
252 | 236 | <tr> |
253 | 237 | <th colspan="3"><?php echo esc_html( $fee->get_name() ); ?></th> |
254 | | - <td><?php |
255 | | - if ( 'excl' === $tax_display ) { |
256 | | - echo wp_kses_post( wc_price( $fee->get_total() ) ); |
257 | | - } else { |
258 | | - echo wp_kses_post( wc_price( $fee->get_total() + $fee->get_total_tax() ) ); |
259 | | - } |
260 | | - ?></td> |
| 238 | + <td><?php echo wp_kses_post( wc_price( $fee->get_total() ) ); ?></td> |
261 | 239 | </tr> |
262 | 240 | <?php } ?> |
263 | 241 | <?php if ( $order->get_total_discount() > 0 ) { ?> |
264 | 242 | <tr> |
265 | 243 | <th colspan="3"><?php esc_html_e( 'Discount', 'woocommerce' ); ?></th> |
266 | | - <td><?php |
267 | | - // Discounts are always displayed as positive numbers |
268 | | - if ( 'excl' === $tax_display ) { |
269 | | - echo wp_kses_post( wc_price( $order->get_total_discount( false ) ) ); |
270 | | - } else { |
271 | | - echo wp_kses_post( wc_price( $order->get_total_discount( true ) ) ); |
272 | | - } |
273 | | - ?></td> |
| 244 | + <td><?php echo wp_kses_post( wc_price( $order->get_total_discount() ) ); ?></td> |
274 | 245 | </tr> |
275 | 246 | <?php } ?> |
276 | | - <?php if ( wc_tax_enabled() ) : ?> |
| 247 | + <?php if ( wc_tax_enabled() ) { ?> |
277 | 248 | <?php if ( 'itemized' === get_option( 'woocommerce_tax_total_display' ) ) { ?> |
278 | 249 | <?php foreach ( $order->get_tax_totals() as $code => $tax ) { ?> |
279 | 250 | <tr> |
|
287 | 258 | <td><?php echo wp_kses_post( wc_price( $order->get_total_tax() ) ); ?></td> |
288 | 259 | </tr> |
289 | 260 | <?php } ?> |
290 | | - <?php endif; ?> |
| 261 | + <?php } ?> |
291 | 262 | <tr> |
292 | 263 | <th colspan="3"><?php esc_html_e( 'Total', 'woocommerce' ); ?></th> |
293 | 264 | <td><?php echo wp_kses_post( wc_price( $order->get_total() ) ); ?></td> |
|
0 commit comments