Store Community Support Documentation

while most payment gateways do not offer subscriptions less than 1 month (30 days) there are several who do allow weekly subscription, like CCBill for example. I have been using younets advanced payment gateway for years. But I can not create a package in phpfox default subscription app for only 1 week. The minimum phpfox allows is 1 month. There should be a weekly option. Some people want to trial the website. Others can not afford an entire month. Having a weekly subscription option will increase monetization on the website.

Please add a 1 week subscription option to phpfox subscribe app.

Last update on July 23, 8:13 pm by QueenMother305.
JohnJr
#4

PF.Site/Apps/core-subscriptions/views/block/list.html.php

(line 43){elseif $aPackage.recurring_period == 5}                                         {_p var='First Triennial'}

(line 74){elseif $aPackage.recurring_period == 5}                                     {_p var='triennial'}

 

If you wanted to add only a weekly subscription option then only add this to this file.

 

Since there is no phrase called First week you will need to enter it in Phrases in the admincp or if you don't know how to do that you could just leave out the two single quotes around the word First Week in the code below.  Without the single quotes it displays whatever you put after p var=

(line 43){elseif $aPackage.recurring_period == 5}                                         {_p var='First Week'}

(line 74){elseif $aPackage.recurring_period == 5}                                     {_p var='week'}

Last update on May 23, 6:14 pm by JohnJr.
Be the first person to like this.
JohnJr
#5

PF.Site/Apps/core-subscriptions/views/controller/admincp/add.html.php

(line 164)

{_p var='triennial'}

 

If you wanted to add only a weekly subscription option then only add this to this file.

 

(line 164)

{_p var='week'}

Last update on May 23, 6:15 pm by JohnJr.
Be the first person to like this.
JohnJr
#6

PF.Site/Apps/core-subscriptions/Service/Subscribe.php

(line 192)case '5':                 // triennial                 $aValues['period'] = 'triennial';                 $sPhrase = _p('fee_for_recurring', $aValues);                 break;

(line 486)case 5:                     $aPackages[$iKey]['type'] = _p('triennial');                     break;

 

If you wanted to add only a weekly subscription option then only add this to this file.

 

(line 192)case '5':                 // week                 $aValues['period'] = 'week';                 $sPhrase = _p('fee_for_recurring', $aValues);                 break;

(line 486)case 5:                     $aPackages[$iKey]['type'] = _p('week');                     break;

Last update on May 23, 6:15 pm by JohnJr.
Be the first person to like this.
JohnJr
#7

PF.Site/Apps/core-subscriptions/Controller/Admin/AddController.php

(line 83)case 5:                         $iPeriodDays = 1095;                         break;

 

If you wanted to add only a weekly subscription option then only add this to this file.

 

(line 83)case 5:                         $iPeriodDays = 7;                         break;

Last update on May 23, 6:15 pm by JohnJr.
Be the first person to like this.
JohnJr
#8

PF.Site/Apps/core-subscriptions/Block/UpgradeBlock.php

(line 97)case 5:                             {                                 $sDateTitle = _p('3 years');                                 break;                             }

 

If you wanted to add only a weekly subscription option then only add this to this file.

 

(line 97)case 5:                             {                                 $sDateTitle = _p('1_week');                                 break;                             }

Last update on May 23, 6:16 pm by JohnJr.
Be the first person to like this.
JohnJr
#9

PF.Base/module/api/include/service/gateway/gateway.class.php

(line 322)case '5':                 // triennial                 if ($sRecurring > 0 && $sInitialFee > 0) {                     $sPhrase = _p('Initial Fee then cost Triennial', $aValues);                 } else {                     if ($sRecurring > 0 && $sInitialFee == 0) {                         $sPhrase = _p('No initial Fee then cost Triennial', $aValues);                     }                 }                 break;

 

If you wanted to add only a weekly subscription option then only add this to this file.

 

(line 322)case '5':                 // triennial                 if ($sRecurring > 0 && $sInitialFee > 0) {                     $sPhrase = _p('Initial Fee then cost weekly', $aValues);                 } else {                     if ($sRecurring > 0 && $sInitialFee == 0) {                         $sPhrase = _p('No initial Fee then cost weekly', $aValues);                     }                 }                 break;

I can't remember if you need to add these two phrases above to the admincp Phrases module.  If you do not know how to add a phrase in the module, you could just remove the single quotes around the above two phrases.

Last update on May 26, 8:40 pm by JohnJr.
Be the first person to like this.
JohnJr
#10

I think that is all the files that need to be changed.  Remember these files will be written over every time you upgrade the subscription files during main upgrades or app upgrade.

Be the first person to like this.
QueenMother305
#11

I think that is all the files that need to be changed.  Remember these files will be written over every time you upgrade the subscription files during main upgrades or app upgrade.

 

thats why there should be an option to add custom recurring period within the subscription app itself. I’ll take a second look at this later and give it a try. Thanks for the help.

Be the first person to like this.
#12

Dear QueenMother305,

Thank you for your suggestion.  Your suggestion will be taken into consideration seriously in our future upgrades.

Best regards,

Hannah

metro
#13

Has this suggestion been "taken into consideration seriously" yet?

Dear QueenMother305,

Thank you for your suggestion.  Your suggestion will be taken into consideration seriously in our future upgrades.

Best regards,

Hannah

Be the first person to like this.
JohnJr
#14

I assumed she used the above code to create a hack for a week.  If this is your first additional subscription hack.  Then use the code above in the correct files (you will see the other code for monthly to also look at to make sure you are doing it right).  I am going to update the above code to show the example below mine of what a weekly subscription would look like for each file.  Hoping this helps and please let me know if there are problems.  Remember though...after each upgrade this will get erased and will have to be rewritten again.

Last update on May 26, 8:36 pm by JohnJr.
Be the first person to like this.
metro
#15

Thanks JohnJr. I will try it over next week-end.  I need to recover from the stay at home Jack Daniel brain killer memorial day weekend.

 

metro
#16

JohnJr - can you please double check this?  Of interest is... Reason is that there are no other cases e.g Case 4 Case 3 e.t.c to correspond.  I am trying this on the latest download of phpFox. - Thanks.

(line 291)case 5:                 $aPurchase['type'] = _p('week');                 break;

 

If you wanted to add only a weekly subscription option then only add this to this file.

(line 291)case 5:                 $aPurchase['type'] = _p('week');                 break;

[/quote]

Be the first person to like this.
JohnJr
#17

Yes, I just checked the file...and it is not there.  I can only assume since there has been at least three upgrades since I wrote this code, that maybe it was removed or I made a mistake.  Try it without it, and if it works then I will remove that code from this thread.  If it does not work, then I will look into more and see if I have the wrong file.

Update:  I just noticed on that line (which on my spreadsheet shows it use to be on line 268) is in red font which tells me they changed the code, and the new code was moved to about line 280 or so.  So I will remove that code....good catch.

Last update on May 28, 4:29 am by JohnJr.
metro
#18

JohnJr - can you please verify the following as it does not seem to follow sequence - meaning there is no similar value sequence for monthly, yearly, annual...

PF.Site/Apps/core-subscriptions/views/controller/admincp/add.html.php

(line 164)

{_p var='triennial'}

 

If you wanted to add only a weekly subscription option then only add this to this file.

 

(line 164)

{_p var='week'}

Be the first person to like this.