Alcedema Posted October 18, 2009 Share Posted October 18, 2009 This is an easy way of hiding the gateway list (not removing - as it is needed) when everything in the cart is Free. In viewcart.tpl change (around line 362): <p class="heading2">{$LANG.orderpaymentmethod}</p> <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="checked"{/if} /> <label for="pgbtn{$num}" style="margin-right: 10px;">{$gateway.name}</label> {/foreach}</p> to: {if substr($total, 2, 4) == '0.00'}<div style="display: none">{/if} <p class="heading2">{$LANG.orderpaymentmethod}</p> <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="checked"{/if} /> <label for="pgbtn{$num}" style="margin-right: 10px;">{$gateway.name}</label> {/foreach}</p> {if substr($total, 2, 4) == '0.00'}</div>{/if} This hides the list, as per WHMCS' requirement, an order has to have a payment/transaction associated with it. This way, your default gateway is used and should go straight to the order confirmation page. 0 Quote Link to comment Share on other sites More sharing options...
Alcedema Posted October 18, 2009 Author Share Posted October 18, 2009 You can also use the following if statement to make your own hidden input for using only one certain gateway; ie {if substr($total, 2, 4) == '0.00'} <input type="hidden" name="paymentmethod" value="payflowpro" /> {else} .. normal gateway selection .. {/if} 0 Quote Link to comment Share on other sites More sharing options...
Kenya Webhosting Posted November 12, 2009 Share Posted November 12, 2009 I have just tried that code but the payment gateways available on my site are still showing up despite the cart showing no money owed. Any ideas? Thanks 0 Quote Link to comment Share on other sites More sharing options...
tech Posted March 26, 2010 Share Posted March 26, 2010 Didn't work for me either. I understand the code, so I'm not sure why it doesn't work. 0 Quote Link to comment Share on other sites More sharing options...
DJSean00 Posted July 17, 2012 Share Posted July 17, 2012 So does anyone know if the above is working? 0 Quote Link to comment Share on other sites More sharing options...
DJSean00 Posted July 19, 2012 Share Posted July 19, 2012 HI All, I did try this, it removed those fields however when I try and check out I get an error that Hostname, NS1 and NS2 are required and need to be filled out. Any ideas? 0 Quote Link to comment Share on other sites More sharing options...
altomarketing Posted July 23, 2012 Share Posted July 23, 2012 maybe one thing is to hide gateway and other is to process an order without selecting a gateway for that order, i will test addint selected to one gateway, like: <option value="paypal" selected 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.