Skip to content

PHP Code For WooCommerce Custom Coupon Generation Programmatically

Notifications You must be signed in to change notification settings

MrEbabi/Woocommerce-Dynamic-Coupon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

Kindly check "generate coupon" code.

Description: The function named generateCoupon() is a code block that programmatically generates a coupon based on cart products * with this function you can generate a dynamic coupon * example: * coupon name: testcoupon * amount: will be calculated for every cart click dynamically * assume you have 15% discount for products in category A, so sale prices are calculated for those products * and you have 10% discount for products in category B, so sale prices are also calculated for those products * and you have some other categories or products with no discounts * but you also want that some special customers to use a coupon with 25% discount from the regular price of all products * you may edit this code to make better/smarter discount coupons

Add those codes to functions.php file of your theme. Please be aware that if you are not using a child theme, after every update your customizations in your theme files will be deleted.


Source code will be updated as a plugin later.

About

PHP Code For WooCommerce Custom Coupon Generation Programmatically

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages