Created
January 17, 2019 16:18
-
-
Save CrispDev/04a7397bc3e46225332a4113b6ae8fc0 to your computer and use it in GitHub Desktop.
Default Autoship Fequency & Frequency Type Options on Product Page
This file contains 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
function autoship_new_default_frequency_options( $options ) { | |
// Return a new set of default frequency options of 1 through 4 Weeks | |
return array( | |
array( | |
// Days, Weeks, Months, DayOfTheWeek, DayOfTheMonth | |
'frequency_type' => 'Weeks', | |
// Frequency (integer) | |
'frequency' => 2, | |
'display_name' => 'Every 2 Weeks' | |
), | |
array( | |
// Days, Weeks, Months, DayOfTheWeek, DayOfTheMonth | |
'frequency_type' => 'Months', | |
// Frequency (integer) | |
'frequency' => 1, | |
'display_name' => 'Every month' | |
), | |
array( | |
// Days, Weeks, Months, DayOfTheWeek, DayOfTheMonth | |
'frequency_type' => 'Months', | |
// Frequency (integer) | |
'frequency' => 2, | |
'display_name' => 'Every 2 Months' | |
) | |
); | |
} | |
add_filter( 'autoship-default-frequency-options', 'autoship_new_default_frequency_options' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment