WooCommerce - excelling eCommerce
[resolved] Replace Price with link (3 posts)

  1. pulsewebdesigns
    Posted 2 years ago #

    On the product page, the item name displays, and underneath the price of the lowest cost variation displays (right above the product description). I would like to replace the displayed price with a link to request a sample instead. Does anyone have any idea how I might accomplish this please?

    Example: http://www.budgetusb.com/product/connecticut/


  2. pulsewebdesigns
    Posted 2 years ago #

    I've got this half figured out now...

    I can remove the displayed price using the code remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 10 ); in my functions.php file

    Now if someone could tell me what I need to stick in there to echo a link I'd be extremely grateful. Thanks!!

  3. pulsewebdesigns
    Posted 2 years ago #

    For anyone who stumbles across this, I achieved what I was looking for with the code:

    function woocommerce_template_single_price(){
      echo '<a href="#">Request a sample</a>';

    There's probably another way to do it, but since I don't care about reusing the $price variable this worked well for me.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WooCommerce - excelling eCommerce
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.