Answers for "product title with price in product page hook"

0

product title with price in product page hook

remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_title', 5 );
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 10 );

function show_title_with_price()
{
    global $product;
    $title = $product->get_title();
    $price = $product->get_regular_price();
    $symbol = get_woocommerce_currency_symbol();

    //You may change <p> tag or add any inline CSS here.
    echo "<p>$title: $symbol $price</p>";
}

add_action( 'woocommerce_single_product_summary', 'show_title_with_price', 5 );
Posted by: Guest on January-03-2021

Code answers related to "product title with price in product page hook"

Browse Popular Code Answers by Language