Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
v:2.0:coupons_and_discounts [2019/11/28 08:17] – [Coupon Codes] adamv:2.0:coupons_and_discounts [2024/04/05 20:27] (current) – [Coupon Codes] foxybrett
Line 137: Line 137:
 </code> </code>
  
-**From Example**+**Form Example**
 <code> <code>
 <form action="https://YOURSTORE.foxycart.com/cart" method="post"> <form action="https://YOURSTORE.foxycart.com/cart" method="post">
Line 171: Line 171:
   : The name displayed in the cart, once a coupon has been added. For example, "Loyal Customer 20% Off Coupon". This allows both the customer and store admin to easily see what coupon has been applied to their cart.   : The name displayed in the cart, once a coupon has been added. For example, "Loyal Customer 20% Off Coupon". This allows both the customer and store admin to easily see what coupon has been applied to their cart.
   ; Coupon Code   ; Coupon Code
-  : This is the "coupon" itself; the actual text that is distributed by the merchant and entered by the customer. This should be alphanumeric, but care should be taken to ensure it's easily readable (ie. 0 versus O, 1 versus l versus I, etc.). Coupon codes are case insensitive, so ''MyCoupon1'', ''MYCOUPON1'' and ''mycoupon1'' are all considered the same.+  : This is the "coupon" itself; the actual text that is distributed by the merchant and entered by the customer. Codes can include letters and numbers, as well as ''-'', ''_'' and ''.'', to a maximum of 50 characters, but care should be taken to ensure it's easily readable (ie. 0 versus O, 1 versus l (lowercase L) versus I (uppercase i), etc.). Coupon codes are case insensitive, so ''MyCoupon1'', ''MYCOUPON1'' and ''mycoupon1'' are all considered the same.
   ; Coupon Variations   ; Coupon Variations
   : FoxyCart allows for a single coupon code to be defined, but to generate multiple distinct coupon variations (up to 100 at a time). This allows for easy creation of multiple unique codes, all with identical discount options, which can be very useful for mail merges or other coupon distribution where any individual coupon code may only have 1 single use, but you may need dozens or hundreds (or thousands).   : FoxyCart allows for a single coupon code to be defined, but to generate multiple distinct coupon variations (up to 100 at a time). This allows for easy creation of multiple unique codes, all with identical discount options, which can be very useful for mail merges or other coupon distribution where any individual coupon code may only have 1 single use, but you may need dozens or hundreds (or thousands).
Line 197: Line 197:
   : Similar to the category quantity discounts, but can be applied to multiple or all categories. So if a coupon code only applies to the T-Shirt category and there are no T-Shirts in the cart, no discount will be applied.   : Similar to the category quantity discounts, but can be applied to multiple or all categories. So if a coupon code only applies to the T-Shirt category and there are no T-Shirts in the cart, no discount will be applied.
   ; Restrict Usage by Product Code   ; Restrict Usage by Product Code
