nimonogi Posted October 12, 2015 Share Posted October 12, 2015 (edited) We use links that automatically apply a certain promotion code to the order (cart.php?a=add&pid=1&promocode=TEST). The problem is that the visitor will select a billing cycle at cart.php?a=confproduct and he will see the prices and total amount without the promotional discount. Here he will abandon the cart as we advertise that will get a 50% discount. Proper discount is displayed at next step (cart.php?a=view). Is there any way to show the discounted total amount, or the billing cycle pricing with the promo code name next to pricing, at cart.php?a=confproduct Attaching screenshots. Edited October 12, 2015 by nimonogi 0 Quote Link to comment Share on other sites More sharing options...
nimonogi Posted October 12, 2015 Author Share Posted October 12, 2015 This is another issue and not related to the problem I just described. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted October 12, 2015 Share Posted October 12, 2015 Hi, Is there any way to show the discounted total amount, or the billing cycle pricing with the promo code name next to pricing, at cart.php?a=confproduct not easily - but it's basically going to be a variation on the threads below... http://forum.whmcs.com/showthread.php?98275-Conditions-Apply-To-A-Promotion http://forum.whmcs.com/showthread.php?92890-Coupon-codes the problem is that the promo code isn't passed to that configureproduct.tpl template page (or even that one is being used), neither are the discounted prices - but the cart totals and promo code values (not the name) are passed to ordersummary.tpl... open up ordersummary.tpl and add {debug} to the end of the code and you will get a popup window - in there, you should see some useful variables... with them, you can define a message to be added to the cart, e.g if rawdiscount > 0, promo code should be valid. <span>{if $carttotals.rawdiscount gt 0}Valid Promotional Code - discounted prices will be shown on the next page.{/if}</span> although you can determine that a valid promotional code has been used, and you know the total discount and discounted total, you can't determine it for each individual product... e.g if you have 3 items in your cart, but the discount is only applied to one, there is no simple way to determine which product the discount is being applied to. however, if you only have one item in the cart, then you can do this by modifying ordersummary.tpl... {if $carttotals.rawdiscount gt 0 && $numitemsincart eq 1} <div class="clearfix"> <span class="pull-left">{$carttotals.promovalue}{if $carttotals.promotype eq "Percentage"}%{/if} {$carttotals.promorecurring} {$LANG.orderdiscount}:</span> <span class="pull-right">{$carttotals.discount}</span> </div> {/if} </div> {/if} <div class="total-due-today"> <span class="amt">{if $carttotals.rawdiscount gt 0 && $numitemsincart eq 1}{$carttotals.total}{else}{$producttotals.pricing.totaltoday}{/if}</span> <span>{$LANG.ordertotalduetoday}</span> this is just a bare bones suggestion (i.e I haven't covered all promotypes in the above code!), so you should test it thoroughly in your own cart to see if there are any issues. 1 Quote Link to comment Share on other sites More sharing options...
nimonogi Posted October 12, 2015 Author Share Posted October 12, 2015 Thanks a lot for this guide! Now I can work something out.. This however, should be taken into serious consideration by WHMCS as it is unacceptable for a newly designed cart to have such flaws. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted October 12, 2015 Share Posted October 12, 2015 This however, should be taken into serious consideration by WHMCS as it is unacceptable for a newly designed cart to have such flaws. I can't argue with that... I was going to suggest reporting it as a bug - though using WHMCS definition, it isn't one... it's just a bad process inherited from the older templates. 0 Quote Link to comment Share on other sites More sharing options...
nimonogi Posted October 14, 2015 Author Share Posted October 14, 2015 Another possible solution would be to entirly skip cart.php?a=confproduct if the billing cycle is set through the URL and if no addons are available. Is that something possible? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted October 14, 2015 Share Posted October 14, 2015 you mean by using skipconfig ? http://docs.whmcs.com/Linking_to_WHMCS It's possible to skip the configuration page entirely provided you have defined all the configuration values in the URL by adding &skipconfig=1 to your order URL. If there is any configuration missing, then this would generate an error and force the client to edit the configuration. 0 Quote Link to comment Share on other sites More sharing options...
nimonogi Posted October 14, 2015 Author Share Posted October 14, 2015 (edited) That's great! Edited October 14, 2015 by nimonogi 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.