Add coupon products to the cart automatically by URL #
Adding coupon products to the cart by URL lets a single link both apply a “Fixed product discount” coupon and drop the matching products straight into the customer’s cart, so they land on a ready-to-checkout cart with the discount already showing. This is a Pro feature of Coupons & Add to Cart by URL Links for WooCommerce.
Before you start #
- WooCommerce, active.
- URL Coupons Pro (this option is disabled in the free version).
- A coupon whose discount type is Fixed product discount, with one or more products set under the coupon’s Usage restriction > Products.
The feature only acts on Fixed product discount coupons. For percentage or fixed cart coupons there are no specific products to add, so nothing is added to the cart.
Step-by-step setup #
- Go to WPFactory > Coupons by URL (also reachable at WooCommerce > Settings > URL Coupons).
- Stay on the General sub-tab.
- Find Add products to cart and tick Enable.
- Optionally tick Empty cart to clear the cart before the coupon’s products are added, so only the promoted items remain.
- Click Save changes.
Now share a coupon URL such as https://yourstore.com/?alg_apply_coupon=FREEGIFT. When a customer opens it, the coupon is applied and its linked products are added to the cart.
Options reference #
| Label | Option ID | Default | Free/Pro |
|---|---|---|---|
| Add products to cart (Enable) | alg_wc_url_coupons_fixed_product_discount_add_products |
No | Pro |
| Empty cart | alg_wc_url_coupons_fixed_product_discount_add_products_emptycart |
No | Pro |
How it behaves #
- Only products listed on the coupon are added, and only if they are not already in the cart.
- If Empty cart is on, the whole cart is cleared first, then the coupon’s products are added. Use this when you want the customer to focus on the promoted items only.
- If coupons are globally disabled in WooCommerce, nothing is added.
Use cases #
- A “buy this bundle at a fixed discount” campaign link that pre-loads the bundle.
- A free-gift promotion where the gift product is added and discounted to zero by a fixed product coupon.
- An influencer or email link that takes a first-time visitor to a cart that is already built and discounted.
Troubleshooting #
- Products are not added. Confirm the coupon’s discount type is Fixed product discount and that it lists products under Usage restriction > Products. Other coupon types do not add products.
- The cart still shows old items. Enable Empty cart if you want the cart cleared before the coupon products are added.
- The discount does not show for guests. Leave Session > Force session start enabled so guest sessions can hold the coupon. See the guide on making URL coupons work for guests and cached sites.
Ready to set this up? #
This is a Pro feature of URL Coupons. If you are still on the free version, upgrading takes a couple of minutes and unlocks this along with per-coupon redirects and custom notices. Get URL Coupons Pro.