Plugin Directory

Changeset 2545014


Ignore:
Timestamp:
06/09/2021 12:15:32 PM (4 years ago)
Author:
wpashokg
Message:

Bug fix for divide by zero error

Location:
woo-min-max-quantity-limit
Files:
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • woo-min-max-quantity-limit/tags/2.1.8/changelog.txt

    r2544781 r2545014  
    11*** WC Minimum & Maximum Quantity  Changelog ***
     22021.06.09 - version 2.1.8
     3 * Bug Fix: Division by zero error fix
    242021.06.09 - version 2.1.7
    35 * Bug Fix: To set the default increment by value @tigerrockmartialarts
  • woo-min-max-quantity-limit/tags/2.1.8/readme.txt

    r2544781 r2545014  
    66Tested up to: 5.7.2
    77Stable tag: 2.1.7
    8 WC tested up to: 5.3.0
     8WC tested up to: 5.4.0
    99License: GNU General Public License v3.0
    1010License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    4444
    4545== Changelog ==
     46= 2.1.8 =
     47Bug Fix: Bug fix for division or modulo by zero
    4648= 2.1.7 =
    4749Bug Fix: To set the default increment by value @tigerrockmartialarts
  • woo-min-max-quantity-limit/tags/2.1.8/woo-min-max-quantity.php

    r2544781 r2545014  
    44  Plugin URI:  http://ashokg.in/
    55  Description: Allow the site admin to enable the feature of minimum and maximum purchase of a particular product in each product.
    6   Version: 2.1.7
     6  Version: 2.1.8
    77  Author: Ashok G
    88  Text Domain: wcmmax
    99  Author URI: https://ashokg.in
    10   WC tested up to: 5.3.0
     10  WC tested up to: 5.4.0
    1111  Copyright: © 201 Ashok G.
    1212  License: GNU General Public License v3.0
     
    118118    $maxQty = get_post_meta($prodid, '_wc_mmax_max', true);
    119119    $incrementbyQty = get_post_meta($prodid, '_wc_mmax_increment', true);
     120    $incrementbyQty = $incrementbyQty ? $incrementbyQty : 1;
    120121    if ($minQty > 0 && $maxQty > 0 && $mmaxEnable == 1) {
    121122        $args['min_value'] = $minQty; // Starting value
     
    131132
    132133function wc_mmax_custom_add_to_cart($args, $product) {
    133     $orderQTY = $_POST['quantity'];
     134    $orderQTY = isset($_POST['quantity']) ? $_POST['quantity'] : 1;
    134135    $mmaxEnable = get_post_meta($product, '_wc_mmax_prd_opt_enable', true);
    135136    $minQty = get_post_meta($product, '_wc_mmax_min', true);
     
    145146    if ($maxQty < $cartQty && $mmaxEnable == 1) {
    146147
    147         wc_add_notice($maxQTYMsg . $orderQTY+$cartQty, 'error');
     148        wc_add_notice($maxQTYMsg, 'error');
    148149        exit(wp_redirect(get_permalink($product)));
    149150    }
     
    215216        $mmaxEnable = get_post_meta($ci['product_id'], '_wc_mmax_prd_opt_enable', true);
    216217        $incrementbyQty = get_post_meta($ci['product_id'], '_wc_mmax_increment', true);
     218        $incrementbyQty = $incrementbyQty ? $incrementbyQty : 1;
    217219        $factory = new WC_Product_Factory();
    218220        $product = $factory->get_product($ci['product_id']);
  • woo-min-max-quantity-limit/trunk/changelog.txt

    r2544781 r2545014  
    11*** WC Minimum & Maximum Quantity  Changelog ***
     22021.06.09 - version 2.1.8
     3 * Bug Fix: Division by zero error fix
    242021.06.09 - version 2.1.7
    35 * Bug Fix: To set the default increment by value @tigerrockmartialarts
  • woo-min-max-quantity-limit/trunk/readme.txt

    r2544781 r2545014  
    66Tested up to: 5.7.2
    77Stable tag: 2.1.7
    8 WC tested up to: 5.3.0
     8WC tested up to: 5.4.0
    99License: GNU General Public License v3.0
    1010License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    4444
    4545== Changelog ==
     46= 2.1.8 =
     47Bug Fix: Bug fix for division or modulo by zero
    4648= 2.1.7 =
    4749Bug Fix: To set the default increment by value @tigerrockmartialarts
  • woo-min-max-quantity-limit/trunk/woo-min-max-quantity.php

    r2544781 r2545014  
    44  Plugin URI:  http://ashokg.in/
    55  Description: Allow the site admin to enable the feature of minimum and maximum purchase of a particular product in each product.
    6   Version: 2.1.7
     6  Version: 2.1.8
    77  Author: Ashok G
    88  Text Domain: wcmmax
    99  Author URI: https://ashokg.in
    10   WC tested up to: 5.3.0
     10  WC tested up to: 5.4.0
    1111  Copyright: © 201 Ashok G.
    1212  License: GNU General Public License v3.0
     
    118118    $maxQty = get_post_meta($prodid, '_wc_mmax_max', true);
    119119    $incrementbyQty = get_post_meta($prodid, '_wc_mmax_increment', true);
     120    $incrementbyQty = $incrementbyQty ? $incrementbyQty : 1;
    120121    if ($minQty > 0 && $maxQty > 0 && $mmaxEnable == 1) {
    121122        $args['min_value'] = $minQty; // Starting value
     
    131132
    132133function wc_mmax_custom_add_to_cart($args, $product) {
    133     $orderQTY = $_POST['quantity'];
     134    $orderQTY = isset($_POST['quantity']) ? $_POST['quantity'] : 1;
    134135    $mmaxEnable = get_post_meta($product, '_wc_mmax_prd_opt_enable', true);
    135136    $minQty = get_post_meta($product, '_wc_mmax_min', true);
     
    145146    if ($maxQty < $cartQty && $mmaxEnable == 1) {
    146147
    147         wc_add_notice($maxQTYMsg . $orderQTY+$cartQty, 'error');
     148        wc_add_notice($maxQTYMsg, 'error');
    148149        exit(wp_redirect(get_permalink($product)));
    149150    }
     
    215216        $mmaxEnable = get_post_meta($ci['product_id'], '_wc_mmax_prd_opt_enable', true);
    216217        $incrementbyQty = get_post_meta($ci['product_id'], '_wc_mmax_increment', true);
     218        $incrementbyQty = $incrementbyQty ? $incrementbyQty : 1;
    217219        $factory = new WC_Product_Factory();
    218220        $product = $factory->get_product($ci['product_id']);
Note: See TracChangeset for help on using the changeset viewer.