Coupons & Add to Cart by URL Links for WooCommerce – Shortcodes Guide
These shortcodes allow you to apply discount coupons via URL, customize coupon notices, and enhance the overall user experience. The shortcodes are categorized into Free and Pro versions to help you better understand their functionalities.
Free Version Shortcodes
- [alg_wc_url_coupons_print_notices]
- Description: Displays coupon-related notices on the frontend. This shortcode is useful for showing messages about coupon application status, such as “Coupon applied successfully” or “Invalid coupon code.”
- Parameters:
- none (No parameters available for this shortcode).
- Example Usage:
[alg_wc_url_coupons_print_notices]
- Use Case: Place this shortcode on pages where you want to display WooCommerce coupon notices, ensuring customers are informed about the success or failure of their coupon application.
- [alg_wc_url_coupons_translate]
- Description: Allows translation of coupon-related messages when using WPML or Polylang for multilingual setups. This shortcode ensures that coupon notices are displayed in the correct language for each user.
- Parameters:
- lang: The language code (e.g., en, fr).
- Example Usage:
[alg_wc_url_coupons_translate lang="fr"]
- Use Case: Use this shortcode to translate coupon messages on your WooCommerce store, providing a seamless experience for customers in different languages.
Pro Version Shortcodes
- [alg_wc_url_coupons_auto_apply]
- Description: Automatically applies a specific coupon when a user visits the URL containing this shortcode. This shortcode simplifies the process by removing the need for manual coupon entry.
- Parameters:
- coupon_code: The coupon code to apply automatically.
- redirect_url: The URL to redirect the user to after applying the coupon.
- Example Usage:
[alg_wc_url_coupons_auto_apply coupon_code="SUMMER20" redirect_url="/cart"]
- Use Case: Share URLs in marketing campaigns that automatically apply a discount coupon and redirect the user to the cart or checkout page.
- [alg_wc_url_coupons_custom_notice]
- Description: Displays a custom notice when a specific coupon is applied. This shortcode allows you to override the default WooCommerce coupon notices and provide tailored messages.
- Parameters:
- coupon_code: The coupon code to customize the notice for.
- notice_text: The custom message to display.
- Example Usage:
[alg_wc_url_coupons_custom_notice coupon_code="SUMMER20" notice_text="Enjoy your 20% discount!"]
- Use Case: Use this shortcode to provide personalized messages for specific coupon codes, enhancing the user experience.
- [alg_wc_url_coupons_redirect_after_apply]
- Description: Redirects the user to a specific URL after applying a coupon. This shortcode is useful for guiding users to specific pages, such as checkout, after their coupon has been applied.
- Parameters:
- coupon_code: The coupon code to trigger the redirect.
- redirect_url: The URL to redirect the user to.
- Example Usage:
[alg_wc_url_coupons_redirect_after_apply coupon_code="FREEDELIVERY" redirect_url="/checkout"]
- Use Case: Automatically send users to the checkout page after applying a free delivery coupon, streamlining the purchase process.
These shortcodes provide a powerful way to enhance the functionality of WooCommerce coupons, making it easier for customers to apply discounts and for you to manage promotional campaigns. The Free version covers basic needs, while the Pro version offers advanced options like auto-apply coupons, custom notices, and redirects, enabling more sophisticated marketing strategies.