Skip to content

Instantly share code, notes, and snippets.

@bizzthemes
Created June 10, 2015 12:36
Show Gist options
  • Save bizzthemes/c7d0ab380d8030aa5f5b to your computer and use it in GitHub Desktop.
Save bizzthemes/c7d0ab380d8030aa5f5b to your computer and use it in GitHub Desktop.
Apply Discount without a Coupon Code for Car Hire
<?php
//* Do NOT include the opening php tag, only copy the code below to custom_functions.php file
add_filter( 'bizz_coupon_filter', 'custom_coupon_filter' );
function custom_coupon_filter( $coupon_post ) {
$coupon_post['type'] = 'percentage'; // 'percentage', 'fixed_unit', 'fixed_block'
$coupon_post['amount'] = '10';
$coupon_post['car'] = array( 'all' ); // accepts array of vehicle ID's or 'all' for all vehicles
$coupon_post['extra'] = array( 'all' ); // accepts array of extra ID's or 'all' for all extras
return $coupon_post;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment