Skip to content

Instantly share code, notes, and snippets.

@plugin-republic
Created June 30, 2021 12:55
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 plugin-republic/f0f6df5fcb81ba79ee090b9faa7737bb to your computer and use it in GitHub Desktop.
Save plugin-republic/f0f6df5fcb81ba79ee090b9faa7737bb to your computer and use it in GitHub Desktop.
<?php
/**
* Ignore discount on first x items in bulk rule
*/
function prefix_bulk_adjusted_items( $quantity, $cart_item ) {
$ignore = 1; // Update the value here to equal the number of items that will not get discounted
return $quantity - $ignore;
}
add_filter( 'wcfad_bulk_adjusted_items', 'prefix_bulk_adjusted_items', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment