Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

get product price by id woocommerce snippet

/**
 * Get product price by product ID.
 */
function wc_get_product_price( $product_id ) {
    return ( $product = wc_get_product( $product_id ) ) ? $product->get_price() : false;
}
Source by wpfactory.com #
 
PREVIOUS NEXT
Tagged: #product #price #id #woocommerce #snippet
ADD COMMENT
Topic
Name
2+1 =