WP SITES

3082 Coded Tutorials & 284 Plugins

Product Giveaway Manager for WooCommerce

(2 customer reviews)
$75.00

This plugin enables you to manage a giveaway for WooCommerce products. The plugin adds a page named Giveaway to your WordPress Dashboard for settings you can use to control and manage your product giveaway using coupon codes.

Fields added include :

  • User Profile Fields : Show “Number of Children” field on user profiles
    Enable this to add a field for tracking the number of children for each user. Includes a field for birthdate.
  • User Profile Fields : Show “Number of Children” field on user profiles
    Enable this to add a field for tracking the number of children for each user.
  • Email Subject : Available variables: {site_name}, {user_name}
  • Email Message : Email Subject Available variables: {site_name}, {user_name}
  • Coupon Prefix : Available variables: {site_name}, {user_name}
  • Coupon Expiry ( Days ) : Number of days until coupons expire (0 for no expiry)
  • Free Shipping : Number of days until coupons expire (0 for no expiry)
  • Coupon Code Format : Number of days until coupons expire (0 for no expiry)
  • Coupon Restrictions : Number of days until coupons expire (0 for no expiry)
  • Quantity Settings : Hide quantity field and force quantity to 1. When enabled, the quantity field will be hidden and all items will be added with a quantity of 1.
  • Address & Profile Restrictions : Disable editing of billing/shipping addresses and user profile data. When enabled, users will not be able to edit their billing/shipping addresses or profile information in WordPress and WooCommerce.
  • Email Settings : Disable editing of billing/shipping addresses and user profile data. When enabled, users will not be able to edit their billing/shipping addresses or profile information in WordPress and WooCommerce.
  • User Registration : Disable editing of billing/shipping addresses and user profile data. When enabled, users will not be able to edit their billing/shipping addresses or profile information in WordPress and WooCommerce.
  • Coupon Generation : Disable editing of billing/shipping addresses and user profile data. When enabled, users will not be able to edit their billing/shipping addresses or profile information in WordPress and WooCommerce.
  • Site Access : Make entire site private (login required). When enabled, all pages and content will require login to view. The login page will remain accessible.
  • Login Time Restrictions : Includes Start and End times to set the time range when users are allowed to log in. Leave both fields empty to allow login at any time.
  • Shop Manager User Creation : Allow shop managers to create new users. When enabled, shop managers can create new users with selected roles. Allowed roles for new users: Subscriber & Customer.
  • Generate Coupons for Users : Select users to generate coupons based on user role. 

And these fields can be added on the User Profile page :

The plugin includes settings to configure, generate and email coupon codes automatically to users based on any/all user roles.

All eCommerce pages including shop, product, cart and checkout pages are hidden for logged out users.

Only logged in users with coupons can checkout products.

Usage

  • In your WordPress Dashboard, under the WooCommerce and Products Tab, you’ll find a new menu item named Giveaway. Configure the settings on this page and test the coupon email. You might need to use a SMTP plugin if testing locally.

Note : Remember to go to WooCommerce > Settings > General and Enable coupons.

Once you have generated the coupons, you can go to Marketing coupons and configure any settings for usage limits and restrictions per coupon.

Video Demo

Shows a customer logging in and completing checkout for 1 product using a coupon code emailed after coupon generation by the admin or shop manager.

Match Children Count to Coupons

