coupon code questions

drwagner13drwagner13 Member
in Bugs & Feature Requests edited March 2012
I've been studying coupon codes, but I don't quite yet have my head around it.

I want to present the user with a blank to enter a coupon code. Where does the form go, and what is the correct html to use? Can/Should it be part of the normal order for (where an item is added to the cart?). I have not found instructions for this on the Foxycart website.

I am offering a discount on a specific product, once the coupon code is entered, so I think I want to present the user with a blank for the coupon code on the order page. Is that the right way to do it?

Also, I understand that I must give that product it's own category, so that this discount is applied only to that item. Is this correct?
Comments
  • fc_adamfc_adam FoxyCart Team
    @drwagner13,

    That's correct, if you'd like a discount to only apply to certain products, those products have to be in their own category that the coupon applies to.

    By default, when a coupon is added to the store in the admin, a coupon entry field will appear in the cart page to your customers. This is where they can enter their coupon code to receive the discount.

    That said though, you can also add a coupon code entry field along with the product add to cart form. You would just have a text input with a name of 'coupon' that a user can enter the coupon code into. The form would need to post to your FoxyCart cart domain just like a normal add to cart form.

    Does that help clear up any confusion?
  • lancelance Member, Community Support Member
    @drwagner13 -

    Hopefully Adam has helped move you in the right direction. I just wanted to add a few notes, as well, in case it helps make things a little more clear for you.

    As Adam said, a coupon field is automatically added to the cart when there is an active coupon entered into the FoxyCart admin. This coupon field only displays on the cart by default, but it sounds like you would like to make it possible for the user to add the coupon at the same time they are adding the product to the cart, is that correct? If this is correct, you can achieve this by adding an extra field to your form that looks like this:
    <input type="text" name="coupon" />
    
    You can set this up to pass with the add to cart action, or you could setup a separate form to allow the user to add a coupon at any point.

    As to your question about categories, yes, if you add the product to the cart in its own category and have the coupon setup to apply only to that category, then the discount will apply only to that product.

    If you have any other questions, please don't hesitate to post again.

    Lance
  • drwagner13drwagner13 Member
    edited March 2012
    I thought I should followup and mention that I could only get my coupon to work if I specified the default setting "allunits" explicitly. I'm doing a $5 discount coupon for 1 or more of a specific item. I have applied a category for this item. I set the coupon details in the coupon setup to "1-5" and this did not work. By setting this to "allunits|1-5", the coupon worked. I think it's interesting that allunits is the default, and yet it must be explicitly stated (which seems to me contrary to the idea of a default!).

    Cheers!
  • fc_adamfc_adam FoxyCart Team
    @drwagner13,

    Could you let us know which store this is for? You shouldn't have to specify allunits for a coupon discount as you noted.
  • lukeluke FoxyCart Team
    Hey @drwagner13. That doesn't sound right. What store is this for and what version is the store?
Sign In or Register to comment.