Created
January 18, 2018 19:49
-
-
Save allendav/1b19ce2625b07d5c7490e20176785876 to your computer and use it in GitHub Desktop.
Quick PHP to generate product add-on import string (6 groups of 75)
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
<?php | |
$bar = array(); | |
for ( $group = 0; $group < 6; $group++ ) { | |
$options = array(); | |
for ( $option = 0; $option < 75; $option++ ) { | |
$options[] = array( | |
'label' => "GROUP $group OPTION $option", | |
'price' => '1', | |
'min' => '', | |
'max' => '' | |
); | |
} | |
$bar[] = array( | |
'name' => "GROUP $group", | |
'description' => "DESCRIPTION $group", | |
'type' => 'radiobutton', | |
'position' => 0, | |
'options' => $options, | |
'required' => 0 | |
); | |
} | |
$foo = serialize( $bar ); | |
echo "$foo\n"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment