Plugin Directory

Changeset 2746903


Ignore:
Timestamp:
06/23/2022 08:55:16 AM (4 years ago)
Author:
themeparrot
Message:

release 1.1.3

Location:
weight-based-pricing-for-woocommerce/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • weight-based-pricing-for-woocommerce/trunk/App/Controllers/Frontend/CartAdjustments.php

    r2716634 r2746903  
    6969            }
    7070        }
    71         if (is_numeric($interval)) {
    72             if(strlen(substr(strrchr($weight_qty, "."), 1)) > strlen(substr(strrchr($interval, "."), 1))) {
    73                 wc_add_notice(__('Invalid weight quantity', 'weight-based-pricing-woocommerce'), 'error');
    74                 return false;
    75             }
     71        if (strlen(substr(strrchr($weight_qty, "."), 1)) > 3) {
     72            wc_add_notice(__('Invalid weight quantity', 'weight-based-pricing-woocommerce'), 'error');
     73            return false;
    7674        }
    7775       
  • weight-based-pricing-for-woocommerce/trunk/App/Controllers/Frontend/ProductAdjustments.php

    r2685983 r2746903  
    6868        $weight_unit = isset($product_data['wwbp_weight_unit'][0]) ? $product_data['wwbp_weight_unit'][0] : get_option('wwbp_default_weight_unit', 'kg');
    6969
    70         return $html . '/' . $weight_unit;
     70        $html_with_unit = $html . '/' . $weight_unit;
     71        return apply_filters('wbp_wc_price_html', $html_with_unit, $html, $product, $weight_unit);
    7172    }
    7273
     
    8788        $weight_unit = isset($product_data['wwbp_weight_unit'][0]) ? $product_data['wwbp_weight_unit'][0] : get_option('wwbp_default_weight_unit', 'kg');
    8889
    89         if ($product->is_in_stock() && $product->managing_stock()) {
    90             $availability['availability'] = $product->get_stock_quantity() . $weight_unit . ' in stock';
     90        if ($product->managing_stock() && $product->is_in_stock() && !$product->backorders_allowed()) {
     91            $stock_with_unit = $product->get_stock_quantity() . $weight_unit;
     92            $availability['availability'] = sprintf(__('%s in stock', 'woocommerce'), $stock_with_unit);
    9193        }
    9294        return $availability;
  • weight-based-pricing-for-woocommerce/trunk/readme.txt

    r2716645 r2746903  
    55Requires at least: 4.9.0
    66Requires PHP: 5.6
    7 Tested up to: 5.9
    8 Stable tag: 1.1.2
     7Tested up to: 6.0
     8Stable tag: 1.1.3
    99License: GPLv3 or later
    1010License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    5858== Changelog ==
    5959
     60= 1.1.3 - 23/06/2022 =
     61* Add - "wbp_wc_price_html" event
     62* Improvement - Weight input validation
     63
    6064= 1.1.2 - 30/04/2022 =
    6165* Optimize - Backend JS
  • weight-based-pricing-for-woocommerce/trunk/weight-based-pricing-woocommerce.php

    r2716634 r2746903  
    44 * Plugin URI: https://www.themeparrot.com/
    55 * Description: Weight Based Product Pricing for WooCommerce helps you to set product price based on the weight.
    6  * Version: 1.1.2
     6 * Version: 1.1.3
    77 * Author: Themeparrot
    88 * Author URI: https://themeparrot.com/
     
    2121// This plugin constants
    2222defined('WWBP_PLUGIN_NAME') or define('WWBP_PLUGIN_NAME', 'Weight Based Pricing for WooCommerce');
    23 defined('WWBP_PLUGIN_VERSION') or define('WWBP_PLUGIN_VERSION', '1.1.2');
     23defined('WWBP_PLUGIN_VERSION') or define('WWBP_PLUGIN_VERSION', '1.1.3');
    2424
    2525defined('WWBP_PLUGIN_FILE') or define('WWBP_PLUGIN_FILE', __FILE__);
Note: See TracChangeset for help on using the changeset viewer.