Changeset 2746903
- Timestamp:
- 06/23/2022 08:55:16 AM (4 years ago)
- Location:
- weight-based-pricing-for-woocommerce/trunk
- Files:
-
- 4 edited
-
App/Controllers/Frontend/CartAdjustments.php (modified) (1 diff)
-
App/Controllers/Frontend/ProductAdjustments.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
-
weight-based-pricing-woocommerce.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
weight-based-pricing-for-woocommerce/trunk/App/Controllers/Frontend/CartAdjustments.php
r2716634 r2746903 69 69 } 70 70 } 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; 76 74 } 77 75 -
weight-based-pricing-for-woocommerce/trunk/App/Controllers/Frontend/ProductAdjustments.php
r2685983 r2746903 68 68 $weight_unit = isset($product_data['wwbp_weight_unit'][0]) ? $product_data['wwbp_weight_unit'][0] : get_option('wwbp_default_weight_unit', 'kg'); 69 69 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); 71 72 } 72 73 … … 87 88 $weight_unit = isset($product_data['wwbp_weight_unit'][0]) ? $product_data['wwbp_weight_unit'][0] : get_option('wwbp_default_weight_unit', 'kg'); 88 89 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); 91 93 } 92 94 return $availability; -
weight-based-pricing-for-woocommerce/trunk/readme.txt
r2716645 r2746903 5 5 Requires at least: 4.9.0 6 6 Requires PHP: 5.6 7 Tested up to: 5.98 Stable tag: 1.1. 27 Tested up to: 6.0 8 Stable tag: 1.1.3 9 9 License: GPLv3 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 58 58 == Changelog == 59 59 60 = 1.1.3 - 23/06/2022 = 61 * Add - "wbp_wc_price_html" event 62 * Improvement - Weight input validation 63 60 64 = 1.1.2 - 30/04/2022 = 61 65 * Optimize - Backend JS -
weight-based-pricing-for-woocommerce/trunk/weight-based-pricing-woocommerce.php
r2716634 r2746903 4 4 * Plugin URI: https://www.themeparrot.com/ 5 5 * Description: Weight Based Product Pricing for WooCommerce helps you to set product price based on the weight. 6 * Version: 1.1. 26 * Version: 1.1.3 7 7 * Author: Themeparrot 8 8 * Author URI: https://themeparrot.com/ … … 21 21 // This plugin constants 22 22 defined('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');23 defined('WWBP_PLUGIN_VERSION') or define('WWBP_PLUGIN_VERSION', '1.1.3'); 24 24 25 25 defined('WWBP_PLUGIN_FILE') or define('WWBP_PLUGIN_FILE', __FILE__);
Note: See TracChangeset
for help on using the changeset viewer.