Jump to content

Applying promotion discount to configureproduct.tpl or ordersummary.tpl

Recommended Posts



Is it possible to update the ordersummary.tpl so that includes discounts in the order summary? Where can I find a list of all variables that are available to be displayed or ised in the ordersummary.tpl and configureproduct.tpl pages?


The problem I am trying to solve is this.


1) I've got a click through from a product site which passes the promotion code through on the URL.

2) When I get to the product configuration page the discount isn't shown but I would like it to be.

3) When I get through to the View cart the discount is correctly applied and the total show correctly however this is obviously confusing for the customer.


As background I've used the slider template as the basis for my customisation.


Any help or pointers in the right direction would be appreciated.




Link to comment
Share on other sites

You can give links out to users that will automatically apply a certain promotion code to their order if it applies. To do that, simply use a link like the one below:


cart.php?promocode=TEST OR cart.php?a=add&pid=1&promocode=TEST


Both of the above will apply the promotion code "TEST" to the order. With the first link, the user can choose the package they want and with the second they are taken straight to step 2 of the order process with product id 1 selected.

More ways to link to WHMCS are detailed at Linking to WHMCS.

Link to comment
Share on other sites

  • 4 months later...

Hi Redech,


Thanks for the comment and extremely sorry that it took so long for me to reply.


I'm currently using your second method cart.php?a=add&pid=1&promocode=TEST to pass through the Promo code.

Unfortunately it doesn't quite solve my problem. The discount code gets passed through however the discount VALUE doesnt get applied in the on the Product Configuration page it is only applied on the View Cart/Checkout page.


The Product configuration page contains a price summary with a total cost in it without the discount. As a result I get questions from clients, why they can't see their discount on the Product Configuration page. I've had a look at the variables available in the page using {debug} and can't see the discounted value being available and also can't see the promo code itself anywhere so that I could manually go and figure it out.

Link to comment
Share on other sites

I read one of the WHMCS guys (probably John) post not so long ago that discounts couldn't be shown on the config page (which is probably why it doesn't show up in debug).


if your product doesn't need any config (i.e no domain or other settings), then it should go straight to viewcart (perhaps depending on your order form template)... you can also bypass the config page by adding "&skipconfig=1" to your links - I think if a domain is required with the product, then it may still go to config, but it should skip the step otherwise.


your best bet maybe to tweak configureproduct.tpl to show a message that discounts will be displayed at checkout (i.e shown before they purchase).

Link to comment
Share on other sites

  • 3 months later...

Or you can use some PHP code (I know..) in configureproduct.tpl to fetch promotions from the database. Check if $_SESSION promo variable matches the one in database and product id, then modify the smarty variable.


I'm horrified that this isn't included in whmcs already, as it confuses customers terribly.

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.

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