Jump to content

Promotion code / coupon code with link


asquareh

Recommended Posts

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

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