Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php // only copy this line if needed
- /**
- * Hide the unit price from the top of the product page
- * for Measurement Calculator products
- */
- function sv_wc_measurement_price_calculator_hide_unit_price() {
- global $product;
- // bail if the calculator isn't active or this isn't a product page
- if ( ! class_exists( 'WC_Price_Calculator_Product' ) || ! is_product() ) {
- return;
- }
- $measurement = WC_Price_Calculator_Product::calculator_enabled( $product );
- // if the calculator is enabled, hide unit price
- if ( $measurement ) {
- echo '<style> .wc-measurement-price-calculator-price .woocommerce div.product p.price { display: none !important; } </style>';
- }
- }
- add_action( 'wp_print_footer_scripts', 'sv_wc_measurement_price_calculator_hide_unit_price' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement