本文整理匯總了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;
}