The PHP/WP functions for the single product page refactored