Created
May 23, 2015 15:36
-
-
Save chrdesigner/df1b11fab8b4c8d32a64 to your computer and use it in GitHub Desktop.
Adicionar Um Unico Item por Carrinho - WooCommerce
This file contains hidden or 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 | |
| /* | |
| * Função para adicionar um único item por carrinho | |
| */ | |
| function woo_unico_produto( $cart_item_data ) { | |
| global $woocommerce; | |
| $woocommerce->cart->empty_cart(); | |
| return $cart_item_data; | |
| } | |
| add_filter( 'woocommerce_add_cart_item_data', 'woo_unico_produto' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment