bitfenix
Forum Replies Created
-
Forum: Plugins
In reply to: [Rich Reviews by Starfish] Reviews are not showing on multilang pagesThanks for the quick reply.
This solution would show all reviews from all pages. Thing is, I have a few different pages on English, each page with each own group of reviews, which I need to show on the same pages but different languages.
Example:
Page 1 – English, with reviews only for Page 1, to display on Page 1 – Swedish.
Page 2 – English, different reviews only for Page 2, to display on Page 2 – Swedish.etc. Sorry since I’ve didn’t noted this in the initial post.
Forgot to write so we can mark the topic as solved :>
If someone need the same thing, the solution was:
add_filter('bring_shipping_rates', function( $rates ) { $shipping_classes = [ 'freeshipping', ]; $free = false; $items = WC()->cart->get_cart(); foreach ( $items as $item ) { $shipping_class = $item['data']->get_shipping_class(); if ( in_array( $shipping_class, $shipping_classes ) ) { $free = true; } } if ($free) { $rates[0]['cost'] = 0; } return $rates; }, 999 );This code is placed in theme’s function.php file. Before this, shipping class needs to be created (name of the shipping class will be matched here http://prntscr.com/qgv9wf)
After that these lines are commented http://prntscr.com/qgvd6w in the wp-cart-functions.php in the woocommerce plugin
I knew I should be a backend dev : ) Thank you for providing example code, will place it in child theme function file and then try to modify it.