From v.2.3.4/1.3.4 go to tab ‘Options’ in ‘Currency aggregator’ select ‘Memcached’ or ‘Redis’ set the option ‘Storage server’, usually it is ‘localhost’ BUT different hosting companies has different options, and maybe socket is possible only, ask your hosting support or read hosting documentation set the option ‘Storage port’, usually foe Memcached port is 11211 and […]
Memcached and Redis added as currency storage Little fixes
In file functions.php file add next code:
| add_filter( 'woocommerce_price_trim_zeros', '__return_true' ); |
Fixes In option ‘Currency storage’ added native WooCommerce session for more compatibility with site set of scripts New shortcode: [woocs_price] New hook woocs_price_shortcode New hook-filter woocs_redraw_cart
Plugin link: https://pluginrepublic.com/wordpress-plugins/woocommerce-product-add-ons-ultimate/ In file plugins\product-extras-for-woocommerce\inc\functions-cart.php add next code:
| if (class_exists('WOOCS')) { global $WOOCS; if ($WOOCS->is_multiple_allowed) { $price = $WOOCS->woocs_exchange_value(floatval($price)); } } |
On the same file add next code:
| if (class_exists('WOOCS') AND $price) { global $WOOCS; if ($WOOCS->is_multiple_allowed) { $currrent = $WOOCS->current_currency; if ($currrent != $WOOCS->default_currency) { $currencies = $WOOCS->get_currencies(); $rate = $currencies[$currrent]['rate']; $price = $final_price / $price; } } } |
And to the same file:
| if (class_exists('WOOCS')) { global $WOOCS; if ($WOOCS->is_multiple_allowed AND isset($cart_item_data['product_extras']['price_with_extras'])) { $currrent = $WOOCS->current_currency; if ($currrent != $WOOCS->default_currency) { $currencies = $WOOCS->get_currencies(); $rate = $currencies[$currrent]['rate']; $cart_item_data['product_extras']['price_with_extras'] = $cart_item_data['product_extras']['price_with_extras'] / $rate; } } } |
And on the same file:
| if (class_exists('WOOCS')) { global $WOOCS; if ($WOOCS->is_multiple_allowed) { $currrent = $WOOCS->current_currency; if ($currrent != $WOOCS->default_currency) { $currencies = $WOOCS->get_currencies(); $rate = $currencies[$currrent]['rate']; $cart_item_data['product_extras']['price_with_extras_discounted'] = $cart_item_data['product_extras']['price_with_extras_discounted'] / $rate; } } } |
And on the same file:
| if (class_exists('WOOCS') AND $item['price']) { global $WOOCS; if ($WOOCS->is_multiple_allowed) { $currrent = $WOOCS->current_currency; if ($currrent != $WOOCS->default_currency) { $currencies = $WOOCS->get_currencies(); $rate = $currencies[$currrent]['rate']; $item['price'] = $rate * $item['price']; } } $item['value'] = preg_replace('/\((.+)\)/', "", $item['value']); $item['value'] .= sanitize_text_field("(" . wc_price($item['price']) . ")"); } |
Plugin link: https://codecanyon.net/item/aliexpress-dropship-for-woocommerce/19821022 Producer: https://ali2woo.com/ In file \plugins\ali2woo\includes\classes\shipping\A2W_ShippingFrontendPageController.php add next code:
| if (class_exists('WOOCS') AND $method['price'] > 0) { global $WOOCS; $method['price'] = $WOOCS->woocs_exchange_value(floatval($method['price'])); } |
Also to the same file add next code:
| if (class_exists('WOOCS') AND $method['price'] > 0) { global $WOOCS; $method['price'] = $WOOCS->woocs_exchange_value(floatval($method['price'])); } |
Plugin link: https://codecanyon.net/item/wootour-woocommerce-travel-tour-and-appointment-booking/19404740 In file \plugins\woo-tour\inc\functions.php add next code:
| if (class_exists('WOOCS')) { global $WOOCS; if ($WOOCS->is_multiple_allowed) { $price = $WOOCS->woocs_exchange_value(floatval($price)); } } |
In file plugins\woo-tour\inc\class-woo-booking.php add next code:
| }else if (class_exists('WOOCS')){ global $WOOCS; $currency = $WOOCS->current_currency; if ($WOOCS->is_multiple_allowed) { $currencies = $WOOCS->get_currencies(); $def_curr = $WOOCS->default_currency; if ($cart_object->cart_contents[$key]['_crc_when_book']!=$def_curr) { $conversion_rate = $currencies[$cart_object->cart_contents[$key]['_crc_when_book']]['rate']; $pr_b = $pr_b / $conversion_rate; $cart_object->cart_contents[$key]['_crc_when_book'] = $def_curr; } } }; |
And to the same file:
| }else if(class_exists('WOOCS')){ global $WOOCS; $currency = $WOOCS->current_currency; $cart_object->cart_contents[$key]['_crc_when_book'] = $currency; } |
Plugin link: https://codecanyon.net/item/ultimate-affiliate-pro-wordpress-plugin/16527729 In file \wp-content\plugins\indeed-affiliate-pro\public\services\Uap_Woo.class.php add next code:
| //woocs $curr = $order->get_order_currency(); if (class_exists('WOOCS')) { global $WOOCS; if ($curr != $WOOCS->default_currency) { $currencies = $WOOCS->get_currencies(); $sum = $WOOCS->back_convert($sum, $currencies[$curr]['rate']); } } |
Note: This will only work with new orders
Plugin link: https://codecanyon.net/item/sumo-affiliates-pro-wordpress-affiliate-plugin/22795996 In file wp-content\plugins\affs\inc\woocommerce\class-fs-affiliates-wc-commission.php add next code:
| if (class_exists('WOOCS')) { global $WOOCS; if ($WOOCS->is_multiple_allowed) { $currrent = $WOOCS->current_currency; if ($currrent != $WOOCS->default_currency) { $currencies = $WOOCS->get_currencies(); $rate = $currencies[$currrent]['rate']; $RegularPrice = $RegularPrice / $rate; } } } |
Plugin link: https://woocommerce.com/products/woocommerce-deposits/ In file \wp-content\plugins\woocommerce-deposits\includes\class-wc-deposits-cart-manager.php add next code:
| if (class_exists('WOOCS')) { global $WOOCS; if ($WOOCS->is_multiple_allowed) { $currrent = $WOOCS->current_currency; if ($currrent != $WOOCS->default_currency) { $currencies = $WOOCS->get_currencies(); $rate = $currencies[$currrent]['rate']; $total = $total / $rate; } } } |
On the same file add nex code:
| if (class_exists('WOOCS')) { global $WOOCS; if ($WOOCS->is_multiple_allowed) { $currrent = $WOOCS->current_currency; if ($currrent != $WOOCS->default_currency) { $currencies = $WOOCS->get_currencies(); $rate = $currencies[$currrent]['rate']; $total = $total / $rate; } } } |
In file functions.php of the current wordpress theme add next code:
| add_filter('woocommerce_deposits_get_deposit_amount', function ($deposit, $prod) { if (class_exists('WOOCS')) { global $WOOCS; $currrent = $WOOCS->current_currency; if ($currrent != $WOOCS->default_currency AND $WOOCS->is_multiple_allowed) { $currencies = $WOOCS->get_currencies(); $rate = $currencies[$currrent]['rate']; $deposit = $deposit * $rate; } } return $deposit; }, 2, 99); |