• 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

Add customer email and phone in "Order" column to admin orders list on Woocommerce

Convert date and time to Jalali in Laravel

Xdebug in Laravel is not working with VSCode

Log file is not being written in Laravel 5.5

Parameter is not sent to Laravel route in Ajax

Symfony - EasyAdmin - Add and remove functions are ignored from AssociationField

Wordpress wpdb->delete issue

Laravel with App Engine Standard Class 'FacadeIgnitionIgnitionServiceProvider' not found

How to redirect to another page after n seconds in wordpress without using javascript?

Why isn't my PHP exception working?

Doctrine 2 mapping referencing unique key

How to set time with DateTime modify?

How to average columns of data from multiple, flat arrays?

How to properly start Laravel 8 with Bootstrap & authentication

Sort multidimensional array by column value within a column

About Contact Privacy policy Terms and conditions