Last active
November 15, 2024 15:52
-
-
Save BFTrick/7137572 to your computer and use it in GitHub Desktop.
Revisions
-
BFTrick revised this gist
Nov 23, 2013 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -5,8 +5,8 @@ function my_wc_force_sell_add_to_cart_product( $product ){ } add_filter( 'wc_force_sell_add_to_cart_product', 'my_wc_force_sell_add_to_cart_product' ); // when a synced force sell product is updated always set it to 1 function my_wc_force_sell_update_quantity( $quantity, $product ){ return 1; } add_filter( 'wc_force_sell_update_quantity', 'my_wc_force_sell_update_quantity' ); -
BFTrick revised this gist
Nov 23, 2013 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,3 @@ // only add one force sell product to the cart no matter how many of the original product are added function my_wc_force_sell_add_to_cart_product( $product ){ $product['quantity'] = 1; -
BFTrick revised this gist
Oct 24, 2013 . 1 changed file with 8 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,13 @@ <?php // only add one force sell product to the cart no matter how many of the original product are added function my_wc_force_sell_add_to_cart_product( $product ){ $product['quantity'] = 1; return $product; } add_filter( 'wc_force_sell_add_to_cart_product', 'my_wc_force_sell_add_to_cart_product' ); // when a synced force sell product is updated always set it to 2 function my_wc_force_sell_update_quantity( $quantity, $product ){ return 2; } add_filter( 'wc_force_sell_update_quantity', 'my_wc_force_sell_update_quantity' ); -
BFTrick created this gist
Oct 24, 2013 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,6 @@ <?php function my_wc_force_sell_add_to_cart_product( $product ){ $product['quantity'] = 1; return $product; } add_filter( 'wc_force_sell_add_to_cart_product', 'my_wc_force_sell_add_to_cart_product' );