How to display single product price in HTML page? (5 posts)

  1. JustBlog
    Posted 1 year 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?



  2. lorro
    Posted 1 year 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
    Posted 1 year 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.


  4. lorro
    Posted 1 year 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
    Posted 1 year 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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WooCommerce
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic