• Resolved kvandelaak

    (@kvandelaak)


    Hi,

    I would like to add a total items field in my-cart checkout page.
    Now I only get the subtotal, total price but not the total amount of items people added.

    Looked everywhere but can’t seem to find it.

    Anyone know a css code for this?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support Grigorij S. a11n

    (@grigaswp)

    Hi there,

    This isn’t something that can be achieved with CSS code, however if you are confident about your PHP skills – here are two code snippets that might be helpful.

    I’d have to warn you that it is easy to break your site by editing php files, so make sure to create a backup copy (at least backups of files you are editing).

    Thread Starter kvandelaak

    (@kvandelaak)

    Thanks @grigaswp. I tried your solution and I did get some result but I didn’t get it in the subtotal summary.
    https://www.monkdesigns.co.za/my-cart/

    I would like to see a item quantity in the subtotals.

    Any idea?

    Plugin Support Grigorij S. a11n

    (@grigaswp)

    Hi once again!

    In that case, may I suggest using a hook or a filter to insert that data into the checkout area? form-checkout.php may be the file where you’d want to introduce these changes.

    Thread Starter kvandelaak

    (@kvandelaak)

    How do I do that?:-)

    Plugin Support Grigorij S. a11n

    (@grigaswp)

    Sorry for the delay.

    Here’s something I was able to dig out:

    You may want to override the cart-totals.php template file.

    This is the code:

    <tr class="cart-subtotal">
        <th><?php _e( 'Product Quantity', 'woocommerce' ); ?></th>
        <td><?php global $woocommerce; ?><?php echo sprintf(_n('%d', '%d', $woocommerce->cart->cart_contents_count, 'woocommerce'), $woocommerce->cart->cart_contents_count);?></td>
    </tr>

    The code should be added to child theme functions.php or via code snippets plugin.

    https://themezee.com/docs/how-to-override-template-files/

    We haven’t heard back from you in a while, so I’m going to mark this as resolved. If you have any further questions, you can start a new thread.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Total items on checkout page’ is closed to new replies.