-  : If you want to limit which products can use this coupon, you can enter a comma separated listed of product codes or partial product codes using ''*'' as a wild card at the beginning or end of the value. So ''abc123'', ''fun_*'', ''*-small'' would match ''abc123'', ''fun_'' and ''fun_times'', and ''example-small''. It wouldn't match ''abc12'', ''abc1234'', ''fun'', or ''good-smalls''. If a code starts with ''-'' it will be considered as a blacklist instead, matching everything except products that match that code. For example ''-*-small'' would match every product that does not have a code that ends in ''-small''Whitelists and blacklists can also be combined, ''foo*, -foobar'' would match all products that begin with ''foo'' except any products with a code of ''foobar''. Currently restricted to a maximum length of 5000 characters.+  : If you want to limit which products can use this coupon, you can enter a comma separated listed of product codes or partial product codes using ''*'' as a wild card at the beginning and/or end of the value. So ''abc123'', ''fun_*'', ''*-small'' would match ''abc123'', ''fun_'' and ''fun_times'', and ''example-small''. It wouldn't match ''abc12'', ''abc1234'', ''fun'', or ''good-smalls''. If a code starts with ''-'' it will be considered as a block instead, matching everything except products that match that code. For example ''-*-small'' would match every product that does not have a code that ends in ''-small''Allow lists and block lists can also be combined, ''foo*, -foobar'' would match all products that begin with ''foo'' except any products with a code of ''foobar''. Currently restricted to a maximum length of 5000 characters
 +  ; Restrict by Item Options 
 +  : You may have arbitrary item options (like ''brand'', ''publisher'', ''size'', ''location'', etc.) that determine what type of discount to apply. Using this setting, you can restrict coupons using similar logic as the "restrict usage by product code" above. Instead of a single comma-separated list of values to match against, input here is per item option. Wildcards can be used in option //values// but not option //names//
 +  : The functionality is only available in the new admin and via the API. 
 +  : Though not technically item options, the following native item values can also be matched against: ''name'', ''parent_code'', ''url'', ''image'', ''sub_frequency''.
   ; # of Uses (Total)   ; # of Uses (Total)
   : If you want to limit the number of uses this coupon as a whole can be used, enter a number here. If, for example, only the first 50 customers can use the coupon, enter 50 here. This relates to coupon variants and the number of uses per code (below). If you have 1 coupon code and 10 uses, the coupon will not be able to be used after 10 successful transactions. If you have 1 coupon with 100 variants but only 50 uses, only the first 50 uses will be allowed, regardless of the number of uses per code.   : If you want to limit the number of uses this coupon as a whole can be used, enter a number here. If, for example, only the first 50 customers can use the coupon, enter 50 here. This relates to coupon variants and the number of uses per code (below). If you have 1 coupon code and 10 uses, the coupon will not be able to be used after 10 successful transactions. If you have 1 coupon with 100 variants but only 50 uses, only the first 50 uses will be allowed, regardless of the number of uses per code.