New features for matching number if children to number of coupons generated and emailed include :

  • Added a new setting giveaway_manager_match_children_count to control whether the number of coupons should match the user’s number of children.
  • Added a new checkbox in the settings page that allows administrators to enable/disable this feature.
  • Modified the coupon generation logic to :
  • Check if the “match children count” setting is enabled
  • If enabled, get the user’s number of children and use that as the number of coupons to generate
  • If disabled, use the default number of coupons per user setting
  • Added a max(1, intval($number_of_children)) to ensure at least one coupon is generated even if the user has 0 children
  • Updated the description text to make it clear how the two settings work together.
  • Now when generating coupons :
  • If “Match number of coupons to user’s number of children” is checked, each user will receive a number of coupons equal to their number of children (minimum 1)
  • If unchecked, each user will receive the number of coupons specified in the “Number of coupons to generate per user” field
  1. Plugin Structure:
    • Main plugin file: giveaway.php
    • Core class: WC_Giveaway_Manager
    • Dependencies: WooCommerce, WordPress core
  2. Hooks and Filters:
    • Actions:
      • template_redirect – Site access control
      • login_init – Login time restrictions
      • admin_init – Shop manager capabilities setup
      • admin_menu – Admin menu registration
      • wp_ajax_generate_coupons – Coupon generation AJAX handler
      • wp_ajax_get_coupon_stats – Coupon statistics AJAX handler
      • wp_ajax_get_coupon_list – Coupon list AJAX handler
      • wp_ajax_delete_coupon – Coupon deletion AJAX handler
      • wp_ajax_export_coupons – Coupon export AJAX handler
      • wp_nav_menu_items – Login/logout menu items
  3. Settings and Options:
    • giveaway_manager_coupons_per_user – Number of coupons per user
    • giveaway_manager_shop_manager_access – Shop manager access control
    • giveaway_manager_site_private – Site-wide privacy setting
    • giveaway_manager_login_start_time – Login restriction start time
    • giveaway_manager_login_end_time – Login restriction end time
    • giveaway_manager_shop_manager_user_creation – Shop manager user creation permission
    • giveaway_manager_allowed_user_roles – Allowed roles for shop manager user creation
  4. Capabilities:
    • Required capabilities for different roles:
      • Administrator: manage_options
      • Shop Manager: manage_woocommerce (when enabled)
  5. AJAX Endpoints:
    • /wp-admin/admin-ajax.php with actions:
      • generate_coupons
      • get_coupon_stats
      • get_coupon_list
      • delete_coupon
      • export_coupons
  6. Security Features:
    • Nonce verification for all AJAX requests
    • Role-based access control
    • Time-based login restrictions
    • Site-wide privacy controls
    • User creation restrictions
  7. Database Tables:
    • wp_giveaway_coupons – Stores coupon information
    • wp_giveaway_coupon_usage – Tracks coupon usage
  8. User Management:
    • Shop manager user creation capabilities
    • Role restriction system
    • Login time restrictions
  9. Coupon System:
    • Generation parameters:
      • Prefix
      • Length
      • Quantity
      • Expiry date
      • Usage limit
      • Minimum spend
      • Maximum spend
      • Individual use
      • Exclude sale items
      • Product restrictions
      • Category restrictions
  10. Export Features:
    • CSV export format
    • Exportable fields:
      • Code
      • Status
      • Created date
      • Expiry date
      • Usage count
      • Usage limit
      • Minimum spend
      • Maximum spend
      • Individual use
      • Exclude sale items
      • Product restrictions
      • Category restrictions
  11. Integration Points:
    • WooCommerce integration
    • WordPress menu system
    • WordPress user system
    • WordPress role system
  12. Error Handling:
    • AJAX error responses
    • Permission checks
    • Data validation
    • Database error handling

2 reviews for Product Giveaway Manager for WooCommerce

  1. Stephen (verified owner)

    Great support and responsiveness, Brad was able to make some adaptations to his plugin to make it do exactly what we needed it to do for this project. We are very happy with the plugin and Brad’s support, highly recommend.

  2. James (verified owner)

    Great plugin and best support I have had in ages
    I contacted Brad when I started a project to give gifts to children for Christmas
    His plugin had most of the functions we were looking for and he quickly added a few more
    The result is great, we are all very happy with the plugin and the help from Brad to make this project go smoothly
    I highly recommend Brad for any custom work you need
    James

Only logged in customers who have purchased this product may leave a review.

Contact Us If You Have Any Questions

Go back

Your message has been sent

Warning
Warning
Warning
Warning.