• Categories
    • PHP
    • phpMyAdmin
    • PHPMailer
    • FFMpeg
    • PHPEXcel
    • PHPDoc
    • PHPUnit
    • CakePHP
    • CakePHP 2.0
    • Cake PHP 2.1
    • CakePHP Model
    • Facebook PHP SDK
    • composer-php
    • PHP 7
    • PHP GD
    All Categories
  • About

Don't show recurring price for WooCommerce subscriptions worth 0$

phpwordpresswoocommercehook-woocommercewoocommerce-subscriptions


PHP Snippet 1:

add_filter('woocommerce_subscriptions_product_price_string', 'alter_woocommerce_subscriptions_product_price_string', 10, 3);

function alter_woocommerce_subscriptions_product_price_string($subscription_string, $product, $include) {
    if ($include['sign_up_fee']) {
        if (strpos($subscription_string, '0.00') !== false) {
            $subscription_string = explode('and a', $subscription_string);
            $subscription_string = $subscription_string[1];
        }
    }
    return $subscription_string;
}

Related Snippets

How to set time with DateTime modify?

Hide email address with stars (*)

Laravel/docker-compose/redis - Class 'Redis' not found

HTML + PHP + PHPMAILER

How do I set the maximum php memory limit

Google Calendar API batch request PHP

How to run a shell as root from php (apache)

woocommerce change position of price

run a query using EXECUTE BLOCK to prepair a column for an unique-Index

Elasticsearch - Want to sort by field in all indices where that particular field available or not if not then avoid it

Unable to get password for the instance created from AMI

Make Calculator - When Button clicked the No shows in Textbox.

Display specific shipping method if woocommerce product has specific acf field value

Woocommerce redirect after add-to-cart error

PHP - CURL using HTTPS [closed]

About Contact Privacy policy Terms and conditions