Line 208: Line 212:
 For the three options that limit a coupon based on usage (either in total, or by code or customer), a coupon is only considered used if it applies an actual discount on the transaction. This means for subscriptions that have a future start date, making their initial transaction $0, that won't count towards the usage for a coupon.  For the three options that limit a coupon based on usage (either in total, or by code or customer), a coupon is only considered used if it applies an actual discount on the transaction. This means for subscriptions that have a future start date, making their initial transaction $0, that won't count towards the usage for a coupon. 
 </WRAP> </WRAP>
 +
 +<WRAP center round info 90%>
 +**Selling subscriptions with the PayPal Express Checkout (Legacy) integration?** Limitations on changes that are possible to subscriptions managed by PayPal mean that coupons that only apply for a certain number of uses (either by dates or number of uses for the coupon, code or customer) won't behave as expected for legacy PayPal subscriptions. While the coupon will be removed within Foxy, the customer will continue to be charged the discounted amount by PayPal as they were from their first charge. We don't recommend utilising limited usage coupons with PayPal Express Checkout (Legacy) based subscriptions.
 +</WRAP>
 +
 +===== Tax-Inclusive Pricing with Coupons & Discounts =====
 +
 +Coupons and discounts get a little trickier, and how you want coupons to work in the context of [[./taxes|tax-inclusive pricing]] isn't as obvious or globally agreed-upon as you might hope. (Please read the docs on that page first, if you haven't, as it has important context for this section of our documentation.) In particular, percentage-based discounts are generally "easy", but set-amount discounts may require a few minutes to understand.
 +
 +This is easiest to communicate by way of example. Assume an $100 (tax-exclusive) product ($110 tax-inclusive price), a 10% tax (inclusive), and a $15 coupon. Take a look at this table, and note the <wrap tip>tips</wrap> and <wrap important>warning</wrap>:
 +
 +^ **Scenario**                  ^ **#1**                ^ **#2**                ^ **#3**                ^ **#4**                ^ **#5**                ^  
 +| **Template Set**              | Tax-Exclusive         | Tax-Exclusive         | Tax-Inclusive         | Tax-Inclusive         | Tax-Inclusive         |
 +| **Item Price (displayed)**    | 100.00€               | 100.00€               | 110.00€               | 110.00€               | 110.00€               |
 +| **Item Price (actual)**       | 100.00€               | 100.00€               | 100.00€               | 100.00€               | 100.00€               |
 +|                                                                                                                                             |
 +| **Coupon's ''is_taxable''**   | false                 | true                  | false                 | false                 | true                  |
 +| **Coupon's ''inclusive_tax_rate''** | 0               | 0                     | <wrap tip>0</wrap>    | <wrap tip>0.10</wrap> | 0                     |
 +| **Coupon Discount (actual)**  | 15.00€                | 15.00€                | 15.00€                | 15.00€                | 15.00€                |
 +| **Coupon Discount (displayed)** | 15.00€              | 15.00€                | 15.00€                | <wrap tip>13.64€</wrap> | 15.00€              |
 +|                                                                                                                                             |
 +| **Item Price, post coupon (not displayed)** | 85.00€  | 85.00€                | 95.00€                | 95.00€                | 95.00€                |
 +| **Item Price, post coupon (actual)**        | 85.00€  | 85.00€                | 85.00€                | 86.36€                | 85.00€                |
 +|                                                                                                                                             |
 +| **Tax**                       | 8.50€                 | 10.00€                | 8.50€                 | <wrap tip>8.64€</wrap> | 10.00€               |
 +|                                                                                                                                             |
 +| **Order Total**               | 93.50€                | 95.00€                | <wrap important>93.50€</wrap> | 95.00€             | 95.00€                |
 +
 +The three settings to note are:
 +  - The template set's tax inclusive setting.
 +  - The coupon's "taxable" setting. In some industries or situations, a discount might be "after tax". For instance, say you want to offer customers 100% off, but you still need to collect tax for the full sale amount. Set the coupon to taxable and the tax will be applied //before// the coupon's discount is applied.
 +  - The coupon's "inclusive tax rate" value. This gets a little more complicated, but if you compare scenario #3 and #4 above, you can see the impact. Setting a coupon's ''inclusive_tax_rate'' will decrease the //applied// (but not //displayed//) discount by that inclusive tax percentage. So a 15€ coupon becomes ''15 / 1.1 = 13.64''. The end result is a 15€ "tax-inclusive" discount, as you can see in the Order Total row.
 +    * <wrap tip>This is only important for "discount by an amount" coupons, not for "discount by a percentage" coupons, as %-based coupons will result in the correct order total regardless tax-inclusive or tax-exclusive settings.
 +    * Scenario #3 shows what would happen without an inclusive tax rate. (It behaves identically to scenario #1, which is tax-exclusive.) 
 +    * The inclusive tax rate should be the default tax rate for the customers who'll use the coupon. This ensures your coupon is always for the expected amount, even if a customer's tax rate is different. This also prevents tax-exempt customers from receiving a higher-than-desired discount.
 +    * The inclusive tax rate functionality behaves identicaly regardless the tax-inclusive or taxable settings, but it's generally only useful in the tax-inclusive scenarios.
 +
 +
 +
 +<WRAP round tip>**We'd love to hear from you.** Please [[https://foxy.io/contact|send us a quick note]] if you have a requirement with taxes and coupons that's not covered here, along with your country and industry.</WRAP>
 +
 +<WRAP round important>**This topic can be complicated.** One of our team (in Paris) went through their receipts and pulled 3 of their orders from non-Foxy merchants, and we found each of their transactions mapped to scenarios 3, 4, and 5. If you're unsure which of the above approaches make sense to you, please contact your tax professional for what will surely be an exhilarating conversation. :)</WRAP>
  
 ===== Notes ===== ===== Notes =====
   * **Time and dates are relative to your store's timezone settings.**   * **Time and dates are relative to your store's timezone settings.**
   * The coupon code entry block is hidden from the cart unless the store has at least one valid coupon, where "valid" means "applicable here and now".   * The coupon code entry block is hidden from the cart unless the store has at least one valid coupon, where "valid" means "applicable here and now".
 +  * If a customer attempts to complete a transaction with a coupon that has since become invalid (for example if another customer has since completed a purchase with it, causing the maximum uses limit to be met), then the customer will be sent back to the checkout with the coupon removed and an error message (checkout language string for ''error coupon'' if you want to customise it).
 +==== Tracking $0 coupons as used ====
 +
 +By default, only those coupons that apply an actual discount to the cart are tracked as used on completed transactions. This means that if you have a coupon set with a discount tier like ''1-0'', that won't be tracked as used on the transaction once completed, and won't count against usage restrictions.
 +
 +To track $0 coupons, you can set up the tier as ''0-0'' instead, and these coupons, even though they don't apply a discount, will be tracked as used. They will also be counted against any usage restrictions in place for the coupon as well.
 +
 ==== General Discount Notes ==== ==== General Discount Notes ====
  

Site Tools