K
K
krozeal2018-06-27 21:36:00
WordPress
krozeal, 2018-06-27 21:36:00

Where in woocommerce is the variable with the value "Subtotal" stored on the cart page?

I am making a shipping calculation calculator for cash on delivery by mail on the wordpress + woocommerce site. I would like to know how to display the value of the "Subtotal" line, which is indicated on the delivery page, on an arbitrary page? The post office charges a percentage of the total cost of the ordered goods, and now I wanted to somehow get the total cost of the goods and continue to use it in the calculator. Thanks in advance!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Mr Crabbz, 2018-06-27
@krozeal

First link on google: https://stackoverflow.com/questions/37664203/subto...

<?php 

echo WC()->cart->subtotal;
// Or
echo WC()->cart->get_cart_subtotal();

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question