asquareh Posted April 10, 2014 Share Posted April 10, 2014 Hi, how can i integrate coupon code together with cart.php. ex. on my hosting page i have a order now button for each hosting plans so I used http://...../pid=1&promocode=TEST to link the first hosting plan. If I want to do the same in cart.php or viewcart.tpl how can i do it. ( i believe they use pid={num} like a macro but i want to use diff promocode for each plan. for plan 1 TEST , Plan2 TEST1 ETC. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted April 10, 2014 Share Posted April 10, 2014 http://docs.whmcs.com/Linking_to_WHMCS plan 1 -> http://domain.com/cart.php?pid=1&promocode=TEST plan 2 -> http://domain.com/cart.php?pid=2&promocode=TEST2 plan 3 -> http://domain.com/cart.php?pid=3&promocode=TEST3 the PID might not be 1,2 and 3 but you can obtain them from... setup -> product/services -> products/services -> edit product -> links 0 Quote Link to comment Share on other sites More sharing options...
asquareh Posted April 10, 2014 Author Share Posted April 10, 2014 this is clear. I am already doing this for individual product but in viewcart.tpl there is no way to hardcode pid=1&promocode=TEST there should be some statement line if num = 1 http....&promocode=TEST elseif .... elseif etc. how can i do this with this .tpl file 0 Quote Link to comment Share on other sites More sharing options...
asquareh Posted April 10, 2014 Author Share Posted April 10, 2014 i am using slider order form templates so whenever the system calls cart.php the system displays slider ruler with 3 hosting plan options , for each plan there is a order now button on the bottom. ( here i would like to have a link to promotion code according to the selection. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted April 10, 2014 Share Posted April 10, 2014 i'm not quite sure what you're trying to do... I can see you understand links, but are you suggesting that if someone just comes to your site without a direct link (as above), and they order plan 1, then the cart will automatically assign the appropriate promo code and discount accordingly? the two usual methods with promo codes are to either add them to links (as per above), or you give them to a user and they enter it into viewcart at checkout themselves. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted April 10, 2014 Share Posted April 10, 2014 i am using slider order form templates so whenever the system calls cart.php the system displays slider ruler with 3 hosting plan options , for each plan there is a order now button on the bottom. ( here i would like to have a link to promotion code according to the selection. what you could try is in products.tpl in the slider folder, there should be the following line... <form method="post" action="cart.php?a=add&{if $product.bid}bid={$product.bid}{else}pid={$product.pid}{/if}"> you could try modifying that to... <form method="post" action="cart.php?a=add&{if $product.bid}bid={$product.bid}{else}pid={$product.pid}&promocode=test{$product.pid}{/if}"> for pid=1, it adds the promo code "test1" to the link.. for pid=2, it adds the promo code "test2" to the link.. for pid=34, it adds the promo code "test34" to the link.. etc it's just a case then of naming the promotion codes to match the pid of the product they're to be used with. 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.