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?
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?
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: 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
Cheers!
Could you let us know which store this is for? You shouldn't have to specify allunits for a coupon discount as you noted.