Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
/**
* Create a look up table for calculation fields
*/
function my_prefix_calculation_look_up_tables( $tables ) {
// The key is the x axis value / the value is a second array where the key is the y axis and the value is the value to be returned
$tables['wooden_blinds'] = array(
'60' => array(
'60' => 118,
'80' => 131,
'100' => 143,
'120' => 156,
'140' => 169,
'160' => 183,
'180' => 196,
'200' => 210,
'220' => 223,
'240' => 235
),
'80' => array(
'60' => 144,
'80' => 161,
'100' => 178,
'120' => 195,
'140' => 213,
'160' => 230,
'180' => 248,
'200' => 265,
'220' => 282,
'240' => 301
),
'100' => array(
'60' => 178,
'80' => 198,
'100' => 218,
'120' => 241,
'140' => 263,
'160' => 285,
'180' => 307,
'200' => 328,
'220' => 351,
'240' => 372
),
'120' => array(
'60' => 208,
'80' => 232,
'100' => 257,
'120' => 284,
'140' => 309,
'160' => 336,
'180' => 363,
'200' => 388,
'220' => 415,
'240' => 441
),
'140' => array(
'60' => 233,
'80' => 262,
'100' => 291,
'120' => 322,
'140' => 353,
'160' => 383,
'180' => 414,
'200' => 445,
'220' => 475,
'240' => 506
),
'160' => array(
'60' => 271,
'80' => 304,
'100' => 337,
'120' => 371,
'140' => 407,
'160' => 442,
'180' => 477,
'200' => 513,
'220' => 548,
'240' => 582
),
'180' => array(
'60' => 296,
'80' => 334,
'100' => 371,
'120' => 411,
'140' => 450,
'160' => 490,
'180' => 530,
'200' => 568,
'220' => 608,
'240' => 647
),
'200' => array(
'60' => 322,
'80' => 364,
'100' => 406,
'120' => 449,
'140' => 493,
'160' => 537,
'180' => 581,
'200' => 625,
'220' => 669,
'240' => 712
),
'220' => array(
'60' => 360,
'80' => 406,
'100' => 450,
'120' => 499,
'140' => 548,
'160' => 596,
'180' => 644,
'200' => 692,
'220' => 740,
'240' => 789
),
'240' => array(
'60' => 386,
'80' => 435,
'100' => 485,
'120' => 538,
'140' => 591,
'160' => 643,
'180' => 696,
'200' => 749,
'220' => 801,
'240' => 853
),
'260' => array(
'60' => 423,
'80' => 477,
'100' => 531,
'120' => 587,
'140' => 645,
'160' => 702,
'180' => 759,
'200' => 816,
'220' => 873,
'240' => 930
),
'280' => array(
'60' => 449,
'80' => 507,
'100' => 565,
'120' => 627,
'140' => 688,
'160' => 750,
'180' => 811,
'200' => 873,
'220' => 934,
'240' => 995
),
'300' => array(
'60' => 475,
'80' => 537,
'100' => 599,
'120' => 666,
'140' => 732,
'160' => 797,
'180' => 863,
'200' => 929,
'220' => 994,
'240' => 1060
),
);
$tables['fabric_blinds'] = array(
'60' => array(
'60' => 118,
// etc
)
);
return $tables;
}
add_filter( 'pewc_calculation_look_up_tables', 'my_prefix_calculation_look_up_tables' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.