Foxy Forum Status

We're no longer responding to questions via our forum, but we will keep it up for historical reasons. If you can't find the answer you're looking for, please visit our knowledge base or contact us. If there's enough interest in the future, we may bring the forum back.

Category Discount for Certain Members

mrlarsonmrlarson Member
In the coupon and discount documentation is says;
"If you would like your category discount to be applied only in certain cases (like when a customer is a member of a group that receives the discount), then you can create two categories, one with and one without the discount, and use the discounted category (or not) when adding products to your cart."

I don't understand what differentiates one customer from another? I have created a category with a discount and the products with that category assigned get the correct discount, but that would apply the discount to anyone purchasing the product? I don't see how you assign two categories to one product and differentiate between who is adding a product with which category.

What we are trying to do is apply discounts to products in the store to those customers who are subscribers of our publication. All subscribers would receive $10 off a purchase of $50 or more and 20% off all back issue products.

  • fc_adamfc_adam FoxyCart Team

    Thanks for posting - sorry for the confusion there. That particular explanation is suggesting that if you're needing to apply a differing category discount for an authenticated customer versus a new customer, you would create two categories and then update your add to cart forms to use one of those categories depending on if the user is logged in or not. This would happen on your add to cart page, before the customer has added the product to the cart.

    For your set up - do your subscribers have login access for your site? If so - you could take a similar approach, switching out the category based on whether the customer is logged in to your website or not.

    If your subscribers don't have logins, you could alternatively provide a coupon code to your subscribers for them to use. There's no guarantee that a non-subscriber wouldn't get access to the coupon in that case, but there are some ways you could validate that too. For example, you could use our pre-payment webhook to run a validation right before the customer checks out. On your endpoint script you could check if the customer has the coupon in their cart, and if so, check if that specific email address is on your subscriber list. If they're not, you could send them back to the checkout with an error that they are unable to use that coupon.

    One note with the coupon though - it would only be able to provide one or the other of your two discounts (the $10 off or the 20% off), but not both types in a single coupon.
  • Thanks @fc_adam . That's what I figured, but wasn't sure if there was something I was missing. Subscribers will be able to log in, so that will be what we will be looking to implement as our end solution as it would be the most elegant implementation. In the mean time though I think we will use a button that logged in users can use that will apply coupons to the cart . I knew they would need to be separate coupons, is there a good way to apply multiple coupons in one step?
  • fc_adamfc_adam FoxyCart Team

    Ok cool! In terms of adding them with a button - you can add coupons to the cart using the coupon parameter within an add to cart link. It accepts a comma separated list of coupon codes to be added, for example:,code2. Details of that parameter can be seen on our cheatsheet on the wiki.

    You could also add the coupons to the cart using javascript, either via a button, or automatically on page load if you detect that the customer is logged in. You can see an example of that here:
Sign In or Register to comment.