Last active
January 12, 2017 11:29
-
-
Save seoindex/1032eb5cd4748619873c8a61b2920973 to your computer and use it in GitHub Desktop.
Woocommerce - Applicare sconto se è presente un prodotto specifico nel carrello
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
function check($product_id) { | |
global $woocommerce; | |
foreach($woocommerce->cart->get_cart() as $key => $val ) { | |
$_product = $val['data']; | |
if($product_id == $_product->id ) { | |
return true; | |
} | |
} | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment