WordPress.org

Forums

WooCommerce - excelling eCommerce
How to display single product price in HTML page? (5 posts)

  1. JustBlog
    Member
    Posted 11 months ago #

    I would like to get few products' pricing on the product page (HTML). How can i retrieve and display them in the HTML page?

    Thanks!

    https://wordpress.org/plugins/woocommerce/

  2. lorro
    Member
    Posted 11 months ago #

    Hi, Have a look at WooCommerce shortcodes. For example, the shortcode for a single product is:
    [product id="99"]
    where id is the product id. This is the post= value in the url for the product edit page.

  3. JustBlog
    Member
    Posted 11 months ago #

    Hi Iorro,

    Thanks for showing it!

    What if I want to show only the name and price of the product and the product is set to be hidden? Cos I don't want to show it on the shop. Only show it within the specific product.

    Thanks!

  4. lorro
    Member
    Posted 11 months ago #

    I think if a product is hidden then WooCommerce won't show it. It will be more straightforward to add the title and price manually as text on the page, not linked to WooCommerce.

  5. JustBlog
    Member
    Posted 11 months ago #

    If i put the [add_to_cart id="99"], it will show the price and add to cart button even though it is hidden.

    The reason why I want to have shortcode is that when there's a promo, i do not need to change them 1 by 1.

Reply

You must log in to post.

About this Plugin

About this Topic