rev Posted February 1, 2012 Share Posted February 1, 2012 Hi It's a really simple question about changing billing cycle by URL. Let's see: http://demo.whmcs.com/cart.php?a=add&pid=1&billingcycle=annually Yes, it works for products but what if we are NOT linking a product directly but a category aka group? I explain. With this URL i'm linking a category. http://demo.whmcs.com/cart.php?gid=1 Now i want to change the billing cycle: http://demo.whmcs.com/cart.php?gid=1&billingcycle=annually It doesn't work Do you know any workaround before i go on with template editing? 0 Quote Link to comment Share on other sites More sharing options...
Sitepearl Posted February 2, 2012 Share Posted February 2, 2012 Don't think it can be done... even with templating. Might have to create your own cart script. 0 Quote Link to comment Share on other sites More sharing options...
rev Posted February 2, 2012 Author Share Posted February 2, 2012 I got it It's really easy, just a question of seconds. It works with the standard URL even with categories. Use this URL normally: http://demo.whmcs.com/cart.php?gid=1&billingcycle=annually Now simply $_GET['billingcycle'] in your products.tpl and echo it at the very end of your onclick function (the action of your Order now button) like follows: onclick="window.location='{$smarty.server.PHP_SELF}?a=add&pid={$product.pid}{php}echo $whatever;{/php}'" $whatever is the variable in the URL -> &billingcycle=$hello $hello is the billing cycle -> monthly, quarterly, semiannually, annually etc. That's it. If you want to make it clean remember to add an if(empty()); control to verify that $whatever appears in the onclick only if it has been set. 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.