Assuming you would put this in a woocommerce template file, wherever you want it to display:
<?php
global $product;
$regular_price = esc_attr( $product->get_display_price() );
$discount = 20;
$currency = esc_attr( get_woocommerce_currency() );
$new_price = ($regular_price * $discount) / 100;
echo 'Get this product for '.$new_price.$currency.' with (Promo code)';
?>
Untested, but should do the trick.
Related Posts:
- How do I display a user’s previous orders as a select box option on a product?
- How to call a PHP function from Javascript in WordPress
- How to automatically apply woocommerce product title to all product images alt tags?
- How to preserve PHP modifications while upgrading WordPress?
- How to get the original price of the product in woocommerce?
- Woocommerce auto cancel On-Hold after X days
- Calling a method from functions.php on a click of a button
- How to use WordPress (PHP) functions in AngularJS partials files?
- WooCommerce – Customer Order History Pagination
- The values of custom fields are not available functions.php
- Output a WooCommerce product custom field in WooCommerce using get_post_meta()
- using woocommerce_template_single_add_to_cart in shop-loop – javascript issues [closed]
- Use is_product_category() properly
- How to make custom total price reactive in navigation
- Adding tawk.to code just before body tag on functions.php file
- How do I fetch all comments per post via WP REST API?
- Slide in Panel WordPress Post
- Changing Woocommerce flat rate every nth number of items
- How to prevent those PHP variables from being cached on WordPress?
- Limiting woocommerce line_total decimal length
- How do you add customer capability after Woocommerce purchase?
- Trigger popup in a php if/else statement
- Image as Sales Badge
- Populate dropdown with Child Pages based on Parent Page chosen
- remove wp floating submenu in wp dashboard
- Two Different Links for Same Product – WooCommerce [closed]
- How to complete two other input fields, completed the first
- Auto-update products after they were published – Woocommerce
- JS file work only in index page
- Display a specific category of products in shop page and disable code for specific actions
- Woocommerce related product text
- Is it possible to intercept all ajax requests and get the parameters and the returns?
- How can I get the values of my WordPress $wpdb query in Jquery?
- Incorrect amount of posts returned when filtering related Woo products by custom taxonomy
- Validation algorithm in checkout field
- My new button is in the wrong place
- Redirect to another page using contact form 7? [closed]
- Tell WP register script to load a script only when the entire page is loaded
- require_once() if a product in woocommerce contains a tag [closed]
- Add product to cart for user – WC()->cart->add_to_cart [closed]
- How do I change this function from two returns to one string to show sku and dimensions in WooCommerce cart?
- woocommerce specific quantities for product
- Personalize checkout text
- CSS change in woo commerce Place Order Text [closed]
- Why i can’t get custom fields value or post ID via Ajax?
- WP All Import / Update stock quantity from multiple XML files
- woocommerce related product title length
- Changing the order of custom fields in the dashboard for Woocommerce variable products [closed]
- Custom Taxonomy Select Menu: Setting default option value?
- Modify WooCommerce used to get all orders in dashboard
- Output product category link from WP_Query
- Time Delay a URL Redirect for Specific Page
- Variation prices breakdown only for single product page
- Woocommerce My acount page
- Woocommerce disable order item link (backend) [closed]
- Cannot find the php_ini configuration file to find my error log to see why my code is not working
- Adding HTML Code to Replace Text in PHP
- Billing detail page doesn’t work after I’ve changed the order of the Woocommerce navigation
- Run a sql (update) after 12 hours after the user login. Woocommerce users
- Hide payment method based on user role AND minimum cart value
- Best way to use variables in multiple functions?
- Trying to add some custom text into WordPress Post title via function.php
- Update $wpdb query with AJAX
- Discount in the specific product title using keyword ( Woocoommerce )
- Using Javascript On Page – Header and Footer Now Missing
- Woocommerce – if selected attribute term equals
- split 1 cart item into instock and back ordered
- AJAX to add to cart multiple products woocommerce
- Adding product permalink on admin order page throwing error
- Adding extra data to shortcode attributes and pass it to JS with wp_localize_script
- Add Product Permalink in woocommerce admin order page
- How to override WooCommerce Order Item Meta with data from Cart?
- sessionStorage saves input value in browser but it is not loaded in the form field
- Woocommerce textarea format ignored
- How do I make comment-reply-button with that takes to comment reply form on click
- custom post type column countdown
- How to call a function from functions.php with ajax?
- WordPress load javascript file if something… (after the page is loaded)
- Automatically refresh page if widget is added to page?
- wordpress all post filter by year
- Add missing alt tag to featured images for “storefront” theme
- Use WP_Query Data In Cookie
- Woocommerce Price Text
- Help with my first Metabox helper class
- How to get the rating value of each comment
- Add specific phrase after every product title including the discounted price? [closed]
- How to add margin underneath woocommerce total price amount -> productpages
- Trouble figuring out how to get my button to submit comment
- Setting WooCommerce currency programmatically
- Woocommerce – Shipping tax class based on cart items not using the highest tax available
- Adding a script & php to functions.php
- WooCommerce – Show ‘Sales’ badge on variable products where only some variations have sales price [closed]
- posts_clauses drop ACF get_field function
- Replace the image of a product with its video in the shop page
- Remove Woocommerce product from cart with ajax/fetch
- Automatically change insurance quantity based on cart total [closed]
- How call WordPress shortcode inside function file
- strict custom php script on specific product category [closed]
- WooCommerce Modal Fly cart on add to cart – With AJAX
- hiddenQuestions.find is not a function