WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. pulsewebdesigns
    Member
    Posted 1 year 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/

    http://wordpress.org/extend/plugins/woocommerce/

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

About this Topic

Tags

No tags yet.