Jump to content

Payment Option for a specific Billing Cycle?


Recommended Posts

Hi,

 

I cant seem to find how to do the following...maybe it isnt even possible?

 

We allow customers to pay for Hosting by several means. However, we ONLY allow Credit Card billing for Hosting plans where the Billing Cycle is monthly. How do I go about making this happen? Something seems to be missing.

 

Cheers,

Paul

Link to comment
Share on other sites

Actually... how does everyone else do billing?

If you allow monthly billing how do you go about collecting a cheque every month via post? Surely you would be chasing cheques all the time?

 

Or does everyone here only use paypal or other automated means?

 

Cheers,

Paul

Link to comment
Share on other sites

  • WHMCS CEO

I think most must just advise the client. Personally, I added a notice saying cheques are not accepted for monthly payments to the payment method selection area on the order form. Being able to specify which payment methods can be used for each individual billing cycle would be a nightmare from a coding point of view. A smarty template edit could also be used to hide the options actually.

 

Matt

Link to comment
Share on other sites

Most of our customers pay by check and we only have a problem with one customer at this time who is once again currently suspended. He spends a lot of time suspended...We don't have thousands of accounts though and quite a few are local.

Link to comment
Share on other sites

Ok, for anyone else interested, here's some smarty code to make this happen. :D

 

{if $billingcycle=="monthly"}
 {foreach key=num item=gateway from=$gateways}
      <input type="radio" name="paymentmethod" value="{$gateway.sysname}" id="pgbtn{$num}"{if $gateway.sysname eq "offlinecc"} checked{else} disabled{/if} />
      <label for="pgbtn{$num}">{$gateway.name}</label>
  {/foreach}
  <div align="center">NOTE: Monthly Payments must be by Credit Card.</div>
{else}
  {foreach key=num item=gateway from=$gateways}
     <input type="radio" name="paymentmethod" value="{$gateway.sysname}" id="pgbtn{$num}"{if $selectedgateway eq $gateway.sysname} checked{/if} />
     <label for="pgbtn{$num}">{$gateway.name}</label>
  {/foreach}
{/if}

Cheers,

Paul

Link to comment
Share on other sites

Ok, for anyone else interested, here's some smarty code to make this happen. :D

 

{if $billingcycle=="monthly"}
 {foreach key=num item=gateway from=$gateways}
      <input type="radio" name="paymentmethod" value="{$gateway.sysname}" id="pgbtn{$num}"{if $gateway.sysname eq "offlinecc"} checked{else} disabled{/if} />
      <label for="pgbtn{$num}">{$gateway.name}</label>
  {/foreach}
  <div align="center">NOTE: Monthly Payments must be by Credit Card.</div>
{else}
  {foreach key=num item=gateway from=$gateways}
     <input type="radio" name="paymentmethod" value="{$gateway.sysname}" id="pgbtn{$num}"{if $selectedgateway eq $gateway.sysname} checked{/if} />
     <label for="pgbtn{$num}">{$gateway.name}</label>
  {/foreach}
{/if}

Cheers,

Paul

 

 

Hi, Paul

 

Maybe you could give some instructions for the people who don't know where abouts to add the above?

 

Thanks

Link to comment
Share on other sites

Sure :)

 

Edit the template file order-stepthree.tpl.

Find the section starting with

{foreach key=num item=gateway from=$gateways}

and ending with

{/foreach}

Now replace all of that section with the code as stated previously.

 

 

NOTE: that the code above is for Offline CC processing ie. "offlinecc".

You could easily adapt it for any method. To find out what value to use instead of "offlinecc" simply paste the following anywhere on to your template: {$selectedgateway} ... and the current gateway value selected will be displayed.

 

 

Cheers,

Paul

Link to comment
Share on other sites

Sure :)

 

Edit the template file order-stepthree.tpl.

Find the section starting with

{foreach key=num item=gateway from=$gateways}

and ending with

{/foreach}

Now replace all of that section with the code as stated previously.

 

 

NOTE: that the code above is for Offline CC processing ie. "offlinecc".

You could easily adapt it for any method. To find out what value to use instead of "offlinecc" simply paste the following anywhere on to your template: {$selectedgateway} ... and the current gateway value selected will be displayed.

 

 

Cheers,

Paul

 

 

Hi,

 

It works great, I like it how it just makes the other gateways unselectable instead of them not being there altogether.

 

Thanks :D

 

 

EDIT:

 

Although when someone clicks refresh the order disapears, it didn't before?

 

EDIT:

 

Appears to be okay now. :D

Link to comment
Share on other sites

  • 2 months later...

Apologies for being thick with this.

 

I can get it to work with worldpay showing up as the payment option, but it blocks out my other 2 options, futurepay and paypal as well.

 

Can you give me the code (please) :oops: to make it work with these as well?

 

Thanks in advance.

Link to comment
Share on other sites

  • 4 months later...

I've tried to add this code to the new cart.php with version 3.5.1 but it doesn't work - I'm guessing that the variable {$billingcycle} no longer exists (file viewcart.php around line 181).

 

Has anybody managed to integrate this modification with v3.5.1 and the new cart.php system?

 

Many thanks, Edith (aka Terra)

Link to comment
Share on other sites

Found it! First time I ever worked with Smarty but it's really easy & similar to PHP. This is how it works on my site (version 3.5.1 with cart system):

 

Find this bit of code in /templates/orderforms/cart/viewcart.php around line 181:

 

<p align="center">{foreach key=num item=gateway from=$gateways}<input type="radio" name="paymentmethod" value="{$gateway.sysname}" id="pgbtn{$num}"{if $selectedgateway eq $gateway.sysname} checked{/if} /><label for="pgbtn{$num}">{$gateway.name}</label> {/foreach}</p>

 

and replace with

 

{assign var='monthlyFlag' value='false'}
{foreach key=num item=product from=$products}
{if $product.billingcycle eq "monthly"} {assign var='monthlyFlag' value='true'} {/if}
{/foreach}

<p align="center">
{if $monthlyFlag=="true"}
 {foreach key=num item=gateway from=$gateways}
      <input type="radio" name="paymentmethod" value="{$gateway.sysname}" id="pgbtn{$num}"{if $gateway.sysname eq "secpay"} checked{else} disabled{/if} />
      <label for="pgbtn{$num}">{$gateway.name}</label>
  {/foreach}
  <div align="center">NOTE: Monthly Payments must be by Credit Card.</div>
{else}
  {foreach key=num item=gateway from=$gateways}
     <input type="radio" name="paymentmethod" value="{$gateway.sysname}" id="pgbtn{$num}"{if $selectedgateway eq $gateway.sysname} checked{/if} />
     <label for="pgbtn{$num}">{$gateway.name}</label>
  {/foreach}
{/if}
</p>

 

NOTE: replace "secpay" with the name of your billing system.

 

And one warning - this code disables all other payment systems as long as ONE item in the basket is monthly. Say e.g. customer has 3 items in the basket, one is monthly, the others are not - the monthly message is triggered. There's not really a way around it as there's only one payment for all items in the basket.

 

Hope this works on other sites - I've just started with WHM & Smarty so please be careful & TEST this code before installing on a live site. Safety first!

 

Edith

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated