wc_autoship_line_discount (filter)

Enact a custom line discount for Autoship Items

Example

<?php

/**
* @param float $line_discount
* @param int $autoship_item_id
* @param float $autoship_item_price
* @return float
*/
function wc_autoship_line_discount_example( $line_discount, $autoship_item_id, $autoship_item_price ) {
  // Enact $10 line discount for items over $100
  if ( $autoship_item_price > 100.0 ) {
    $line_discount = 10.0;
  }
  return $line_discount;
}
add_filter( 'wc_autoship_line_discount', 'wc_autoship_line_discount_example', 10, 3 );

Still need help? Contact Us Contact Us