Including the price and renewal date of the current subscription on the Subscriptions page

Hello Support.

How can I display the price and renewal date of the current Subscription level on the Subscription page..??

All it says now is what the subscription name is and that you can Unsubscribe from it.

Having these two other pieces of information would paint a complete picture about whether the other plans are better or worse.

Thanx in advance as always.

  • Michael Bissett

    Hi @Kathy, hope you're doing well today! :slight_smile:

    While the price of the subscription would require some custom coding (which would require editing the plugin directly, so you'd have to note the changes made), the renewal date should be showing up on the page already.

    Could you post a screenshot of what you're seeing now, and mention which subscription you're trying to test with here?

    Please advise,
    Michael

  • Ash

    Hello @Kathy

    I hope you are well today.

    Please go to /plugins/membership/classes/Membership/Render/Page/Renew.php line no 312 to 324 and replace

    switch ( $currentlevel->sub_type ) {
    										case 'serial':
    											echo __( 'Your membership is set to <strong>automatically renew</strong>', 'membership' );
    											break;
    
    										case 'finite':
    											if ( !empty( $nextlevel ) ) {
    												// We have a level we can move to next
    												echo __( 'Your membership is set to <strong>automatically renew</strong>', 'membership' );
    											} else {
    												echo sprintf(__( 'Your membership is due to expire on: <strong>%s</strong> ', 'membership' ), $expire_date_string);
    											}
    											break;
    									}

    with

    switch ( $currentlevel->sub_type ) {
    										case 'serial':
    											echo __( 'Your membership is set to <strong>automatically renew</strong> at ' . $expire_date_string, 'membership' );
    											break;
    
    										case 'finite':
    											if ( !empty( $nextlevel ) ) {
    												// We have a level we can move to next
    												echo __( 'Your membership is set to <strong>automatically renew</strong> at ' . $expire_date_string , 'membership' );
    											} else {
    												echo sprintf(__( 'Your membership is due to expire on: <strong>%s</strong> ', 'membership' ), $expire_date_string);
    											}
    											break;
    									}

    Then, in line 398, add the following line:

    <?php $subscription = $factory->get_subscription( $sub->id  ); ?>
    							<span class=&quot;price&quot;><?php echo $subscription->sub_pricetext() ?></span>

    Please note that, this changes will be lost in next update. So it's worth to note down this changes somewhere and apply again after your updates.

    Hope it helps :slight_smile: Please feel free to ask more question if you have.

    Cheers
    Ash

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.