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 automatically apply woocommerce product title to all product images alt tags?
- WordPress Infinite Scroll without using any plugin
- Woocommerce auto cancel On-Hold after X days
- WooCommerce – Customer Order History Pagination
- Cleanest/Fastest way to avoid calling and retrieving data from the database multiple times?
- The values of custom fields are not available functions.php
- Understanding WordPress child theme custom JS loading
- WooCommerce – Display variation custom field value [closed]
- Woocommerce: Is it possible to overide the settings for allowing to purchase out of stock products [closed]
- Woocommerce HTML email option unavailable
- Click loads template via ajax
- How to add SVG icon above product tab title
- javaScript in section of WP API
- Use is_product_category() properly
- 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
- Limiting woocommerce line_total decimal length
- WooCommerce – Reset quantity input field when variation changes
- Use menu link or onClick to set a variable
- Automatically remove a canceled order in Woocommerce
- Populate dropdown with Child Pages based on Parent Page chosen
- How can I apply_filters from inside a function?
- Pass Category Name, Description and Photo into variables to pass to jQuery
- Auto-update products after they were published – Woocommerce
- JS file work only in index page
- Woocommerce related product text
- Woocommerce: hook action/filter I could use to add variation id and price with each attribute opt on WooCommerce Rest api
- Is it possible to intercept all ajax requests and get the parameters and the returns?
- dynamic dependent select dropdown
- Ajax load more button for comments wordpress
- Incorrect amount of posts returned when filtering related Woo products by custom taxonomy
- How to add specific meta tags to head of cart and checkout pages in woocommerce?
- Noscript not working as it should in wordpress site
- get taxonomy thumbnail and use it as a variable in code
- Remove item in Checkout
- 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
- How to reference PHP in Javascript
- How do i wrap woocomerce attribute in list?
- Removing files programmatically
- Custom Taxonomy Select Menu: Setting default option value?
- Execute PHP code only with specific user role
- Woocommerce order status payment
- Modify WooCommerce used to get all orders in dashboard
- WordPress User Meta value variable into Google Gauge Chart
- Creating a brand attribute as a variable
- Woocommerce My acount page
- Woocommerce – Exclude variation attribute on specific variation
- Cannot find the php_ini configuration file to find my error log to see why my code is not working
- PHP function for horizontal Woocommerce thumbnails and badges
- Gutenberg block don’t save rich text content
- php code for outputting a custom page in my account
- Hide specific shipping methode depending on day and time of day
- Programmatically add a product to the cart and set price to zero when buying from certain category
- I want to show cart items number if any or nothing, simple CART text
- Adding custom field to product category and show it to shop/category shop page
- Hide payment method based on user role AND minimum cart value
- WooCommerce display price before add to cart [closed]
- Remove span tags from WooCommerce Downloads page
- Trying to add some custom text into WordPress Post title via function.php
- Update $wpdb query with AJAX
- Including user data in “new user notification email”
- Using Javascript On Page – Header and Footer Now Missing
- AJAX to add to cart multiple products woocommerce
- Adding extra data to shortcode attributes and pass it to JS with wp_localize_script
- Add Product Permalink in woocommerce admin order page
- sessionStorage saves input value in browser but it is not loaded in the form field
- How to auto-generate random numbers in username?
- Remove generated category and tag class names from woocommerce product & blog listings markup
- How do I make comment-reply-button with that takes to comment reply form on click
- WP_Query To Display Product Of Brand On Taxonomy Page
- Woocommerce Add custom “Add to cart button” in single page with tags
- How to echo a PHP code into WooCommerce variation product?
- Get Billing Email from WooCommece Checkout and Pass to Fullstory JS
- How to call a function from functions.php with ajax?
- Custom Post type Ajax search results
- WordPress load javascript file if something… (after the page is loaded)
- Find the method which AJAX GET calls
- How to add margin underneath woocommerce total price amount -> productpages
- how can I make content from a plugin hidden when user is logged in? [duplicate]
- Adding a script & php to functions.php
- How to hide .js files on wordpress website using php or wp plugins or any? [closed]
- Warning: Attempt to read property “term_id” on int – Woocommerce
- Hide child of parent categories already hidden with “get_terms_args” – Woocommerce
- Remove Woocommerce product from cart with ajax/fetch
- Automatically change insurance quantity based on cart total [closed]
- Change WooCommerce Order status from frontend form submitted data
- WooCommerce Modal Fly cart on add to cart – With AJAX
- Show Login Errors In WordPress/Elementor (Code “works”, but breaks site)
- hiddenQuestions.find is not a function
- Add text below WooCommerce short description if metabox value is true
- Calling a function via a shortcode in javascript
- Woocomerce custom add to cart button edit functionality [closed]
- Retrive the value of the Active variation of the product and then link it to the “read more” to dynamically change
- How to get default variation ID (woocommerce)
- Hide or Show Read More Button by Content Area