Harii Posted May 9, 2020 Share Posted May 9, 2020 Can somebody help me how to make automatic applying of promo code in the drop down (Billing Cycle Section) in WHMCS Order Page like in Picture ! https://prnt.sc/sdr8j3 0 Quote Link to comment Share on other sites More sharing options...
Kelby Posted May 9, 2020 Share Posted May 9, 2020 Hello, You can add this code: {if $productinfo.type eq "hostingaccount"}<input type="hidden" name="promocode" value="YourCode" /> {/if} to configureproduct.tpl juste after <form id="frmConfigureProduct"> <input type="hidden" name="configure" value="true" /> <input type="hidden" name="i" value="{$i}" /> 0 Quote Link to comment Share on other sites More sharing options...
Harii Posted May 9, 2020 Author Share Posted May 9, 2020 Can you tell me in which of these templates/orderforms/boxes/configureproduct.tpl templates/orderforms/modern/configureproduct.tpl templates/orderforms/standard_cart/configureproduct.tpl templates_c/872e8ad35b17d853e614c9b4c0e5460599340e3e_0.file.configureproduct.tpl.ph 0 Quote Link to comment Share on other sites More sharing options...
Kelby Posted May 9, 2020 Share Posted May 9, 2020 5 minutes ago, Harii said: templates/orderforms/standard_cart/configureproduct.tpl 0 Quote Link to comment Share on other sites More sharing options...
Harii Posted May 9, 2020 Author Share Posted May 9, 2020 "hostingaccount" name="promocode" value="YourCode" Do i have to change this this texts hostingaccount promocode and YourCode , 0 Quote Link to comment Share on other sites More sharing options...
Kelby Posted May 9, 2020 Share Posted May 9, 2020 3 minutes ago, Harii said: YourCode You can change this to your promo code. 0 Quote Link to comment Share on other sites More sharing options...
Harii Posted May 9, 2020 Author Share Posted May 9, 2020 And one more thing i have four (4) products and im offering in Annually, Biennially, Triennially terms and how to make for all of these ! 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 10, 2020 Share Posted May 10, 2020 16 hours ago, Harii said: Can somebody help me how to make automatic applying of promo code in the drop down (Billing Cycle Section) in WHMCS Order Page like in Picture ! rather than adding the promo code at the configuration stage, and especially if there are multiple products and/or multiple different promo codes, it would be easier to add it to the products page, or on links from your main site (wherever they are making their initial choice of product). https://docs.whmcs.com/Linking_to_WHMCS Quote To automatically apply a promotion code to the order, you can append &promocode=xxxx to any of the cart links, but on its own the link would look like this: http://demo.whmcs.com/cart.php?promocode=xxxxxxx so if these were separate links, you could specify product, billing cycle and promocode in them. altering products.tpl to add a promo code is simple enough, but the user won't have chosen a billing cycle by then... and if you're using different promo codes per cycle, then editing products.tpl might not be an option. 14 hours ago, Harii said: And one more thing i have four (4) products and im offering in Annually, Biennially, Triennially terms and how to make for all of these ! if they're percentage discounts, it shouldn't really matter... but I suppose you're going to tell me they're different promo codes with fixed amount discounts per product and per cycle. 😲 you could use a hook to add the promocode based on the current product, but because the cart can only use one promocode at a time, you could run into issues if the user tried to add 2 separate products that each had their own promo code assigned to it.... that might be a good thing, but if you went down that road, you would have to determine which product / promocode took priority. 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.