Jump to content

Automatic applying of Promo Code


Harii

Recommended Posts

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}" />

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

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