Subscription Views - End date

  • Ahmad Arshad
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
2 years 10 months ago #144601 by Ahmad Arshad
Subscription Views - End date was created by Ahmad Arshad
Dear Tuan,

Is it possible to get more information on the subscription view e.g
1. if it is a recurring subscription... Put something like $100 every 1 month etc... 
2. If its is a fixed subscription length..Put something like $100 for 4 months etc...
3. If there is an expired date.. Put something like $100 till Oct 1st 2021 (expiration date)

I am sure the extension does it already but I cant seem to find where to activate it...

I am trying to move from Stackideas Payplans to Membership pro... so just mentioning things that I see in Payplans
 

Please Log in or Create an account to join the conversation.

  • Ahmad Arshad
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
2 years 10 months ago #144602 by Ahmad Arshad
Replied by Ahmad Arshad on topic Subscription Views - End date
I am looking at the file default_plans.php
Code:
if (!$item->expired_date || ($item->expired_date == $nullDate)) { ?> <tr class="osm-plan-property"> <td class="osm-plan-property-label"> <?php echo JText::_('OSM_DURATION'); ?>: </td> <td class="osm-plan-property-value"> <?php if ($item->lifetime_membership) { echo JText::_('OSM_LIFETIME'); } else { echo OSMembershipHelperSubscription::getDurationText($item->subscription_length, $item->subscription_length_unit); } ?> </td> </tr> <?php }

it doesnt seem there is code for when expiry_date DOES exist... a simple else statement that spits out the expiry date as 
Code:
<?php     } else { ?>                     <tr class="osm-plan-property">                         <td class="osm-plan-property-label">                             <?php echo JText::_('OSM_END_DATE'); ?>:                         </td>                         <td>                             <?php echo $item->expired_date; ?> // Format the expired_date to be human readable                         </td>                     </tr>                     <?php } ?>

Please let me know 

Please Log in or Create an account to join the conversation.

  • Ahmad Arshad
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
2 years 10 months ago - 2 years 10 months ago #144603 by Ahmad Arshad
Replied by Ahmad Arshad on topic Subscription Views - End date
components/com_osmembership/view/plan/tmpl/default.php
components/com_osmembership/view/common/tmpl/default_plans.php

Formatting date :  <?php echo date("M d, Y", strtotime($item->expired_date)); ?>

These two files need to be updated I think
Last edit: 2 years 10 months ago by Ahmad Arshad.

Please Log in or Create an account to join the conversation.

More
2 years 10 months ago #144605 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Subscription Views - End date
Hello

We do not show that expired date for the plan. The reason is because the date could be wrong.

For example, if you set the date to 31/12/2021, next year, even if you forgot to change it, and someone sign up, the system will still change the subscription end date of subscription to 31/12/2022 automatically

So if you want to show that information, you would need to modify code yourself. Remember to implement the change using override so that it won't be lost when you update to future releases of the extension

Regards,

Tuan

Please Log in or Create an account to join the conversation.

  • Ahmad Arshad
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
2 years 10 months ago #144750 by Ahmad Arshad
Replied by Ahmad Arshad on topic Subscription Views - End date
I think a basic test to make sure expiry_date > now ... would take care of the sort of error you are talking about. In any case, its the extension user's job to make sure they update their expiry_date for their plans

I think this would make the view more clearer...

Please Log in or Create an account to join the conversation.