try it like this:
/**
* This code should be added to functions.php of your theme
**/
add_filter('woocommerce_variable_price_html', 'custom_variation_price', 10, 2);
function custom_variation_price( $price, $product ) {
$price="";
if ( !$product->min_variation_price || $product->min_variation_price !== $product->max_variation_price ) $price .= '<span class="from">' . _x('From', 'min_price', 'woocommerce') . ' </span>';
$price .= woocommerce_price($product->get_price());
if ( $product->max_variation_price && $product->max_variation_price !== $product->min_variation_price ) {
$price .= '<span class="to"> ' . _x('to', 'max_price', 'woocommerce') . ' </span>';
$price .= woocommerce_price($product->max_variation_price);
}
return $price;
}
Related Posts:
- A better way to override plugin’s JS files?
- Output before and after the loop
- Loading posts associated only to the logged in user on recent posts page
- Disable author pages for specific users
- How do you import members from another system to WordPress and update passwords so they’ll work?
- Get info (url) from already enqueued styles
- WordPress import does not fetch images, but just links them
- How to create custom LOGIN and REGISTRATION forms?
- wamp server wordprocess whole from begining up on filezilla
- Show the “ratingValue” and “ratingCount” values of KK Star Ratings Plugin
- bulk post_content update
- Retrieve categories of a WooCommerce product in hierachical order
- Dequeue / Deregister script and replace it with a new plugin
- Woocommerce cart is a non-object inside `admin_post` action [closed]
- How to use get_categories() with Event Organiser plugin
- Setting up widgets in wordpress with a unique ID for the after_title argument
- What are WordPress installation percentages by version?
- Dashboard Disappears after Upgrade
- Show a confirmation message on plugin deactivation
- How extend shortcode default values for a plugin?
- WooCommerce – Is is possible to replace downloadable file and allow existing customer to get it?
- The website has resulted in too many redirects (redirect plugin)?
- Hide Theme options and Customize Admin menu
- How to debug register_setting callback function
- WordPress redirect all 404 pages to the Homepage
- Assignments must be the first block of code on a line Validation Error on Travis
- Error 404 using wpml plugin
- I’m trying to update user meta but is always 1, What I doing wrong? [closed]
- Are these wp-content permissions safe?
- Disable all scripts and styles from NextGEN Gallery? [closed]
- Detect permalinks when passing querystring in REST API requests
- How to sanitize uploaded file filename from a plugin?
- Using WP Category Lists Plugin to Dynamically Display Category (PHP)
- Adding sections in the ‘Pages’ post type
- Single API call exposed via shortcode with params
- Force media library editor to overwrite the original filename?
- What would I need to write into a custom plugin in order to add a switch for a custom string of CSS to the edit page?
- WP_Error with multiple form validation message
- Using window.onload with Ubermenu
- Ordering taxonomies by rank
- My homemade plugin is trying to update to someone else’s plugin
- Is there a way to embed a Google Docs form in a page without using plugins?
- Advanced Custom Fields – Disable Users to Edit Custom Fields
- Retrieving links and names of images from a NextGEN gallery [closed]
- REST route from a plugin not working if WordPress is installed in a subdirectory
- Plugin development: what to prefix?
- Submit Form data to another page via Ajax (WordPress Way)
- Send email to multiple addresses on Contact Form 7, but exclude personal details on all but one
- Display site language setting in source code
- simple-job-board Plugin throws an error on live server [closed]
- How to return the values from a row where a value occurs for the first time among the rows available?
- ‘Notice: Undefined index’ error on plugins page [closed]
- Smarter navigation plugin and custom taxonomies
- How to embed a new string in url?
- Make 2 different WooCommerce checkout pages?
- Adding a pagenavi to function for displaying bookmarks
- google +1 like polling system
- A good heatmapping plugin for WordPress? (No 3rd-party services please) [closed]
- TN3 Plugin Not Working Under IIS / WebMatrix
- Including content from legacy app: via plugin or custom content?
- How to install a translation for a WP plugin?
- Plugin for TinyMCE to create reference to other posts
- What is the most efficient way of adding additional functionaliy for admin only
- XML Sitemap Generator and 404 problem
- How do I work with the SlideDeck plug-in?
- Why is adoptStyles-css stylesheet link added to every page?
- Add hook after content without formatting
- Sold out Label for variable products which are partially sold out
- User loggedin as Subscriber form not sending
- admin_post hook not firing function inside class
- Merging new theme and plugins from development site to production
- how to split and upload a theme on wordpress?
- Fatal error: require_once(): Failed opening required
- shortcodes not working [dt_carousel & [dt_fancy_image
- Load google font script based on optgroup label selected
- Unload a woff file from WordPress
- Crazy redirect happening with no redirects set up
- How To Use htaccess to Rewrite Link Structure for a Page that is Generated Programatcially
- Above the fold plugin error “The Proxy Cache directory contains n cache entries.”
- User / membership Plugin [closed]
- Fetching WP.me shortlinks for posts using WP Rest API
- How to display widget in front end?
- Shows warning when enable “wp_gallery_custom_links” plugin with Themify Builder
- WordPress environment not loading properly
- Where to store media uploaded by the plugin?
- Follow author on muti-user WordPress site
- Add a checkbox in plugin options page and make it actually work
- Integrating a hosted app with wordpress using the API
- WP_Query Date Filtering Inclusive Being Ignored
- is_plugin_active() not defined on active plugin, in the thumbnails.php file
- wordpress plugin | short code issue
- WordPress site keeps getting flagged as malware [closed]
- Am having issues intergrating this api into my wordpress site, any help please?
- wp_enqueue_script doesn’t load JS in plugin
- AI Code For OpenAI
- How to Deobfuscate a sourcecop protected WordPress plugin?
- How to get selected variation from URL?
- Change WordPress Username maxmimum length
- onSplit not create my custom block
- Widget saving but showing “waiting” animation [closed]