for client of mine i'm developing webshop using woocommerce.
when total order weight more 30kg and/or when shipping address not netherlands user needs contact owner of webshop shipping rates.
for first condition (order more 30kg) have created following in functions.php display notification message @ cart , checkout page:
add_action('wp_enqueue_scripts', 'enqueue_childtheme_scripts', 1000); // max weight check add_action('woocommerce_check_cart_items','check_cart_weight'); function check_cart_weight(){ global $woocommerce; $weight = $woocommerce->cart->cart_contents_weight; if( $weight > 30 && icl_language_code=='en' ){ wc_add_notice( sprintf( __( 'the total weight of order %skg. please <a href="http://www.link-to-webshop.nl/en/contact/">contact us</a> shipping rates orders above 30kg.', 'woocommerce' ), $weight ) ); } elseif( $weight > 30 && icl_language_code=='nl' ){ wc_add_notice( sprintf( __( 'het totale gewicht van uw bestelling bedraagt %skg. voor de verzendkosten van bestellingen van boven de 30kg dient u <a href="http://www.link-to-webshop.nl/contact/">contact</a> met ons op te nemen.', 'woocommerce' ), $weight ) ); } }
so works charm. problem don't know how create notification message @ cart , checkout page when user has selected other country ship netherlands.
does know how achieve this?
have tried plugins?
https://wordpress.org/plugins/oik-weightcountry-shipping/
there official plugin woothemes, it's pricey
http://www.woothemes.com/products/woocommerce-conditional-shipping-and-payments/
Comments
Post a Comment