Support » Plugin: Germanized for WooCommerce » Doesn’t allow to edit template/review-order.php

  • Resolved Una

    (@unigunde)


    I need to add new columns in WooCommerce checkout order review table. I want the table to have Product column, Price column, Quantity column, and Total column.

    I copied file review-order.php into my child theme and added two new table columns td class=”product-price” and td class=”product-quantity” in the woocommerce-checkout-review-order-table table.

    <tr class="<?php echo esc_attr( apply_filters( 'woocommerce_cart_item_class', 'cart_item', $cart_item, $cart_item_key ) ); ?>">
    <td class="product-name">
    <?php echo apply_filters( 'woocommerce_cart_item_name', $_product->get_name(), $cart_item, $cart_item_key ) . '&nbsp;'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
    <?php echo apply_filters( 'woocommerce_checkout_cart_item_quantity', ' <strong class="product-quantity">' . sprintf( '&times; %s', $cart_item['quantity'] ) . '</strong>', $cart_item, $cart_item_key ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
    <?php echo wc_get_formatted_cart_item_data( $cart_item ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
    </td>
    
    <td class="product-price">
    <?php echo $_product->get_price_html();  
    ?>
    </td>
    
    <td class="product-quantity">
    <?php echo apply_filters( 'woocommerce_checkout_cart_item_quantity', ' <strong class="product-quantity">' . sprintf( '&times; %s', $cart_item['quantity'] ) . '</strong>', $cart_item, $cart_item_key ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
    </td>
    
    <td class="product-total">
    <?php echo apply_filters( 'woocommerce_cart_item_subtotal', WC()->cart->get_product_subtotal( $_product, $cart_item['quantity'] ), $cart_item, $cart_item_key ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
    </td>
    </tr>

    when I have your plugin enabled, the new columns doesn’t show up, when I disable it, all is showing like it should be.

Viewing 1 replies (of 1 total)
  • Plugin Author vendidero

    (@vendidero)

    Hi there,

    Germanized adjusts the review-order-table via filter and adds an additional template (specifically for the product table) to comply to the button solution. You may find the original template in:
    wp-content/plugins/woocommerce-germanized/templates/checkout/review-order-product-table.php

    and you may override that template in:
    my-child-theme/woocommerce-germanized/checkout/review-order-product-table.php

    Cheers

Viewing 1 replies (of 1 total)
  • The topic ‘Doesn’t allow to edit template/review-order.php’ is closed to new replies.