Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Removes the price suffix appended to the product prices by the Subscriptions plugin, when
- * the Cache Handler is fetching the updated prices via Ajax. This prevents the issue of having
- * a duplicate price suffix displayed on the page.
- */
- add_filter('woocommerce_subscriptions_product_price_string', function($subscriptions_product_price_string) {
- // If we're processing the "fetch prices" call from the Cache Handler, remove the price suffix that
- // the Subscriptions plugin forcibly appends to the HTML that shows the price, so that it won't be
- // displayed twice
- if(defined('DOING_AJAX') && (($_REQUEST['action'] ?? '') === 'woocommerce_cache_handler_ajax') && ($_REQUEST['exec'] === 'get_product_prices_html')) {
- $subscriptions_product_price_string = '';
- }
- return $subscriptions_product_price_string;
- }, 99);
Advertisement
Add Comment
Please, Sign In to add comment