V
V
VPVPVP2020-09-22 10:45:20
WooCommerce
VPVPVP, 2020-09-22 10:45:20

How to display the price of the selected woocommerce variation on a custom page?

In general, I displayed the products on the page, something came out like a category page, but with its own template.
On the same page there is a block with a choice of quantity, a choice of variations and a buy button. What php code can display the price for the selected variation? Now I have there the usual price is displayed
<?php woocommerce_template_loop_price(); ?>in this way. In general, what to change this php to display the price for the variation that the person chose

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pychev Anatoly, 2020-09-22
@pton

If I understood correctly, then you have an archive page with a lot of different products, and a block for choosing variations.
And you want the user to first select a product on the page, and then select the desired variation in the block.
If so, then fom needs to load a variation selection form similar to the one displayed on the product page (in the product card), and their scripts.
For example, look at how the price is displayed in the product card.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question