Content of the page

realmag777

All posts by realmag777

How to display on woocommerce checkout page payment gate info

If you need to show to your customer any special info on the checkout page when they select method of paying you can use next custom script: add_action(‘wp_footer’, function() { if (is_checkout()) { ?> <script> jQuery(function ($) { $(‘<div class=”your_css_class_here”></div>’).insertAfter(‘.shop_table.woocommerce-checkout-review-order-table’); woocs_init_payment_meth(); }); function woocs_init_payment_meth() { jQuery(‘ul.wc_payment_methods li input’).on(‘click’, function (e) { jQuery(‘.your_css_class_here’).hide(); switch (jQuery(this).attr(‘id’)) {… read more

Update v.2.2.9/v.1.2.9

heap of small fixes added in currencies new field as ‘interes’ which allows to add some your interest to the currencies rates added possibility to set currencies as Public or as Private. In private mode currency not published in switchers and user cannot set it by link through ‘?currency=XXX’ new in-built module Statistic: enable it… read more

Using REST API with woocommerce currency switcher

From plugin version 2.2.9/1.2.9 appeared possibility to use in-built REST request to get site currencies data: wp-json/woocs/v3/currency Also WOOCS allows using its API create any custom REST requests, as an example below which allows to get all shop products prices in all its currencies (wp-json/woocs/v3/products/gbp): add_action(‘rest_api_init’, function () { //Example: wp-json/woocs/v3/products/eur/ register_rest_route(‘woocs/v3’, ‘/products/(?P<currency>.+)’, array( ‘methods’… read more

WooCommerce Composite Products

Plugin: https://woocommerce.com/products/composite-products/ in file wp-content\plugins\woocommerce-composite-products\includes\class-wc-cp-display.php add next code: $suffix=”; in file wp-content\plugins\woocommerce-composite-products\assets\js\frontend\add-to-cart-composite.js add next code: if (typeof woocs_current_currency != ‘undefined’ && typeof woocs_current_currency[‘rate’] != ‘undefined’) { price_data.base_price = price_data.base_price * woocs_current_currency[‘rate’]; price_data.base_regular_price = price_data.base_regular_price * woocs_current_currency[‘rate’]; composite_totals.price = composite_totals.price * woocs_current_currency[‘rate’]; composite_totals.regular_price = composite_totals.regular_price * woocs_current_currency[‘rate’]; }

Flexible Product Fields Pro (by wpdesk.net)

Plugin: https://www.wpdesk.net/products/flexible-product-fields-pro-woocommerce/ in file \wp-content\plugins\flexible-product-fields\classes\fpf-product-fields.php add next code: if (class_exists(‘WOOCS’)) { global $WOOCS; if ($WOOCS->is_multiple_allowed) { $price = $WOOCS->woocs_exchange_value(floatval($price)); } } in file \wp-content\plugins\flexible-product-fields\classes\fpf-cart.php add next code: $cost = $cart_item[‘data’]->get_price() + $extra_cost; if (class_exists(‘WOOCS’)) { global $WOOCS; if ($WOOCS->is_multiple_allowed) { $currencies = $WOOCS->get_currencies(); $conversion_rate = $currencies[$WOOCS->current_currency][‘rate’]; $cost = $cost / $conversion_rate; } } $cart_item[‘data’]->set_price($cost); Please … read more

Finale Lite – Sales Countdown Timer & Discount for WooCommerce (by XLPlugins)

Plugin: https://wordpress.org/plugins/finale-woocommerce-sales-countdown-timer-discount/ in file  wp-content\plugins\finale-woocommerce-sales-countdown-timer-discount\includes\wcct-cart.php add next code: if (class_exists(‘WOOCS’)) { global $WOOCS; $currrent = $WOOCS->current_currency; if ($currrent != $WOOCS->default_currency) { $currencies = $WOOCS->get_currencies(); $rate = $currencies[$currrent][‘rate’]; $price = $price / ($rate); } }

Wholesale Suite

Plugin: https://wholesalesuiteplugin.com/ in file \wp-content\plugins\woocommerce-wholesale-prices\includes\class-wwp-wholesale-prices.php add next code: if (class_exists(‘WOOCS’)) { global $WOOCS; $currrent = $WOOCS->current_currency; if ($currrent != $WOOCS->default_currency) { $currencies = $WOOCS->get_currencies(); $rate = $currencies[$currrent][‘rate’]; $wholesale_price = $wholesale_price / ($rate); } } if (class_exists(‘WOOCS’)) { global $WOOCS; $wholesale_price = $WOOCS->woocs_exchange_value($wholesale_price); }  

DOKAN

Plugin: https://wedevs.com/dokan/ in functions.php of your current wp theme add next code: add_action(‘woocommerce_order_status_completed’, ‘woocs_payment_complete’, 1); add_action(‘woocommerce_payment_complete’, ‘woocs_payment_complete’); function so_payment_complete($order_id) { if (class_exists(‘WOOCS’)) { global $WOOCS; $WOOCS->recalculate_order($order_id); } } add_filter(‘wp_head’, function() { if (is_page(‘dashboard’)) { if (class_exists(‘WOOCS’)) { global $WOOCS; $WOOCS->reset_currency(); } } });    

WooCommerce Points and Rewards (by WooCommerce)

Plugin: https://woocommerce.com/products/woocommerce-points-and-rewards/ in file \plugins\woocommerce-points-and-rewards\includes\class-wc-points-rewards-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’]; $amount = $amount / ($rate); } } } if (class_exists(‘WOOCS’)) { global $WOOCS; if ($WOOCS->is_multiple_allowed) { $currrent = $WOOCS->current_currency; if ($currrent != $WOOCS->default_currency) { $currencies… read more