Plugin Directory

Changeset 3266353


Ignore:
Timestamp:
04/03/2025 12:30:27 PM (11 months ago)
Author:
sormano
Message:

Version 1.3.0

Location:
coupon-generator-for-woocommerce
Files:
2 deleted
11 edited
2 copied

Legend:

Unmodified
Added
Removed
  • coupon-generator-for-woocommerce/tags/1.3.0/assets/css/woocommerce-coupon-generator-admin.min.css

    r2538010 r3266353  
    1 .steps .step{background:#8b8e94;padding:10px 20px;color:white;width:calc( ( 100% - ( 68px * 4 ) ) / 4);display:inline-block;margin-right:20px;margin-left:0px;font-weight:bold;font-size:14px;white-space:nowrap}.steps .step a{color:white;text-decoration:none}.steps .step a:focus{box-shadow:none}.steps .step.active{background:#e33a3d;border-left-color:#e33a3d}.steps .step:after{content:"";width:0px;height:0px;border-top:20px solid rgba(0,0,0,0);border-bottom:20px solid rgba(0,0,0,0);border-left:20px solid #8b8e94;float:right;position:relative;margin:-10px -40px}.steps .step:before{content:"";width:0px;height:0px;border-top:20px solid #8b8e94;border-bottom:20px solid #8b8e94;border-left:20px solid rgba(0,0,0,0);float:left;position:relative;margin:-10px -40px}.steps .step.active:after{border-left-color:#e33a3d}.steps .step.active:before{border-top-color:#e33a3d;border-bottom-color:#e33a3d}.steps .step.step-0{margin-left:20px}.wc-coupon-generator-wrap .continue-button-wrap{float:right}.wc-coupon-generator-wrap .continue-button-wrap:focus{box-shadow:none}.wc-coupon-generator-wrap .continue-button-wrap:hover .continue-button{background:#C12123}.wc-coupon-generator-wrap .continue-button-wrap:hover .continue-button:before{border-top-color:#C12123;border-bottom-color:#C12123}.wc-coupon-generator-wrap .continue-button-wrap:hover .continue-button:after{border-right-color:#C12123;border-left-color:#C12123}.wc-coupon-generator-wrap .continue-button-wrap .wccg-next{background:#E33A3D;border:none;color:#FFF;padding:10px 30px;height:18px;line-height:18px;position:relative;display:inline-block;margin-left:20px;margin-right:20px;font-weight:bold;font-size:14px;text-decoration:none}.wc-coupon-generator-wrap .continue-button-wrap .wccg-next:after{content:"";width:0px;height:0px;border-top:19px solid rgba(0,0,0,0);border-bottom:19px solid rgba(0,0,0,0);border-left:19px solid #E33A3D;position:relative;float:right;margin:-10px -49px;padding:0px;line-height:0}.wc-coupon-generator-wrap .continue-button-wrap .wccg-next:before{content:"";width:0px;height:0px;border-top:19px solid #E33A3D;border-bottom:19px solid #E33A3D;border-left:19px solid rgba(0,0,0,0);float:left;position:relative;margin:0;margin:-10px -49px}.wc-coupon-generator-wrap.wc-coupon-generator-wrap-step-2 #wc-coupon-generator-options{float:left;width:80%}.wc-coupon-generator-wrap.wc-coupon-generator-wrap-step-2 #wc-coupon-generator-options .inside{padding:0;margin:0}.wc-coupon-generator-wrap.wc-coupon-generator-wrap-step-3 .wc-coupon-generator-progress-bar{width:calc( 100% - 50px);height:30px;border:1px solid #DDD;position:relative;display:inline-block}.wc-coupon-generator-wrap.wc-coupon-generator-wrap-step-3 .wc-coupon-generator-progress-bar .wc-coupon-generator-progress-percentage{text-align:center;line-height:30px;z-index:10;position:relative;font-weight:bold;position:absolute;width:100%}.wc-coupon-generator-wrap.wc-coupon-generator-wrap-step-3 .wc-coupon-generator-progress-bar .progress{width:0%;height:30px;display:inline-block;background-color:#E33A3D;position:absolute;z-index:15;overflow:hidden;-webkit-transition:width 1s ease-in-out;-moz-transition:width 1s ease-in-out;-o-transition:width 1s ease-in-out;transition:width 1s ease-in-out}.wc-coupon-generator-wrap.wc-coupon-generator-wrap-step-3 .wc-coupon-generator-progress-bar .progress .inner-progress{position:absolute;color:#FFF;z-index:15;text-align:center;display:block;height:30px;line-height:31px;-webkit-transition:none;-moz-transition:none;-o-transition:none;transition:none}.wc-coupon-generator-wrap.wc-coupon-generator-wrap-step-3 .spinner{float:right;margin:5px 10px}.wc-coupon-generator-wrap.wc-coupon-generator-wrap-step-3 pre.wc-coupon-generator-progress-messages{background:#F5F5F5;padding:12px;max-height:300px;overflow:scroll}
     1.steps .step{background:#8b8e94;padding:10px 20px;color:#fff;width:calc((100% - 272px)/4);display:inline-block;margin-right:20px;margin-left:0px;font-weight:bold;font-size:14px;white-space:nowrap}.steps .step a{color:#fff;text-decoration:none}.steps .step a:focus{box-shadow:none}.steps .step.active{background:#e33a3d;border-left-color:#e33a3d}.steps .step:after{content:"";width:0px;height:0px;border-top:20px solid rgba(0,0,0,0);border-bottom:20px solid rgba(0,0,0,0);border-left:20px solid #8b8e94;float:right;position:relative;margin:-10px -40px}.steps .step:before{content:"";width:0px;height:0px;border-top:20px solid #8b8e94;border-bottom:20px solid #8b8e94;border-left:20px solid rgba(0,0,0,0);float:left;position:relative;margin:-10px -40px}.steps .step.active:after{border-left-color:#e33a3d}.steps .step.active:before{border-top-color:#e33a3d;border-bottom-color:#e33a3d}.steps .step.step-0{margin-left:20px}.wc-coupon-generator-wrap .continue-button-wrap{float:right}.wc-coupon-generator-wrap .continue-button-wrap:focus{box-shadow:none}.wc-coupon-generator-wrap .continue-button-wrap:hover .continue-button{background:#c12123}.wc-coupon-generator-wrap .continue-button-wrap:hover .continue-button:before{border-top-color:#c12123;border-bottom-color:#c12123}.wc-coupon-generator-wrap .continue-button-wrap:hover .continue-button:after{border-right-color:#c12123;border-left-color:#c12123}.wc-coupon-generator-wrap .continue-button-wrap .wccg-next{background:#e33a3d;border:none;color:#fff;padding:10px 30px;height:18px;line-height:18px;position:relative;display:inline-block;margin-left:20px;margin-right:20px;font-weight:bold;font-size:14px;text-decoration:none}.wc-coupon-generator-wrap .continue-button-wrap .wccg-next:after{content:"";width:0px;height:0px;border-top:19px solid rgba(0,0,0,0);border-bottom:19px solid rgba(0,0,0,0);border-left:19px solid #e33a3d;position:relative;float:right;margin:-10px -49px;padding:0px;line-height:0}.wc-coupon-generator-wrap .continue-button-wrap .wccg-next:before{content:"";width:0px;height:0px;border-top:19px solid #e33a3d;border-bottom:19px solid #e33a3d;border-left:19px solid rgba(0,0,0,0);float:left;position:relative;margin:0;margin:-10px -49px}.wc-coupon-generator-wrap.wc-coupon-generator-wrap-step-2 #wc-coupon-generator-options{float:left;width:80%}.wc-coupon-generator-wrap.wc-coupon-generator-wrap-step-2 #wc-coupon-generator-options .inside{padding:0;margin:0}.wc-coupon-generator-wrap.wc-coupon-generator-wrap-step-3 .wc-coupon-generator-progress-bar{width:calc(100% - 50px);height:30px;border:1px solid #ddd;position:relative;display:inline-block}.wc-coupon-generator-wrap.wc-coupon-generator-wrap-step-3 .wc-coupon-generator-progress-bar .wc-coupon-generator-progress-percentage{text-align:center;line-height:30px;z-index:10;position:relative;font-weight:bold;position:absolute;width:100%}.wc-coupon-generator-wrap.wc-coupon-generator-wrap-step-3 .wc-coupon-generator-progress-bar .progress{width:0%;height:30px;display:inline-block;background-color:#e33a3d;position:absolute;z-index:15;overflow:hidden;-webkit-transition:width 1s ease-in-out;-moz-transition:width 1s ease-in-out;-o-transition:width 1s ease-in-out;transition:width 1s ease-in-out}.wc-coupon-generator-wrap.wc-coupon-generator-wrap-step-3 .wc-coupon-generator-progress-bar .progress .inner-progress{position:absolute;color:#fff;z-index:15;text-align:center;display:block;height:30px;line-height:31px;-webkit-transition:none;-moz-transition:none;-o-transition:none;transition:none}.wc-coupon-generator-wrap.wc-coupon-generator-wrap-step-3 .spinner{float:right;margin:5px 10px}.wc-coupon-generator-wrap.wc-coupon-generator-wrap-step-3 pre.wc-coupon-generator-progress-messages{background:#f5f5f5;padding:12px;max-height:300px;overflow:scroll}
  • coupon-generator-for-woocommerce/tags/1.3.0/assets/js/woocommerce-coupon-generator-admin.min.js

    r2538010 r3266353  
    1 "use strict";var WCCG_Generator={init:function(){this.generate_coupons(0,this)},generate_coupons:function(e,r){var t={action:"wccg_generate_coupons",form_data:jQuery(".wccg-wrap :input").serialize(),batch_step:e};jQuery.post(ajaxurl,t,function(e){(e=JSON.parse(e)).message&&r.add_message(e.message),"done"==e.step?r.completed(r,parseInt(jQuery('[name="number_of_coupons"]').val()),e.total_coupons_generated):r.generate_coupons(e.step,r),r.progress_bar(e.progress)})},progress_bar:function(e){jQuery(".wc-coupon-generator-progress-bar .progress").css("width",e+"%"),jQuery(".wc-coupon-generator-progress-percentage").html(e+"%"),jQuery(".inner-progress").css("width",jQuery(".wc-coupon-generator-progress-bar").width())},completed:function(e,r,t){jQuery(".wc-coupon-generator-progress-bar + .spinner").remove(),jQuery(".wc-coupon-generator-completed-actions").show();var o=jQuery(".wc-coupon-generator-completed-actions");o.show(),o.html(o.html().replace(/{{ couponGenerator.quantity }}/,r));var s=o.find("a");console.log(s.attr("href").replace("quantity","quantity="+r)),s.attr("href",s.attr("href").replace("quantity","quantity="+r))},add_message:function(e){jQuery(".wc-coupon-generator-progress-messages").prepend('<span class="wc-coupon-generator-progress-message">'+e+"</span><br/>")}};!function(o){o(".wccg-next").on("click",function(e){var r=o(".active-step"),t=r.next();r.removeClass("active-step").addClass("hidden"),t.removeClass("hidden").addClass("active-step"),o(".step.active").removeClass("active").next().addClass("active")}),o(".wccg-start").on("click",function(e){WCCG_Generator.init()})}(jQuery);
     1"use strict";var WCCG_Generator={init:function(){this.generate_coupons(0,this)},generate_coupons:function(e,r){var s={action:"wccg_generate_coupons",form_data:jQuery(".wccg-wrap :input").serialize(),batch_step:e};jQuery.post(ajaxurl,s,function(e){(e=JSON.parse(e)).message&&r.add_message(e.message),"done"==e.step?r.completed(r,parseInt(jQuery('[name="number_of_coupons"]').val()),e.total_coupons_generated):r.generate_coupons(e.step,r),r.progress_bar(e.progress)})},progress_bar:function(e){jQuery(".wc-coupon-generator-progress-bar .progress").css("width",e+"%"),jQuery(".wc-coupon-generator-progress-percentage").html(e+"%"),jQuery(".inner-progress").css("width",jQuery(".wc-coupon-generator-progress-bar").width())},completed:function(e,r,s){jQuery(".wc-coupon-generator-progress-bar + .spinner").remove(),jQuery(".wc-coupon-generator-completed-actions").show();var o=jQuery(".wc-coupon-generator-completed-actions");o.show(),o.html(o.html().replace(/{{ couponGenerator.quantity }}/,r));var t=o.find("a");t.attr("href",t.attr("href").replace("quantity","quantity="+r))},add_message:function(e){jQuery(".wc-coupon-generator-progress-messages").prepend('<span class="wc-coupon-generator-progress-message">'+e+"</span><br/>")}};!function(o){o(".wccg-next").on("click",function(e){var r=o(".active-step"),s=r.next();r.removeClass("active-step").addClass("hidden"),s.removeClass("hidden").addClass("active-step"),o(".step.active").removeClass("active").next().addClass("active")}),o(".wccg-start").on("click",function(e){WCCG_Generator.init()})}(jQuery);
  • coupon-generator-for-woocommerce/tags/1.3.0/includes/admin/views/html-coupon-generator-step-1.php

    r2538010 r3266353  
    3636                                'post_title'  => 'temp_generator_coupon',
    3737                            ) );
    38                             global $thepostid;
     38                            global $thepostid, $post;
    3939                            $thepostid = $temp_coupon;
    40                             WC_Meta_Box_Coupon_Data::output( (object) array( 'ID' => null ) );
     40                            $post      = get_post( $thepostid );
     41                            WC_Meta_Box_Coupon_Data::output( (object) array( 'ID' => $temp_coupon ) );
    4142                            wp_delete_post( $temp_coupon, true );
    4243
  • coupon-generator-for-woocommerce/tags/1.3.0/includes/admin/wccg-core-functions.php

    r2538010 r3266353  
    8989        'customer_email'             => array_filter( array_map( 'trim', explode( ',', wc_clean( $args['customer_email'] ) ) ) ),
    9090        'usage_count'                => 0,
     91        'product_brands'             => isset( $args['product_brands'] ) ? array_map( 'intval', $args['product_brands'] ) : array(),
     92        'exclude_product_brands'     => isset( $args['exclude_product_brands'] ) ? array_map( 'intval', $args['exclude_product_brands'] ) : array(),
    9193    ), $coupon_id = null, $args ); // $coupon_id is deprecated as its not useful
    9294
     
    230232    $quantity = absint( $_GET['quantity'] );
    231233    $results = $wpdb->get_results(
    232         $wpdb->prepare( "SELECT post_title FROM $wpdb->posts WHERE post_type='shop_coupon' ORDER BY post_date DESC LIMIT 0, %d", $quantity )
     234        $wpdb->prepare( "SELECT post_title FROM $wpdb->posts WHERE post_type='shop_coupon' AND post_status='publish' ORDER BY post_date DESC LIMIT 0, %d", $quantity )
    233235    );
    234236
  • coupon-generator-for-woocommerce/tags/1.3.0/readme.txt

    r3149168 r3266353  
    33Tags: woocommerce coupon generator, woocommerce, woocommerce coupon, coupons, coupon importer, woocommerce automatic coupons, woocommerce random coupons
    44Requires at least: 4.0.0
    5 Tested up to: 6.0
     5Tested up to: 5.7
    66Stable tag: 1.2.0
    77Requires PHP: 5.6
     
    3232== Installation ==
    3333
    34 1. Upload the folder `woocommerce-coupon-generator to the `/wp-content/plugins/` directory.
     341. Upload the folder `woocommerce-coupon-generator to the `/wp-content/plugins/` directory
    35352. Activate the plugin through the 'Plugins' menu in WordPress
    36363. Go to the generation page and start generating :-)
  • coupon-generator-for-woocommerce/tags/1.3.0/woocommerce-coupon-generator.php

    r2538010 r3266353  
    5151    private static $instance;
    5252
     53    /**
     54     * Admin class.
     55     * @var WCCG_Admin
     56     */
     57    public $admin = null;
    5358
    5459    /**
  • coupon-generator-for-woocommerce/trunk/assets/css/woocommerce-coupon-generator-admin.min.css

    r2538010 r3266353  
    1 .steps .step{background:#8b8e94;padding:10px 20px;color:white;width:calc( ( 100% - ( 68px * 4 ) ) / 4);display:inline-block;margin-right:20px;margin-left:0px;font-weight:bold;font-size:14px;white-space:nowrap}.steps .step a{color:white;text-decoration:none}.steps .step a:focus{box-shadow:none}.steps .step.active{background:#e33a3d;border-left-color:#e33a3d}.steps .step:after{content:"";width:0px;height:0px;border-top:20px solid rgba(0,0,0,0);border-bottom:20px solid rgba(0,0,0,0);border-left:20px solid #8b8e94;float:right;position:relative;margin:-10px -40px}.steps .step:before{content:"";width:0px;height:0px;border-top:20px solid #8b8e94;border-bottom:20px solid #8b8e94;border-left:20px solid rgba(0,0,0,0);float:left;position:relative;margin:-10px -40px}.steps .step.active:after{border-left-color:#e33a3d}.steps .step.active:before{border-top-color:#e33a3d;border-bottom-color:#e33a3d}.steps .step.step-0{margin-left:20px}.wc-coupon-generator-wrap .continue-button-wrap{float:right}.wc-coupon-generator-wrap .continue-button-wrap:focus{box-shadow:none}.wc-coupon-generator-wrap .continue-button-wrap:hover .continue-button{background:#C12123}.wc-coupon-generator-wrap .continue-button-wrap:hover .continue-button:before{border-top-color:#C12123;border-bottom-color:#C12123}.wc-coupon-generator-wrap .continue-button-wrap:hover .continue-button:after{border-right-color:#C12123;border-left-color:#C12123}.wc-coupon-generator-wrap .continue-button-wrap .wccg-next{background:#E33A3D;border:none;color:#FFF;padding:10px 30px;height:18px;line-height:18px;position:relative;display:inline-block;margin-left:20px;margin-right:20px;font-weight:bold;font-size:14px;text-decoration:none}.wc-coupon-generator-wrap .continue-button-wrap .wccg-next:after{content:"";width:0px;height:0px;border-top:19px solid rgba(0,0,0,0);border-bottom:19px solid rgba(0,0,0,0);border-left:19px solid #E33A3D;position:relative;float:right;margin:-10px -49px;padding:0px;line-height:0}.wc-coupon-generator-wrap .continue-button-wrap .wccg-next:before{content:"";width:0px;height:0px;border-top:19px solid #E33A3D;border-bottom:19px solid #E33A3D;border-left:19px solid rgba(0,0,0,0);float:left;position:relative;margin:0;margin:-10px -49px}.wc-coupon-generator-wrap.wc-coupon-generator-wrap-step-2 #wc-coupon-generator-options{float:left;width:80%}.wc-coupon-generator-wrap.wc-coupon-generator-wrap-step-2 #wc-coupon-generator-options .inside{padding:0;margin:0}.wc-coupon-generator-wrap.wc-coupon-generator-wrap-step-3 .wc-coupon-generator-progress-bar{width:calc( 100% - 50px);height:30px;border:1px solid #DDD;position:relative;display:inline-block}.wc-coupon-generator-wrap.wc-coupon-generator-wrap-step-3 .wc-coupon-generator-progress-bar .wc-coupon-generator-progress-percentage{text-align:center;line-height:30px;z-index:10;position:relative;font-weight:bold;position:absolute;width:100%}.wc-coupon-generator-wrap.wc-coupon-generator-wrap-step-3 .wc-coupon-generator-progress-bar .progress{width:0%;height:30px;display:inline-block;background-color:#E33A3D;position:absolute;z-index:15;overflow:hidden;-webkit-transition:width 1s ease-in-out;-moz-transition:width 1s ease-in-out;-o-transition:width 1s ease-in-out;transition:width 1s ease-in-out}.wc-coupon-generator-wrap.wc-coupon-generator-wrap-step-3 .wc-coupon-generator-progress-bar .progress .inner-progress{position:absolute;color:#FFF;z-index:15;text-align:center;display:block;height:30px;line-height:31px;-webkit-transition:none;-moz-transition:none;-o-transition:none;transition:none}.wc-coupon-generator-wrap.wc-coupon-generator-wrap-step-3 .spinner{float:right;margin:5px 10px}.wc-coupon-generator-wrap.wc-coupon-generator-wrap-step-3 pre.wc-coupon-generator-progress-messages{background:#F5F5F5;padding:12px;max-height:300px;overflow:scroll}
     1.steps .step{background:#8b8e94;padding:10px 20px;color:#fff;width:calc((100% - 272px)/4);display:inline-block;margin-right:20px;margin-left:0px;font-weight:bold;font-size:14px;white-space:nowrap}.steps .step a{color:#fff;text-decoration:none}.steps .step a:focus{box-shadow:none}.steps .step.active{background:#e33a3d;border-left-color:#e33a3d}.steps .step:after{content:"";width:0px;height:0px;border-top:20px solid rgba(0,0,0,0);border-bottom:20px solid rgba(0,0,0,0);border-left:20px solid #8b8e94;float:right;position:relative;margin:-10px -40px}.steps .step:before{content:"";width:0px;height:0px;border-top:20px solid #8b8e94;border-bottom:20px solid #8b8e94;border-left:20px solid rgba(0,0,0,0);float:left;position:relative;margin:-10px -40px}.steps .step.active:after{border-left-color:#e33a3d}.steps .step.active:before{border-top-color:#e33a3d;border-bottom-color:#e33a3d}.steps .step.step-0{margin-left:20px}.wc-coupon-generator-wrap .continue-button-wrap{float:right}.wc-coupon-generator-wrap .continue-button-wrap:focus{box-shadow:none}.wc-coupon-generator-wrap .continue-button-wrap:hover .continue-button{background:#c12123}.wc-coupon-generator-wrap .continue-button-wrap:hover .continue-button:before{border-top-color:#c12123;border-bottom-color:#c12123}.wc-coupon-generator-wrap .continue-button-wrap:hover .continue-button:after{border-right-color:#c12123;border-left-color:#c12123}.wc-coupon-generator-wrap .continue-button-wrap .wccg-next{background:#e33a3d;border:none;color:#fff;padding:10px 30px;height:18px;line-height:18px;position:relative;display:inline-block;margin-left:20px;margin-right:20px;font-weight:bold;font-size:14px;text-decoration:none}.wc-coupon-generator-wrap .continue-button-wrap .wccg-next:after{content:"";width:0px;height:0px;border-top:19px solid rgba(0,0,0,0);border-bottom:19px solid rgba(0,0,0,0);border-left:19px solid #e33a3d;position:relative;float:right;margin:-10px -49px;padding:0px;line-height:0}.wc-coupon-generator-wrap .continue-button-wrap .wccg-next:before{content:"";width:0px;height:0px;border-top:19px solid #e33a3d;border-bottom:19px solid #e33a3d;border-left:19px solid rgba(0,0,0,0);float:left;position:relative;margin:0;margin:-10px -49px}.wc-coupon-generator-wrap.wc-coupon-generator-wrap-step-2 #wc-coupon-generator-options{float:left;width:80%}.wc-coupon-generator-wrap.wc-coupon-generator-wrap-step-2 #wc-coupon-generator-options .inside{padding:0;margin:0}.wc-coupon-generator-wrap.wc-coupon-generator-wrap-step-3 .wc-coupon-generator-progress-bar{width:calc(100% - 50px);height:30px;border:1px solid #ddd;position:relative;display:inline-block}.wc-coupon-generator-wrap.wc-coupon-generator-wrap-step-3 .wc-coupon-generator-progress-bar .wc-coupon-generator-progress-percentage{text-align:center;line-height:30px;z-index:10;position:relative;font-weight:bold;position:absolute;width:100%}.wc-coupon-generator-wrap.wc-coupon-generator-wrap-step-3 .wc-coupon-generator-progress-bar .progress{width:0%;height:30px;display:inline-block;background-color:#e33a3d;position:absolute;z-index:15;overflow:hidden;-webkit-transition:width 1s ease-in-out;-moz-transition:width 1s ease-in-out;-o-transition:width 1s ease-in-out;transition:width 1s ease-in-out}.wc-coupon-generator-wrap.wc-coupon-generator-wrap-step-3 .wc-coupon-generator-progress-bar .progress .inner-progress{position:absolute;color:#fff;z-index:15;text-align:center;display:block;height:30px;line-height:31px;-webkit-transition:none;-moz-transition:none;-o-transition:none;transition:none}.wc-coupon-generator-wrap.wc-coupon-generator-wrap-step-3 .spinner{float:right;margin:5px 10px}.wc-coupon-generator-wrap.wc-coupon-generator-wrap-step-3 pre.wc-coupon-generator-progress-messages{background:#f5f5f5;padding:12px;max-height:300px;overflow:scroll}
  • coupon-generator-for-woocommerce/trunk/assets/js/woocommerce-coupon-generator-admin.min.js

    r2538010 r3266353  
    1 "use strict";var WCCG_Generator={init:function(){this.generate_coupons(0,this)},generate_coupons:function(e,r){var t={action:"wccg_generate_coupons",form_data:jQuery(".wccg-wrap :input").serialize(),batch_step:e};jQuery.post(ajaxurl,t,function(e){(e=JSON.parse(e)).message&&r.add_message(e.message),"done"==e.step?r.completed(r,parseInt(jQuery('[name="number_of_coupons"]').val()),e.total_coupons_generated):r.generate_coupons(e.step,r),r.progress_bar(e.progress)})},progress_bar:function(e){jQuery(".wc-coupon-generator-progress-bar .progress").css("width",e+"%"),jQuery(".wc-coupon-generator-progress-percentage").html(e+"%"),jQuery(".inner-progress").css("width",jQuery(".wc-coupon-generator-progress-bar").width())},completed:function(e,r,t){jQuery(".wc-coupon-generator-progress-bar + .spinner").remove(),jQuery(".wc-coupon-generator-completed-actions").show();var o=jQuery(".wc-coupon-generator-completed-actions");o.show(),o.html(o.html().replace(/{{ couponGenerator.quantity }}/,r));var s=o.find("a");console.log(s.attr("href").replace("quantity","quantity="+r)),s.attr("href",s.attr("href").replace("quantity","quantity="+r))},add_message:function(e){jQuery(".wc-coupon-generator-progress-messages").prepend('<span class="wc-coupon-generator-progress-message">'+e+"</span><br/>")}};!function(o){o(".wccg-next").on("click",function(e){var r=o(".active-step"),t=r.next();r.removeClass("active-step").addClass("hidden"),t.removeClass("hidden").addClass("active-step"),o(".step.active").removeClass("active").next().addClass("active")}),o(".wccg-start").on("click",function(e){WCCG_Generator.init()})}(jQuery);
     1"use strict";var WCCG_Generator={init:function(){this.generate_coupons(0,this)},generate_coupons:function(e,r){var s={action:"wccg_generate_coupons",form_data:jQuery(".wccg-wrap :input").serialize(),batch_step:e};jQuery.post(ajaxurl,s,function(e){(e=JSON.parse(e)).message&&r.add_message(e.message),"done"==e.step?r.completed(r,parseInt(jQuery('[name="number_of_coupons"]').val()),e.total_coupons_generated):r.generate_coupons(e.step,r),r.progress_bar(e.progress)})},progress_bar:function(e){jQuery(".wc-coupon-generator-progress-bar .progress").css("width",e+"%"),jQuery(".wc-coupon-generator-progress-percentage").html(e+"%"),jQuery(".inner-progress").css("width",jQuery(".wc-coupon-generator-progress-bar").width())},completed:function(e,r,s){jQuery(".wc-coupon-generator-progress-bar + .spinner").remove(),jQuery(".wc-coupon-generator-completed-actions").show();var o=jQuery(".wc-coupon-generator-completed-actions");o.show(),o.html(o.html().replace(/{{ couponGenerator.quantity }}/,r));var t=o.find("a");t.attr("href",t.attr("href").replace("quantity","quantity="+r))},add_message:function(e){jQuery(".wc-coupon-generator-progress-messages").prepend('<span class="wc-coupon-generator-progress-message">'+e+"</span><br/>")}};!function(o){o(".wccg-next").on("click",function(e){var r=o(".active-step"),s=r.next();r.removeClass("active-step").addClass("hidden"),s.removeClass("hidden").addClass("active-step"),o(".step.active").removeClass("active").next().addClass("active")}),o(".wccg-start").on("click",function(e){WCCG_Generator.init()})}(jQuery);
  • coupon-generator-for-woocommerce/trunk/includes/admin/views/html-coupon-generator-step-1.php

    r2538010 r3266353  
    3636                                'post_title'  => 'temp_generator_coupon',
    3737                            ) );
    38                             global $thepostid;
     38                            global $thepostid, $post;
    3939                            $thepostid = $temp_coupon;
    40                             WC_Meta_Box_Coupon_Data::output( (object) array( 'ID' => null ) );
     40                            $post      = get_post( $thepostid );
     41                            WC_Meta_Box_Coupon_Data::output( (object) array( 'ID' => $temp_coupon ) );
    4142                            wp_delete_post( $temp_coupon, true );
    4243
  • coupon-generator-for-woocommerce/trunk/includes/admin/wccg-core-functions.php

    r2538010 r3266353  
    8989        'customer_email'             => array_filter( array_map( 'trim', explode( ',', wc_clean( $args['customer_email'] ) ) ) ),
    9090        'usage_count'                => 0,
     91        'product_brands'             => isset( $args['product_brands'] ) ? array_map( 'intval', $args['product_brands'] ) : array(),
     92        'exclude_product_brands'     => isset( $args['exclude_product_brands'] ) ? array_map( 'intval', $args['exclude_product_brands'] ) : array(),
    9193    ), $coupon_id = null, $args ); // $coupon_id is deprecated as its not useful
    9294
     
    230232    $quantity = absint( $_GET['quantity'] );
    231233    $results = $wpdb->get_results(
    232         $wpdb->prepare( "SELECT post_title FROM $wpdb->posts WHERE post_type='shop_coupon' ORDER BY post_date DESC LIMIT 0, %d", $quantity )
     234        $wpdb->prepare( "SELECT post_title FROM $wpdb->posts WHERE post_type='shop_coupon' AND post_status='publish' ORDER BY post_date DESC LIMIT 0, %d", $quantity )
    233235    );
    234236
  • coupon-generator-for-woocommerce/trunk/readme.txt

    r3149168 r3266353  
    33Tags: woocommerce coupon generator, woocommerce, woocommerce coupon, coupons, coupon importer, woocommerce automatic coupons, woocommerce random coupons
    44Requires at least: 4.0.0
    5 Tested up to: 6.0
     5Tested up to: 5.7
    66Stable tag: 1.2.0
    77Requires PHP: 5.6
     
    3232== Installation ==
    3333
    34 1. Upload the folder `woocommerce-coupon-generator to the `/wp-content/plugins/` directory.
     341. Upload the folder `woocommerce-coupon-generator to the `/wp-content/plugins/` directory
    35352. Activate the plugin through the 'Plugins' menu in WordPress
    36363. Go to the generation page and start generating :-)
  • coupon-generator-for-woocommerce/trunk/woocommerce-coupon-generator.php

    r2538010 r3266353  
    5151    private static $instance;
    5252
     53    /**
     54     * Admin class.
     55     * @var WCCG_Admin
     56     */
     57    public $admin = null;
    5358
    5459    /**
Note: See TracChangeset for help on using the changeset viewer.