PluginUs.Net - Business Tools for WooCommerce and WordPress

[realize your idea - make your dreams come true]

Support Forum

You need to log-in to create request (topic) to the support

Compatibility issue with WooCommerce Side Cart (Ajax) by XootiX

The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday. If you have problems with registration ask help on contact us page please
If you not got email within 24~36 business hours, firstly check your spam box, and if no any email from the support there - back to the forum and read answer here. DO NOT ANSWER ON EMAILS [noreply@pluginus.net] FROM THE FORUM!! Emails are just for your info, all answers should be published only here.
The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday.

Hi there.

I've set up WooCommerce Side Cart (Ajax) by XootiX plugin (https://wordpress.org/plugins/side-cart-woocommerce/) to show the shipping bar with the remaining amount left to free shipping. However, when I select another currency, I noticed that the calculation is wrong. For example, I require $100 USD to get free shipping. When I change the currency to EUR for example, the requirement becomes 100 EUR to get free shipping which is incorrect. It should be about 84 EUR. It seems like it is not taking into account the change in currency.

I've contacted XootiX support and this is what they say:

Price is stored only in 1 currency in database. WOOCS then converts this databse.
Unfortunately, there is nothing I can do from my side.
You will have to contact their support & ask why it is not converting the shipping values.
You can pass on this message.

Side cart is using wc_price() function to display “Amount left for free shipping” & below is the function to fetch value. What else is required?

public function get_shipping_bar_data(){

                        $data = array();

                        $hasFreeShipping       = false;

                        $amountLeft               = $fillPercentage = null;

                        $subtotal                                 = WC()->cart->get_subtotal() + WC()->cart->get_subtotal_tax();

                        $packages = WC()->shipping()->get_packages();

                        if( empty( $packages ) ) return $data;

                        //Support for 1 package only

                        $package = $packages[0];

                        $available_methods = $package['rates'];

                        foreach ( $available_methods as $id => $obj ) {

                                    if( $obj instanceof WC_Shipping_Free_Shipping ){

                                                $hasFreeShipping = true;

                                                break;

                                    }

                        }

                        if( !$hasFreeShipping ){

                                    $shipping_zone                       = WC_Shipping_Zones::get_zone_matching_package( $package );

                                    $shipping_methods    = $shipping_zone->get_shipping_methods(true);

                                    foreach ( $shipping_methods as $id => $obj ) {

                                                if( $obj instanceof WC_Shipping_Free_Shipping && ( $obj->requires === 'min_amount' || $obj->requires === 'either' ) ){

                                                            if( $obj->ignore_discounts ==="no" && !empty( WC()->cart->get_coupon_discount_totals() ) ){

                                                                        foreach ( WC()->cart->get_coupon_discount_totals() as $coupon_code => $coupon_value ) {

                                                                                    $subtotal -= $coupon_value;

                                                                        }

                                                            }

                                                            if( $subtotal >= $obj->min_amount ){

                                                                        $hasFreeShipping = true;

                                                            }

                                                            else{

                                                                        $amountLeft   = $obj->min_amount - $subtotal;

                                                                        $fillPercentage =  ceil( ($subtotal/$obj->min_amount) * 100 );

                                                            }

                                                            break;

                                                }

                                    }

                        }

                        if( !$hasFreeShipping && is_null( $amountLeft ) ) return $data;

                        $data = array(

                                    'free'                                        => $hasFreeShipping,

                                    'amount_left'              => $amountLeft,

                                    'fill_percentage'          => $hasFreeShipping ? 100 : $fillPercentage

                        );

                        return apply_filters( 'xoo_wsc_shipping_bar_data', $data );

            }

Would you be able to advise on this?

Thank you

Nelson

Hello Nelson

Please  renew  your  support

Read  this  please - https://currency-switcher.com/woocs-labs/

Did you  add  access to  your test  site?

 

Hi Pablo,

I've renewed the support. The plugin is not listed in the link provided.

I've provided all the necessary access information for my test site.

 

Thank you.

Nelson

Hello Nelson

I added this to the adaptation queue

Hello

Please  do  a test

In  file  - \wp-content\plugins\woocommerce-side-cart-premium\includes\class-xoo-wsc-cart.php  - I added this  code - https://c2n.me/4bhByG1.png

if (class_exists('WOOCS')) {
global $WOOCS;
if ($WOOCS->is_multiple_allowed) {
$obj->min_amount = $WOOCS->woocs_exchange_value(floatval($obj->min_amount));
}
}