/var/www/html_uk/wp-content/plugins/automatewoo/includes/Variables/Subscription_Payment_Count.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php

namespace AutomateWoo\Variables;

use 
AutomateWoo\Variable;

defined'ABSPATH' ) || exit;

/**
 * Subscription payment count variable.
 *
 * @since 4.9.0
 */
class Subscription_Payment_Count extends Variable {

    
/**
     * Load admin details.
     */
    
public function load_admin_details() {
        
$this->description __'Displays the subscription payment count.''automatewoo' );
    }

    
/**
     * Get value.
     *
     * @param \WC_Subscription $subscription
     *
     * @return string
     */
    
public function get_value$subscription ) {
        return (string) 
is_callable( [ $subscription'get_payment_count' ] ) ? $subscription->get_payment_count() : $subscription->get_completed_payment_count();
    }
}