本文整理汇总了PHP中wpshop_tools::search_all_possibilities方法的典型用法代码示例。如果您正苦于以下问题:PHP wpshop_tools::search_all_possibilities方法的具体用法?PHP wpshop_tools::search_all_possibilities怎么用?PHP wpshop_tools::search_all_possibilities使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wpshop_tools
的用法示例。
在下文中一共展示了wpshop_tools::search_all_possibilities方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ajax_add_new_variation_list
/**
* Variation list creation
*/
function ajax_add_new_variation_list()
{
check_ajax_referer('wpshop_variation_management', 'wpshop_ajax_nonce');
global $wpdb;
$attributes_for_variation = isset($_POST['wpshop_attribute_to_use_for_variation']) ? $_POST['wpshop_attribute_to_use_for_variation'] : null;
$current_post_id = isset($_POST['current_post_id']) ? wpshop_tools::varSanitizer($_POST['current_post_id']) : null;
/** Get the list of values of the attribute to affect to a variation */
$var = array();
foreach ($attributes_for_variation as $attribute_code) {
$query = $wpdb->prepare("SELECT data_type_to_use FROM " . WPSHOP_DBT_ATTRIBUTE . " WHERE code = %s", $attribute_code);
$var[$attribute_code] = wpshop_attributes::get_affected_value_for_list($attribute_code, $current_post_id, $wpdb->get_var($query));
}
$possible_variations = wpshop_tools::search_all_possibilities($var);
wpshop_products::creation_variation_callback($possible_variations, $current_post_id);
$output = wpshop_products::display_variation_admin($current_post_id);
echo $output;
die;
}