Changeset 3258560
- Timestamp:
- 03/19/2025 01:38:14 PM (13 days ago)
- Location:
- woo-currency/trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
woo-currency/trunk/classes/helpers/SxGeo.php
r2398076 r3258560 26 26 protected $m_idx_len; 27 27 protected $db_items; 28 protected $id_len; 29 protected $block_len; 30 protected $max_region; 31 protected $max_city; 32 protected $max_country; 33 protected $pack; 34 protected $b_idx_len; 28 35 protected $country_size; 29 36 protected $db; -
woo-currency/trunk/config.php
r3226453 r3258560 49 49 50 50 define('WCU_PLUGIN_INSTALLED', true); 51 define('WCU_VERSION', '2.1. 3');51 define('WCU_VERSION', '2.1.4'); 52 52 define('WCU_DEV_VER', 1); 53 53 define('WCU_USER', 'user'); -
woo-currency/trunk/js/core.js
r2395561 r3258560 390 390 window.sessionStorage.clear(); 391 391 } 392 document.addEventListener('DOMContentLoaded', () => { 393 if (wp && wp.data) { 394 wp.data.subscribe(() => { 395 wcuReplaceShippingCost(100); 396 }); 397 jQuery(document.body).on('click', '.wc-block-components-panel__button', function() { 398 wcuReplaceShippingCost(0); 399 wcuReplaceShippingCost(100); 400 }); 401 } 402 }); 403 function wcuReplaceShippingCost ( tt ) { 404 if (WCU_DATA.shippingCosts) { 405 setTimeout(function () { 406 for(var key in WCU_DATA.shippingCosts) { 407 var $input = jQuery('.wc-block-components-radio-control__input[value="'+key+'"]'); 408 if ($input.length) { 409 $input.parent().find('.wc-block-formatted-money-amount').html(WCU_DATA.shippingCosts[key]); 410 } 411 } 412 }, tt); 413 } 414 } -
woo-currency/trunk/modules/currency/mod.php
r3203588 r3258560 29 29 public $isYithProductAddon = false; 30 30 public $customCache = null; 31 public $shippingCosts = false; 31 32 32 33 public static $orderId = null; … … 163 164 add_filter('woocommerce_hydration_dispatch_request', array($this, 'restApiRequest'), 9999, 4); 164 165 } 165 166 166 public function enableYithAddonConverter() { 167 167 $this->isYithProductAddon = true; … … 288 288 add_filter('woocommerce_cart_get_subtotal', array($this, 'getCurrencyPriceCart'), 9999); 289 289 add_filter('woocommerce_cart_get_total', array($this, 'getCurrencyPriceCart'), 9999); 290 add_filter('woocommerce_cart_get_shipping_total', array($this, 'getShippingTotal'), 9999); 291 add_filter('woocommerce_package_rates', array($this, 'calcShippingCosts'), 2); 290 292 add_action('woocommerce_calculate_totals', array($this, 'calcLineSubtotal'), 9999); 293 dispatcherWcu::addFilter('jsInitVariables', array($this, 'addShippingCosts')); 294 } 295 public function addShippingCosts($js) { 296 if (!empty($this->shippingCosts)) { 297 $js['shippingCosts'] = $this->shippingCosts; 298 } 299 return $js; 300 } 301 public function calcShippingCosts($methods) { 302 if (!has_block('woocommerce/cart') && !has_block('woocommerce/checkout')) { 303 return $methods; 304 } 305 $costs = array(); 306 foreach ( $methods as $key => $method ) { 307 if (!empty($method->cost)) { 308 $costs[$key] = wc_price($method->cost); 309 } 310 } 311 $this->shippingCosts = $costs; 312 return $methods; 313 } 314 public function getShippingTotal($price) { 315 if (!has_block('woocommerce/cart') && !has_block('woocommerce/checkout') && !$this->isBlocksAPI()) { 316 return $price; 317 } 318 return $this->getModel()->getCurrencyPrice($price, null); 291 319 } 292 320 public function restApiRequest($response, $request, $path, $handler) { … … 296 324 return $response; 297 325 } 326 public function isBlocksAPI( ) { 327 $uri = empty($_SERVER['REQUEST_URI']) ? '' : sanitize_text_field($_SERVER['REQUEST_URI']); 328 return strpos( $uri, 'wp-json/wc/store/') && strpos( $uri, '/batch?'); 329 } 298 330 public function calcLineSubtotal( $cart ) { 299 if (has_block('woocommerce/cart') || has_block('woocommerce/checkout')) { 331 if (has_block('woocommerce/cart') || has_block('woocommerce/checkout') || $this->isBlocksAPI()) { 332 300 333 foreach ( $cart->get_cart() as $key => $cartItem ) { 301 334 if (!empty($cartItem['line_subtotal']) && !empty($cart->cart_contents[$key])) { … … 316 349 } 317 350 } 318 if (!has_block('woocommerce/cart') && !has_block('woocommerce/checkout') ) {351 if (!has_block('woocommerce/cart') && !has_block('woocommerce/checkout') && !$this->isBlocksAPI()) { 319 352 return $price; 320 353 } -
woo-currency/trunk/readme.txt
r3226453 r3258560 4 4 Donate link: https://woobewoo.com/product/woo-currency/ 5 5 Tested up to: 6.7 6 Stable tag: 2.1. 36 Stable tag: 2.1.4 7 7 8 8 WBW Currency Switcher for WooCommerce allows customers to switch products prices to any currencies. Get rates converted in the real-time with dynamic currency switcher … … 145 145 == Changelog == 146 146 147 = 2.1.4 = 148 * Fixed shipping total for cart-blocks 149 * Fixed shipping costs for cart-blocks 150 * Minor code fix 151 147 152 = 2.1.3 = 148 * Minor code fix153 * Minor code fix 149 154 150 155 = 2.1.2 = 151 * Added compatibility with Woocommerce Checkout-block152 * Minor code fix156 * Added compatibility with Woocommerce Checkout-block 157 * Minor code fix 153 158 154 159 = 2.1.1 = … … 156 161 157 162 = 2.1.0 = 158 * Minor code fix163 * Minor code fix 159 164 160 165 = 2.0.9 = 161 * Fixed compatibility with WooCommerce PayPal Payments166 * Fixed compatibility with WooCommerce PayPal Payments 162 167 163 168 = 2.0.8 = 164 * Minor code fix169 * Minor code fix 165 170 166 171 = 2.0.7 = -
woo-currency/trunk/wcu.php
r3226453 r3258560 3 3 * Plugin Name: WBW Currency Switcher for WooCommerce 4 4 * Description: WBW Currency Switcher for WooCommerce allows the customers switch products prices to any currencies. Get rates converted in the real time with dynamic currency switcher 5 * Version: 2.1. 35 * Version: 2.1.4 6 6 * Author: woobewoo 7 7 * Author URI: https://woobewoo.com 8 8 * WC requires at least: 3.4.0 9 * WC tested up to: 9. 6.09 * WC tested up to: 9.7.1 10 10 * Text Domain: woo-currency 11 11 * Domain Path: /languages
Note: See TracChangeset
for help on using the changeset viewer.