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?
- Edit tag cloud widget number
- How to call a PHP function from Javascript in WordPress
- How to automatically apply woocommerce product title to all product images alt tags?
- WordPress Infinite Scroll without using any plugin
- 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
- Hide a menu-item and its submenus and display a ‘Log in’ link if the user is logged out
- How to use WordPress (PHP) functions in AngularJS partials files?
- 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]
- Output a WooCommerce product custom field in WooCommerce using get_post_meta()
- 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
- using woocommerce_template_single_add_to_cart in shop-loop – javascript issues [closed]
- How to add SVG icon above product tab title
- javaScript in section of WP API
- Use is_product_category() properly
- How to speed up admin-ajax.php in wordpress
- My Own layout in WooCommerce pages [closed]
- Woocommerce – remove product from category
- 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?
- WooCommerce – Reset quantity input field when variation changes
- get current product name in functions.php
- Trigger popup in a php if/else statement
- Image as Sales Badge
- 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
- 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
- Status 400 for AJAX POST Request with admin-ajax.php
- 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
- Display a specific category of products in shop page and disable code for specific actions
- 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?
- WooCommerce: How can I get orders with a custom ID in order meta data object?
- dynamic dependent select dropdown
- How can I get the values of my WordPress $wpdb query in Jquery?
- Ajax load more button for comments wordpress
- 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]
- 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
- Tell WP register script to load a script only when the entire page is loaded
- Discount in the specific product title using keyword ( Woocoommerce )
- Including user data in “new user notification email”
- 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 to auto-generate random numbers in username?
- Remove generated category and tag class names from woocommerce product & blog listings markup
- 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]
- 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]
- I got this error POST https://localhost/meraboilerwp/[object%20Object] 404 (Not Found)
- Retrive the value of the Active variation of the product and then link it to the “read more” to dynamically change
- Woocommerce product search result page layout
- How to change product title color in shop page if product has specific product tag (Woocommerce)?
- How to capture number input from wordpress form into acf field in woocommerce
- How to add icon to WooCommerce add to cart button
- How to get default variation ID (woocommerce)
- Assign a value (got from an xml file) to an attribute of Woocommerce products
- Custom PHP contact form issue