[Support request] show product price

Please login to receive premium support.

Support for the free plugin can be found here.

Home Forums Pro Support show product price

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #27625
    Bizhan
    Participant

    Hello
    How is it possible to show product price in a custom Post Lists content ( Post type : product ) ?

    Regards

    #28393
    Bizhan
    Participant

    Or in “Read more text”
    Any idea?

    #28430
    elvin
    Moderator

    Hi Bizhan,

    It’s possible with PHP snippets.

    You’ll need get_price() to get the price (assuming you’re using woocommerce) and the hook wpsp_after_content

    Example:

    add_action('wpsp_after_content',function(){
    echo '<span class="price">'.get_price().'</span>';
    }, 10);

    This will display after the excerpt. Or after the read more button if have one.

    If you want it to display before the read more button, change the priority from 10 to anything lower than 5.

    Note: While this is doable, WPSP isn’t recommended for displaying product in this manner.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.