Skip to content

Instantly share code, notes, and snippets.

@Musilda
Created April 13, 2019 03:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Musilda/2aabab246e80576e7c3699e04932f4e2 to your computer and use it in GitHub Desktop.
Save Musilda/2aabab246e80576e7c3699e04932f4e2 to your computer and use it in GitHub Desktop.
<?php
add_filter( 'zasilkovna_shipping_cost', 'change_cost_zasilkovna_for_product' );
function change_cost_zasilkovna_for_product( $cost ){
$items = WC()->cart->get_cart();
foreach($items as $item => $values) {
if( $values['data']->get_id() == 31 ){
$cost = $cost * 3;
}
}
return $cost;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment