Web Hosting
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

WordPress fix Reply To: WooCommerce Customization

Discussion in 'Misc WordPress Requests' started by Benjamin Rothman, Nov 1, 2017.

  1. Benjamin Rothman

    Guest

    Reply To: WooCommerce Customization, by Benjamin Rothman

    Yes:


    <?php
    //don't copy above opening tag if pasting into functions.php
    //Add in text after price to certain products
    function themeprefix_custom_price_message( $price ) {

    global $post;

    $product_id = $post->ID;
    $my_product_array = array( 799,796,792 );//add in product IDs
    if ( in_array( $product_id, $my_product_array )) {
    $textafter = '( Upfront Paid in Full Price )'; //add your text
    return $price . '<br /><span class="price-description">' . $textafter . '</span>';
    }

    else {
    return $price;
    }
    }
    add_filter( 'woocommerce_get_price_html', 'themeprefix_custom_price_message' );

    Reply To: WooCommerce Customization
     
    #1

Share This Page

Web Hosting