LLMS_Admin_Post_Table_Coupons::manage_columns( string $column, int $post_id )

Manage content of custom coupon columns


Parameters Parameters

$column

(string) (Required) column key/name

$post_id

(int) (Required) WP Post ID of the coupon for the row


Top ↑

Return Return

(void)


Top ↑

Source Source

File: includes/admin/post-types/post-tables/class.llms.admin.post.table.coupons.php

63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
public function manage_columns( $column, $post_id ) {
 
    global $post;
    $c = new LLMS_Coupon( $post );
 
    switch ( $column ) {
 
        case 'amount':
            _e( 'Discount: ', 'lifterlms' );
            echo $c->get_formatted_amount();
            echo '<br>';
 
            if ( $c->has_trial_discount() ) {
                _e( 'Trial Discount: ', 'lifterlms' );
                echo $c->get_formatted_amount( 'trial_amount' );
                echo '<br>';
            }
 
            break;
 
        case 'desc':
            echo $c->get( 'description' );
            break;
 
        case 'usage':
            echo $c->get_uses();
            echo ' / ';
            echo ( $c->get( 'usage_limit' ) ) ? $c->get( 'usage_limit' ) : '&infin;';
            break;
 
        case 'expiry':
            echo $c->get( 'expiration_date' ) ? $c->get_date( 'expiration_date', 'F d, Y' ) : '&ndash;';
            break;
 
    }
 
}

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.