Created
April 13, 2019 03:45
-
-
Save Musilda/2aabab246e80576e7c3699e04932f4e2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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