Jump to content

Question on passing promo code


ffeingol

Recommended Posts

Hello,

 

If we use a URL like:

 

cart.php?a=add&pid=42&promocode=ABCDEF

 

It works great and the promo is automatically applied.

 

If we use a URL like:

 

cart.php?gid=2&promocode=ABCDEF

 

To let the client pick the package within the group, the promo code does not apply (the promo code is valid for the entire group). Can a promo code be passed so it works for an entire group and not just a single product?

Link to comment
Share on other sites

You should be able to put in {php} {/php} tags on the first entrance to your order stream, something like $_SESSION['group_promocode'] = $_GET['promocode']; And then just put the promocode into the text box when it comes to that point (using other {php} tags to put it into SMARTY (i.e. inside an if statement: $this->assign('hasPromocode', true); $this->assign('promoCode', $_SESSION['group_promocode']))).

 

I don't like the idea of doing this because it puts code into the View layer. In all honesty I can't stand the smarty template engine because it has {if} and {foreach} blocks (Model / Controller and View should never be together in my opinion). Then again, WHMCS doesn't seam to be exactly MVC, but that's a discussion for another day.

 

Anywho, yeah. It could be done.. theoretically, not elegantly, and hackishly.. but it could be done.

 

Cheers,

Link to comment
Share on other sites

You should be able to. The code on the group page is not capturing the code from the parameters list and passing it on to the next step, so this should be a bug. Whatever parameters are passed should propagate through the order process.

 

Basically what SnakeDiver said, but you shouldn't have to do this yourself, it should already work like that.

Link to comment
Share on other sites

A promo code only applies to a specific product. Go to Add Promotion Code and look in the Applies To box.

You can hold ctrl and select multiple products or all the products in that group and then that promo code will work for any product in the group.

Link to comment
Share on other sites

  • 1 year later...
A promo code only applies to a specific product. Go to Add Promotion Code and look in the Applies To box.

You can hold ctrl and select multiple products or all the products in that group and then that promo code will work for any product in the group.

 

I tried selecting multiple products (ctrl and select) in the Applies to field of the Promotional Code section but it keeps falling back to only one item.

 

How do we setup one Promotional Code that applies to multiple products?

Link to comment
Share on other sites

I can select multiple kines in all other text areas and they work 100% but the one for Promotion Code does not.

 

It selects the lines but does not save to the DB.

 

The database entry shows for example 1,

Meaning it saves the first item, then places the comma for the next but does not store the remainder.

 

No errors in any logs.

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